Thanks Enrico,

However I seem to have inadvertently solved it. I was updating to the latest release of jre and recompiled the servlet with 1.5.0 and now it works.
Previously I was using 1.3.1.
So there we go.

Cheers
Mark

Enrico Giurin wrote:
Hello,
I guess yours is a problem of security manager of tomcat.
I think you have to modify some entries of the catalina.policy file.
http://tomcat.apache.org/tomcat-5.0-doc/security-manager-howto.html


Enrico.

----- Original Message ----- From: "Mark HB" <[EMAIL PROTECTED]>
To: <users@tomcat.apache.org>
Sent: Tuesday, September 12, 2006 10:16 AM
Subject: Executing binary from Servlet


Hi,

I am looking for some help on a problem I have encountered with
executing a binary from a servlet using Runtime.getRuntime().exec()
The code that I have is simply executing a binary called "cimmsim":

File theDir = new File(curdir+"WORK/"+rand);
java.lang.String cmdline = theDir+"/cimmsim -f config";
try {
Process p = Runtime.getRuntime().exec(cmdline, null, theDir);
}
catch (IOException e)
{ e.printStackTrace(); }

The error that is produced is:
java.io.IOException: java.io.IOException:
/srv/www/tomcat5/base/webapps/simulator/WORK/yqzatmopa343/cimmsim:
cannot execute
       at java.lang.UNIXProcess.<init>(UNIXProcess.java:143)
       at java.lang.Runtime.execInternal(Native Method)
       at java.lang.Runtime.exec(Runtime.java:566)
       at java.lang.Runtime.exec(Runtime.java:428)
       at RunSimulation.run(CimmSimServlet.java:655)

A uname -a on the system gives:
Linux apppx1 2.6.16.13-4-xen #1 SMP Wed May 3 04:53:23 UTC 2006 x86_64
x86_64 x86_64 GNU/Linux
SUSE LINUX 10.1

I have ensured that the permissions are set to at least 755 and am now
at a bit of a loss.
Any ideas?

Cheers
Mark



--
---------------------------------------------------------------------------
Mark Halling-Brown                      | Tel: +44-20-7631-6839
Research Associate                      |
Room 359                                | Fax: +44-20-7631-6803
School of Crystallography               |
Birkbeck College                        | Email:
Malet Street                            | [EMAIL PROTECTED]
London WC1E 7HX                         | [EMAIL PROTECTED]
UK                                      |
              http://people.cryst.bbk.ac.uk/~ghall04
---------------------------------------------------------------------------



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.2/443 - Release Date: 11/09/2006




___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
---------------------------------------------------------------------------
Mark Halling-Brown                      | Tel: +44-20-7631-6839
Research Associate                      |
Room 359                                | Fax: +44-20-7631-6803
School of Crystallography               |
Birkbeck College                        | Email:
Malet Street                            | [EMAIL PROTECTED]
London WC1E 7HX                         | [EMAIL PROTECTED]
UK                                      |
http://people.cryst.bbk.ac.uk/~ghall04 ---------------------------------------------------------------------------


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to