tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Calling a CGI script from Servlet
Date Sun, 01 Aug 2010 02:32:40 GMT

 I am new to configuring tomcat (I have run it for a few years as it is packaged with Netbeans)
and new to linux and I am stuck on a particular problem.

I have a project in which I am trying to call a python code from a servlet.  I am using tomcat6
on Ubuntu 10.04.  I have used both Runtime.exec() as well as ProcessBuilder to make the call.
 I have completely copied the code from the JavaWorld article When Runtime.exec() won't (
 I have granted full permissions on all the files (read, write and execute).  When I get an
exit value on the execution of the script I get a value of 0 (zero).  I am able to execute
the script from a simple java program in this environment (tomcat and Ubuntu) using the same
syntax but not in the servlet.  I am able to execute the script from the servlet in Ubuntu
10.04 from glassfish and I am able to execute the script from the servlet in tomcat6 in a
windows environment.  However, when I try to execute the script from the servlet in tomcat6
and Ubuntu 10.04 - nothing - even though I get the exit value of zero, I get the zero value
returned but no action from the script (all it does is open the default browser).

I have made the following changes in my tomcat installation:

Uncommented the following in the web.xml:



My tomcat-users:


  <role rolename="tomcat"/>
  <role rolename="role1"/>  
  <role rolename="manager"/> 
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
  <user username="tomcat" password="tomcat" roles="manager"/>  


Change made in context.xml:
<Context reloadable="true" privileged="true">

Added to system.policy:
// Grant WebApps All Permission
grant codeBase "file:/var/lib/tomcat6/webapps/-" {

Added to catalina.policy:
grant codeBase "file:${catalina.home}/webapps/GSMFilter/-"  { "/var/libs/tomcat6/webapps/GSMFilter/WEB-INF/storage/<<ALL
FILES>>", "read,write,execute,delete";

grant codeBase "file:${catalina.home}/webapps/GSMFilter/-"{

grant codeBase "file:${catalina.home}/webapps/FilterSelection/-"{
         permission java.lang.RuntimePermission "/home/troy/NetBeansProjects/GSMFilter/web/WEB-INF/storage/<<ALL
FILES>>", "read,write,execute,delete";

At this point I am at a loss.  Any help would be greatly appreciated.

Troy Parrish

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message