Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Runtime.exec() problem (jdk1.3.1+rh7, jdk1.4.2+rh9)

Reply
Thread Tools

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

 
 
Michal M
Guest
Posts: n/a
 
      07-28-2005
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
 
Reply With Quote
 
 
 
 
Gordon Beaton
Guest
Posts: n/a
 
      07-28-2005
On Thu, 28 Jul 2005 10:28:43 +0200, Michal M wrote:
> - - 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

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
 
Reply With Quote
 
 
 
 
Michal M
Guest
Posts: n/a
 
      08-01-2005
Gordon Beaton wrote:
> 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!
 
Reply With Quote
 
Sathish Kumar Raju
Guest
Posts: n/a
 
      08-01-2005
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


Michal M wrote:
> Gordon Beaton wrote:
>
>> 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!


 
Reply With Quote
 
Pete Barrett
Guest
Posts: n/a
 
      08-01-2005
On Mon, 01 Aug 2005 12:03:52 +0530, Sathish Kumar Raju
<(E-Mail Removed)> wrote:

>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
 
Reply With Quote
 
Dag Sunde
Guest
Posts: n/a
 
      08-02-2005
"Pete Barrett" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Mon, 01 Aug 2005 12:03:52 +0530, Sathish Kumar Raju
> <(E-Mail Removed)> wrote:
>
>>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.
>


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

--
Dag.


 
Reply With Quote
 
Sathish Kumar Raju
Guest
Posts: n/a
 
      08-02-2005
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

Dag Sunde wrote:

> "Pete Barrett" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>>On Mon, 01 Aug 2005 12:03:52 +0530, Sathish Kumar Raju
>><(E-Mail Removed)> wrote:
>>
>>
>>>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.
>>

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


 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      08-02-2005
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'..

> Dag Sunde wrote:
>
>> "Pete Barrett" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>
>>>On Mon, 01 Aug 2005 12:03:52 +0530, Sathish Kumar Raju
>>><(E-Mail Removed)> wrote:
>>>
>>>>..Iam writing an java applet...

...
>>>>java.security.AccessControlException: access denied

...
>>>Applets aren't allowed to connect to a database except on the host
>>>they were downloaded from.

...
>> Unless the applet is _signed_ ..


> 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..
<http://www.physci.org/pc/property.jsp?prop=java.version+java.vendor>
MS? 1.1.4?

> 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

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
Featuring Gratuitous Alien Nudity
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem problem problem :( Need Help Mike ASP General 2 05-11-2004 08:36 AM



Advertisments