can not run a OS command using ps.util.system:executeOSCommand

Forum,

I am trying to run the command

java test AAA.wsdl BBB.xsd CCC.rtf

from the service ps.util.system:executeOSCommand and could not get it working.

When i run the bat file directly it works fine (generates an RTF) but when i invoke it from WM service ps.util.system:executeOSCommand then it throws an error

java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: test. Program will exit.
Exception in thread “main”

I also tried to execute the bat file directly using this PSUtilities service but still it is not working and throwing the same error as above.

Inputs:
command: C:\webMethods7\IntegrationServer\Documentation\Source\testRun\xxx.bat
workingDirectory:
C:\webMethods7\IntegrationServer\Documentation\Source\testRun

or

command: cmd.exe /c javac -d classes src/gendoc/test.java
workingDirectory: C:\webMethods7\IntegrationServer\Documentation\Source\testRun

Please help!

Thanks,
Akshith

This appears to be classpath issue. Define the necessary classpath in the batch file. The environment variables that you rely on with the command line will not be available to the spawned fork.

Rob, you are the man! I was setting the classpath in a different bat file and was executing the test bat file before the classpath batfile.

I have clubbed them together and made them to one file now.

Cheers,
Akshith