Operating System - Linux
1828456 Members
3562 Online
109978 Solutions
New Discussion

Re: java hangs while running unix native executable..pls help

 
aneesha
Occasional Contributor

java hangs while running unix native executable..pls help


Gents,
I am new to java ..pls help me to sort out the issue..

My java program hangs while i am trying to call a native unix 'C' executable..

Steps i have done as described below..

1) I have called getRuntime() method to get process object
2)then used 'exec' method to call the executable
3)then i used waitFor method to wait the thread up to completion

the executable i am trying to execute is file processing system(a unix c executable with a shared library)..when input file to that executable is large the java program that calls the executable hangs...no exception coming...

Pls help me

Cheers,
Aneesh A







4 REPLIES 4
Peter Godron
Honored Contributor

Re: java hangs while running unix native executable..pls help

Aneesh,
solve the problem by step-by-step:
Check your C program standalone with a small file
Check your C program standalone with a large file
Check your exec with a dummy small C program
Check the return of your exec call

Then please update this thread!
aneesha
Occasional Contributor

Re: java hangs while running unix native executable..pls help

Dear peter,

Thanks for the replay..

I have tested the things as u told

1)exe as stand alone working fine for big and small files

2)When i tried to execute executable from java for small input files it works fine

problem occurs when while i am calling from java only..it hangs after processing almost 700 lines of file..

my java version installed in hpux is
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2.02-040225-17:20)
Java HotSpot(TM) Server VM (build 1.4.2 1.4.2.02-040225-19:18-PA_RISC2.0 PA2.0 (aCC_AP), mixed mode)

Hp unix version is 11.11


cheers,
Aneesh A
Peter Godron
Honored Contributor

Re: java hangs while running unix native executable..pls help

Hi,
if the code is being executed ok for 700 lines, in my mind, there are two possible problems:
1. Data problem (unlikely, as the standalone works)
2. Resource issues

So have you checked all your log files.

Please also see:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
and
search for "JAGaf70925" in
http://www.hp.com/products1/unix/java/java2/sdkrte14/infolibrary/sdk_rnotes_1.4.2.10.html
aneesha
Occasional Contributor

Re: java hangs while running unix native executable..pls help

Dear peter,

Thanks man

will analyse as per ur links and i will update the thread

Cheers ,
Aneesh A