Runtime.exec() problem (jdk1.3.1+rh7, jdk1.4.2+rh9)

M

Michal M

Hello,
I've got a servlet which runs linux binary file and creates java.lang.Process,
takes its output (getInputStream()) and writes it on .html page via BufferedReader.
Old version of linux executable works fine, but I recently got a new version of
this program which must be deployed and here's problem:
- new executable works fine when running from linux command line (gives the same
output - about ten lines - the same text, the same md5sum of outputted file as
old one)
- getting error stream (from servlet) also works fine
- but rewriting process.getInputStream() on html page (as previous) doesn't
- - under java 1.4.2_07 (rh9) servlet some times works fine but sometimes
produces no output - exit value (waitFor()) is 129
- - under java 1.3.1_01 (rh7) servlet doesn't work - everytime exit value is
139! and there is produced no output on page

What can I do? Where the problem cames from?
Please note, I probaly won't be able to gather source code of mentioned linux
application (c/c++).

Regards,
Michal M
 
G

Gordon Beaton

- - under java 1.4.2_07 (rh9) servlet some times works fine but
sometimes produces no output - exit value (waitFor()) is 129

The process was killed with signal 1 (hangup), it explicitly returned
129.
- - under java 1.3.1_01 (rh7) servlet doesn't work - everytime exit
value is 139! and there is produced no output on page

The process was killed with signal 11 (segmentation fault) or it
explicitly returned 139.
What can I do? Where the problem cames from?

The problems come from the child process. If you can't get the source,
complain to the author. Or use the previous version that worked.

/gordon
 
M

Michal M

Gordon said:
The problems come from the child process. If you can't get the source,
complain to the author. Or use the previous version that worked.

/gordon

Thanks for your help!
 
S

Sathish Kumar Raju

Hi All,
Iam new to this group and i know only basic fundas of Java. Iam writing
an java applet which connects to the database and retrieves data.
It runs when iam running from jdeveloper ..but when run thru a browser
it is giving the following exception.

java.security.AccessControlException: access denied
(java.net.SocketPermission ab123x1.us.xyz.com resolve)

And also Iam using File IO...i hope it will also won't work
since there is security issues..and the file is in the CLIENT side..

Please help me in this issue.

thnx,
Sathish
 
P

Pete Barrett

Hi All,
Iam new to this group and i know only basic fundas of Java. Iam writing
an java applet which connects to the database and retrieves data.
It runs when iam running from jdeveloper ..but when run thru a browser
it is giving the following exception.

java.security.AccessControlException: access denied
(java.net.SocketPermission ab123x1.us.xyz.com resolve)

And also Iam using File IO...i hope it will also won't work
since there is security issues..and the file is in the CLIENT side..

Please help me in this issue.
Applets aren't allowed to connect to a database except on the host
they were downloaded from. You either need your databse on the same
host as the webserver which serves the pages your applet is on, or you
need a database proxy on that machine which will allow the applet to
connect to it but to pass the actual requests through to the machine
the database is actually running on.

All this is in the Java documentation, if you can find it.

Pete Barrett
 
D

Dag Sunde

Pete Barrett said:
Applets aren't allowed to connect to a database except on the host
they were downloaded from. You either need your databse on the same
host as the webserver which serves the pages your applet is on, or you
need a database proxy on that machine which will allow the applet to
connect to it but to pass the actual requests through to the machine
the database is actually running on.

Unless the applet is _signed_ with a code signing certificate, and the
user have explicitly accepted that he/she trust your applet.
 
S

Sathish Kumar Raju

Hi Dag,
Thanks for the info !!
By the way ..I have created a jar file containing the applet class
and also signed it. But in the html file, though i mentioned
code="a.class" archive="a.jar", it says class not found when
viewed in IE...

Also , i have an doubt whether it will ask the user to accept
the digital certificate / not..and if the user accepts the
certificate ,then will it be possible for jdbc and io ??

Please i need assistance in this...or i need to convert the
entire applet to servlet logic ( but bit time taking)

thnx,
Sathish
 
A

Andrew Thompson

On Tue, 02 Aug 2005 12:53:00 +0530, Sathish Kumar Raju wrote:


Please refrain from top-posting, some of us find it
most confusing, see further comments (below) 'in-line'..
By the way ..I have created a jar file containing the applet class
and also signed it. But in the html file, though i mentioned
code="a.class" archive="a.jar", it says class not found when
viewed in IE...

Where is your HTML, jar file..
Upload it to a web page so we can seeit, post the URL.

But your answer might be here.
<http://www.physci.org/codes/javafaq.jsp#appletie>

Read the entire FAQ - lots of mention of applets.

A quick test is here..
Also , i have an doubt whether it will ask the user to accept
the digital certificate

It will. If the user refuses, your applet will still
load, but does not get the extended privileges.
../ not..and if the user accepts the
certificate ,then will it be possible for jdbc and io ??

Yes. (If the user accepts it)

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top