Apache Axis2 User's Guide - Creating Clients - apache

I am following along in the "Apache Axis2 User's Guide - Creating Clients"
http://axis.apache.org/axis2/java/core/docs/userguide-creatingclients.html#choosingclient
My problem is when I execute the command line argument from the guide:
%AXIS2_HOME%\bin\WSDL2Java -uri Axis2UserGuide.wsdl -p org.apache.axis2.axis2userguide -d adb -s
I get the following response, I am also unsure where axis2userguide.wsdl resides in the axis2 distribution.
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Unable to resolve imported document at 'Axis2UserGuide.wsdl'.: java.io.FileNotFoundException: This file was not found: file:/C:/Desktop/axis2-1.6.2/bin/Axis2UserGuide.wsdl
Is axis2userguide.wsdl a file included in the distro, or is it an arbitrary file name?
Thanks

I was able to the complete the step of creating the stub in the tutorial by doing the following:
C:\axis2-1.6.2\samples\quickstart>set CLASSPATH=%CLASSPATH%;C:\axis2-1.6.2\samples\quickstart\build\classes;
C:\axis2-1.6.2\samples\quickstart>%AXIS2_HOME%\bin\java2wsdl -cp . -cn samples.quickstart.service.pojo.StockQuoteService -of StockQuoteService.wsdl
C:\axis2-1.6.2\samples\quickstart>%AXIS2_HOME%\bin\WSDL2Java -uri StockQuoteService.wsdl -p org.apache.axis2.StockQuoteService.wsdl -d adb -s
The root cause was the file didn't exist, and my CLASSPATH wasn't set.
Hope this helps someone else.

Related

Apache Airflow command not found with SSHOperator

I am trying to use the SSHOperator to SSH into a remote machine and run an external application through the command line. I have setup the SSH connection via the admin page.
This section of code is used to define the commands and the SSH connection to the external machine.
sshHook = SSHHook(ssh_conn_id='remote_comp')
command_1 ="""
cd /files/232-065/Rans
bash run.sh
"""
Where 'run.sh' runs the shell script:
#!/bin/sh
starccm+ -batch run_export.java Rans_Model.sim
Which simply runs the commercial software starccm+ with some options I have specified.
This section defines the task:
inlet_profile = SSHOperator(
task_id='inlet_profile',
ssh_hook=sshHook,
command=command_1
)
I have confirmed the SSH connection works by giving a simple 'ls' command and checking the output.
The error that I get is:
bash run.sh, error: run.sh: line 2: starccm+: command not found
The command in 'run.sh' works when I am logged into the machine (it does not require a GUI). This makes me think that there is a problem with the SSH session and it is not the same as the one that Apache Airflow logs into, but I am not sure how to solve this problem.
Does anyone have any experience with this?
There is no issue with SSH connection (at least from the error message). However, the issue is with starccm+ installation path.
Please check the installation path of starccm+ .
Check if the installation path is part of $PATH env variable
$ echo $PATH
If not, then install it in the standard locations like /bin or /usr/bin etc (provided they are included in $PATH variable), or export the installed director into PATH variable like this,
$ export PATH=$PATH:/<absolute_path>
It is not ideal but if you struggle with setting the path variable you can run starccm stating the full path like:
/directory/where/star/is/installed/starccm+ -batch run_export.java Rans_Model.sim

Fail to download file using SCP

I am trying to download a large number of files from a remote Ubuntu Server to my machine which is also running on Ubuntu. I am using SCP protocol as below:
for i in *; do $i sshpass -p 'Remote_Server_Passcode' scp root#<Remote_Server_IP>:'/opt/Data/' .; done
This is failing with an error message saying command not found
Any help pointing towards right direction will be highly helpful.
Thanks
If I understand correctly you just want to copy the whole /opt/Data directory, this can also be achieved like this:
scp -r root#<Remote_Server_IP>:/opt/Data/ .
-r means recursive
And as to what was going wrong the for i in *; do $i loops through all files in the current local directory and then tries to execute those, which is probably not what you wanted.

Find httpd.conf file location after it's been changed by -f flag

Httpd processes use a non-default configuration file if they are run with the -f flag.
For example
/home/myuser/apache/httpd-2.4.8/bin/httpd -f /confFiles/apache/2.4.8/apache.conf -k start
will use this configuration file: /confFiles/apache/2.4.8/apache.conf
I need to get this location and would rather not have to check for possible -f flags used to start httpd.
The answer here says to run /path/to/httpd -V and concatenate
-D SERVER_CONFIG_FILE="conf/httpd.conf"
with
-D HTTPD_ROOT="/etc/httpd"
to get the final path to the config file.
However, this path will not be the correct one if the -f flag is used to start the httpd process.
Is there a command that can get the config file that is actually being used by the process?
The answer you refer to mentions the paths httpd was compiled with, but as you say those can be manually changed with parameters.
The simple way to check is the command line, if process is called "httpd" (standard name), a simple ps will reveal the config file being used:
ps auxw | grep httpd
Or querying the server if server has mod_info loaded, in command line or with your favourite browser:
curl "http://yourserver.example.com/server-info?server" | grep -i "config file"
Note: mod_info should not be publicaly available for everyone to see.

JMeter unknown arg ?t

I'm trying to run JMeter in non-gui mode (from the command line).
I've seen in a number of places, including the official docs, that this following command will do what I want:
jmeter -n –t test.jmx -l testresults.jtl
However, I get an illegal argument exception for the "t" argument. See below for my console output:
Below is the output saved to jmeter.log:
2016/08/09 14:41:59 INFO - jmeter.util.JMeterUtils: Setting Locale to en_GB
2016/08/09 14:41:59 INFO - jmeter.JMeter: Loading user properties from: C:\apache-jmeter-3.0_src\apache-jmeter-3.0\bin\user.properties
2016/08/09 14:41:59 INFO - jmeter.JMeter: Loading system properties from: C:\apache-jmeter-3.0_src\apache-jmeter-3.0\bin\system.properties
2016/08/09 14:41:59 FATAL - jmeter.JMeter: An error occurred: java.lang.IllegalArgumentException: Unknown arg: –t
at org.apache.jmeter.JMeter.initializeProperties(JMeter.java:746)
at org.apache.jmeter.JMeter.start(JMeter.java:385)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.jmeter.NewDriver.main(NewDriver.java:259)
So the issue was how I was getting the command into the command line.
When I copied and pasted my command, it was copied from a webpage, into notepad, and then into the command line. I wrongly assumed notepad would encode the correct character.
Just a bit confusing as the -n worked but not -t. Silly error!
Place your script file "TwoMinuteTest.jmx" into your JMeter bin directory and then try this command:
jmeter -n –t TwoMinuteTest.jmx -l testresults.jtl
I just got the same error, and it turned out that instead of a regular hyphen (aka "minus sign"), the character was a en-dash, and they look similar enough for me not to notice.
Turns out that the Linux version of JMeter (or if it is Linux itself) is very picky, and only accepts the plain regular hyphen character. While the Windows version of JMeter handles both. I copy pasted from a command line example on a website, and I guess that person had run it on Windows and not tried it on Linux.
I think this was the same thing that happened to the original poster here. Posting this as an answer since it is still can happen, and no answer talked about the possibility that the wrong character was used.
You must keep your .jmx file in jmeter bin folder and you can change your log file location anywhere you wish.
jmeter -n –t TwoMinuteTest.jmx -l C:\users\desktop\Log.Txt -- Will create a text file as log.
jmeter -n –t TwoMinuteTest.jmx -l C:\users\desktop\Log.Csv -- Will create a Csv file as log.
jmeter -n –t TwoMinuteTest.jmx -l C:\users\desktop\Log.Xls -- Will create a Xls file as log.
If the log file is not there in the location, it will create a new file while running the test.
Open .bat file in notepad++ select encoding as Encode in UTF-8 from menu if your file is having any special character correct it using below format:
jmeter -n –t "testscript.jmx" -l "results_test.jtl"
Earlier my TimersTestPlan.jmx had a space , like this Timers TestPlan.jmx
When I removed the space it worked for me in windows.
jmeter -n -t C:\FREESOFT\JmterPlanLoc\TimersTestPlan.jmx -l C:\FREESOFT\JmterPlanLoc\Export\Clreport.csv
This Worked Perfectly:
jmeter -n -t "F:\WebsitePerformanceTest.jmx" -l "F:\TestResults.csv" -e -o "F:\Reports"
check-in your
file extension example space, double dots
Install JMeter plugin
Java JDK and JMeter version miss-match.
Instead of:
jmeter -n –t test.jmx -l testresults.jtl
You should use:
jmeter -n –t "test.jmx" -l "testresults.jtl"

Hive script not running in crontab with hadoop must be in the path error

After setting Hadoop Home path and Prefix path in .bashrc and /etc/profile also im getting the same error - Cannot find hadoop installation: $HADOOP_HOME or $HADOOP_PREFIX must be set or hadoop must be in the path
If i run the script from crontab im facing this error from hive> prompt its working fine
plz help with the regarding how to solve this
Set $HADOOP_HOME in $HIVE_HOME/conf/hive-env.sh
try loading user bash profile in the script, as below,
. ~/.bash_profile
bash is included in user bash_profile and it will have user specific configurations as well.
see the similar question Hbase commands not working in script executed via crontab