| Author |
runtime.exec()
|
gireesh sivan
Greenhorn
Joined: Dec 15, 2006
Posts: 4
|
|
i am facing a problem in linux. When i try to excecute a shell script using runtime.exec(),the script not exce cutting properly.The process is not completing.i am using jboss as application server.so the call for shell script is from jboss server.so i think jboss server is the problem here because When i try to excecute script dirctly from linux,it working correctly .Also i try it using stand alone java class.Its working fine. please help me to find a solution
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12921
|
|
... the script not exce cutting properly.The process is not completing. Can you please explain exactly what you mean by this? What is happening? Does the script get called at all or not? Do you get an error message? If yes, then what is the error message?
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
i am using jboss as application server.so the call for shell script is from jboss server.so i think jboss server is the problem here
Do you mean you are calling Runtime.exec() from an EJB?
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
gireesh sivan
Greenhorn
Joined: Dec 15, 2006
Posts: 4
|
|
when i try to call runtime.exec(),the process will start and is not completing.i can see the process id.when i shutdown my jboss server,the process wiil complete. eg: i am calling an shell script called uafimail.sh the process will start i can see the process id of uafimail.sh. when i shutdown my jboss server the process will complete. Its only happends when the call is from jboss server. i can excecute it from a standalone java program,also from linux prompt. but the problem when its in jboss
|
 |
gireesh sivan
Greenhorn
Joined: Dec 15, 2006
Posts: 4
|
|
|
no the call is not from ejb
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12268
|
|
The process is not completing.
That sure sounds like the typical problem you get if you do not provide for consuming the error output stream and standard output stream from the Process. Read the JavaDocs for java.lang.Process - where you will find a discussion of the problem. Bill
|
Java Resources at www.wbrogden.com
|
 |
gireesh sivan
Greenhorn
Joined: Dec 15, 2006
Posts: 4
|
|
i also provide error output stream and output stream. But the problem still remaining
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12268
|
|
i also provide error output stream and output stream.
How are you reading those streams? Each stream must have a reader in its own thread, you can't just read one and then the other in the same thread. Bill
|
 |
 |
|
|
subject: runtime.exec()
|
|
|