« Back to Technical Questions

Tomcat invoking shell commands problem

Combination View Flat View Tree View
Hello

I'm trying to write a tomcat web application which executes shell commands, like "ls", or something.
But when the "process" comand invokes any shell command, the command is not executed and no exception is thrown.
 
This is the Tomcat log:

53325 [http-8080-Processor25] INFO (Command to be executed)  - Cmd: ls -la /bin/
53363 [http-8080-Processor25] INFO (Command input stream)  - None
53364 [http-8080-Processor25] INFO (Command error stream)  - None

For testing purposes, I wrote a pure java application, calling the same shell commands, and it works OK. All commands are correctly executed.

I'm using sun java 1.5.0.15 and Tomcat bundled with AXP.

Any ideas?

Thanks in advance

How you created the dependency for Java? Did you package it along with your application and then included Tomcat in your package as dependency?

Yes, I packaged it and included java as a dependency.
I've been trying diferent memory sizes, and I think this was my problem.
I increased --disk-limit parameter from 400M to 800M, and -memory-limit parameter from 100M to 256M and things started working...