It's all about the answers!

Ask a question

Command line adaptor cant find ant


Phil Jones (16) | asked Jan 26 '11, 12:50 p.m.
I have set up RQM so that it talks to my test box and I am trying to run an ant script. If I run the command manually on the test box then it works correctly but if it is run through RQM then I get the message:

ERROR com.ibm.rqm.adapter.commandline - Cannot run program ""ant"": CreateProcess error=2, The system cannot find the file specified
java.io.IOException: Cannot run program ""ant"": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at java.lang.Runtime.exec(Runtime.java:593)
at java.lang.Runtime.exec(Runtime.java:431)
at java.lang.Runtime.exec(Runtime.java:328)
at com.ibm.rqm.adapter.commandline.CommandLineAdapter.runTest(CommandLineAdapter.java:141)
at com.ibm.rqm.adapter.commandline.QMCommandLineProcessor.processExecution(QMCommandLineProcessor.java:260)
at com.ibm.rqm.adapter.library.data.AbstractProcessor.processTask(AbstractProcessor.java:85)
at com.ibm.rqm.adapter.library.data.AbstractProcessor.processTasks(AbstractProcessor.java:67)
at com.ibm.rqm.adapter.library.data.RQMAdapter.runLoop(RQMAdapter.java:169)
at com.ibm.rqm.adapter.library.data.RQMAdapter$1.run(RQMAdapter.java:75)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
at java.lang.ProcessImpl.start(ProcessImpl.java:30)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
... 10 more


Does RQM have its own environment variables that I need to set up so that it can see ant?

7 answers



permanent link
Kurtis Martin (1.4k11) | answered Jan 26 '11, 2:05 p.m.
JAZZ DEVELOPER
The command-line adapter should inherit what ever environment variables are available in the shell from which you started the adapter. If the adapter is running on Linux, then there probably some other configurations that could impact how child processes inherit their environment variables. Try specifying the full path to ant when defining the script in RQM UI. For that matter when editing the script in RQM, select the option that says use resource local to the test machine and use the select adapter button, to specify the directory containing ant. Another option would be to add the directory containing ant to the System PATH environment variable in which case all processes should see it.

permanent link
Phil Jones (16) | answered Jan 27 '11, 9:51 a.m.
The command-line adapter should inherit what ever environment variables are available in the shell from which you started the adapter. If the adapter is running on Linux, then there probably some other configurations that could impact how child processes inherit their environment variables. Try specifying the full path to ant when defining the script in RQM UI. For that matter when editing the script in RQM, select the option that says use resource local to the test machine and use the select adapter button, to specify the directory containing ant. Another option would be to add the directory containing ant to the System PATH environment variable in which case all processes should see it.


Thanks for the reply. The ant directory was already included in the Path environment variable and I have now done everything that you suggest but I still have the same issue.

I have set the script to use test resources that are local to the machine and when I select the adaptor I have given it the path for ant (in my case it is C:\Ant\bin) then selected the ant file from that directory.

I am not sure what I then need to put in the command field of the test script. I have tried just ant and I still get the message that the system cannot find the file specified. I have also tried the full path of C:\Ant\bin\ant but then I get an error saying Cannot run program ""C:\Ant\bin\ant"": CreateProcess error=193, %1 is not a valid Win32 application.

permanent link
Kurtis Martin (1.4k11) | answered Jan 27 '11, 12:14 p.m.
JAZZ DEVELOPER
Try again, but specify the full path as C:\Ant\bin\ant.bat. C:\Ant\bin\ant is a file, but it's a linux shell script hence the "not a valid Win32 application" message. Also, use the arguments field in the RQM script editor just below the command to specify any arguments you want to pass to ant.bat, such as '-f' for the build.xml path.

permanent link
Phil Jones (16) | answered Jan 27 '11, 12:25 p.m.
Try again, but specify the full path as C:\Ant\bin\ant.bat. C:\Ant\bin\ant is a file, but it's a linux shell script hence the "not a valid Win32 application" message. Also, use the arguments field in the RQM script editor just below the command to specify any arguments you want to pass to ant.bat, such as '-f' for the build.xml path.


I have made the changes you suggest and made some progress. There are no errors listed in the CommandLineAdaptor.log which is good. However there is nothing else in there either and the ant script still isnt doing what it should so I still don't think it is being run properly.

permanent link
Kurtis Martin (1.4k11) | answered Jan 27 '11, 12:35 p.m.
JAZZ DEVELOPER
hmm. what you should see is near the bottom in the detail result section, there should be a link to the standard out and standard error from the command you ran. If the command you ran didn't print anything to stdout or stderr, then you wouldn't see these links. However I would be surprised if ant doesn't print something to one of those. To do another quick sanity check just to make sure its nothing about ant, create another Command-line script and specify command as "ping" and arguments as "localhost", omitting the quotes. Run that and see if the result details section has a link to stdout. If not, then potentially there's a bug in the version of RQM you are using.

permanent link
Phil Jones (16) | answered Jan 27 '11, 12:49 p.m.
hmm. what you should see is near the bottom in the detail result section, there should be a link to the standard out and standard error from the command you ran. If the command you ran didn't print anything to stdout or stderr, then you wouldn't see these links. However I would be surprised if ant doesn't print something to one of those. To do another quick sanity check just to make sure its nothing about ant, create another Command-line script and specify command as "ping" and arguments as "localhost", omitting the quotes. Run that and see if the result details section has a link to stdout. If not, then potentially there's a bug in the version of RQM you are using.


After running the test script, if I hit the button to close and show results then the tab will close but I dont get a new one opening with the results. The results arent listed in the table to view test results either.

permanent link
Kurtis Martin (1.4k11) | answered Jan 27 '11, 2:19 p.m.
JAZZ DEVELOPER
Sounds like the task completed, but for some reason the command-line adapter isn't able to post it's results back to RQM. I haven't seen that issue before. Did you try the ping localhost script I mentioned? If ping worked and ant didn't, then maybe there's something odd about the stdout/stderr file that's causing this issue.

The one thing that comes to mind is Client Access License and permissions. Typically you would assign the user that you configured the adapter to run as a "Connector" license. And if you have made changes to the roles in your project area, there are several permissions the adapter user need. If this is a permissions issue that's preventing the result from being created, then you should see a message in rqm.log at the same time the script completes.

What version of RQM are you using? You may consider moving to the latest fix pack.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.