-1

I am trying to execute a script located in machine B from machine A. PS - The script is trying to restart ATG instance on a JBOSS server. I tried following commands -

ssh user@hostname /path/to/script/remotescript.sh arg1 arg2
ssh user@hostname "bash -c '/path/to/script/remotescript.sh arg1 arg2'"
ssh user@hostname exec /path/to/script/remotescript.sh arg1 arg2

The script works locally, but when executed from a remote location the script throws the following exception -

java.lang.ClassNotFoundException: No ClassLoaders found for: oracle.jdbc.xa.OracleXAException

Thanks for your help.

3 Answers3

1

Finally, the mystery is resolved. This worked -

SSH -q USER@hostname "source /export/home/jboss/.bash_profile; /bin/bash /path/to/script/remotescript.sh arg1 arg2"

Source command with loading bash profile did the trick.

0

If you can show the code of remotescript then it would be easier for solution.

Try using ssh -t option once.

Sriharsha Kalluru
  • 1,743
  • 3
  • 21
  • 27
0

If you ssh to the remote machine, with

ssh user@hostname

and then run the script

/path/to/script/remotescript.sh arg1 arg2

at the resultant remote prompt, do you get the same error?

It looks like you have not provided the right Oracle JDBC drivers in JBOSS. Sort that error out first, and then see if you can run it via ssh with a single command

Vihung
  • 12,947
  • 16
  • 64
  • 90