1 of 1 people found this helpful
you can try fully qualifying where javaw is within the batch file
The tricky part is always ensuring not only that it executes from the command line, but that it executes as the user that Remedy is running as
I tried what you mentioned, but it still doesn´t work. My batch file has now the following content:
start "C:\Program Files (x86)\Common Files\Oracle\Java\javapath\javaw.exe" "E:\Programm\BMC Software\ARSystem\dist\Test.jar"
So, you said that you can confirm that the batch file is executing....how are you verifying that....
First, I am traveling this week and am not close to my java notes or have time to google to confirm things. Hopefully, this is helpful. One thing I see is you are trying to use javaw.exe. I don't think you want to go this direction as this will try to render an interactive Java session which will likely not render for you since you are running from this from the AR server. Therefore, you will need to use java.exe to run your jar file. The next thing is you likely need to add your Java bin directory to your Path environmental variable and possibly add a Java_Home variable to your bat script. Your bat script has to have everything compartmentalized to run your jar file. The reason you are able to run your bat file from your server/desktop is that all your environmental variables are setup. When you have Remedy run your bat file, you are at the mercy of the AR server's java settings. This is why you want to insure all path locations are fully specified by your bat file. If you are using a Linux AR server, this is a whole new discussion as you will need to work with shell scripting.
So, your bat script would look something like this.
set JAVA_HOME="C:\Program FIles (X86)\java\jre"
%JAVA_HOME%\bin\java.exe -jar "e:\mystuff\test.jar"
I added the following line in the batch file to verify if it is executed:
This worked. When the filter is triggered the batch file creates an empty file.
I did what you wrote. But it still doesn´t work. If I run the batch file manually everything is working.
Does it work when you omit the "start" command in the batch file?
Edit: Have you tried redirecting the output of the java command to a textfile to see wheter there is an error message?
1) Still the same. It works when I run it manually, but it doesn't work when it runs through the filter.
2) I have tried, but the output is only generated when executed manually. And their is no error message.
Echo something in a text file before you start the java programm and after that echo the ERRORLEVEL to the same textfile.
Also try using 8.3 names for the java path and the .jar path.
I tried it with 8.3 names. Still the same issue.
I´m not quiet sure which errorlevel you mean. Do you mean the one from the java programm?
Its an environment variable and should contain the exit code, see eg. How do I get the application exit code from a Windows command line? - Stack Overflow
Edit: Have you tried using java (instead of javaws) aswell? Do you get an result/output when doing a java -version call?
The exit code is 0. That means everything's fine, right?
Yes, I tried. And yes, I get a result.
Yes then the command gets executed.
Let's get this straight:
When I start the bat file manually, I get the exit code '0'. But if I address the filter, it doesn't work.