Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

issue when calling shell script from java

 
Murthy Manchala
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From web application we are executing the shell script. shell script will run a stand alone java program.

this program calls another standalone java B to get the connection object.

when we execute shell script on unix its working fine, but when i am firing it from web application its firing the script but at the point of calling B to get the connection object not able to get the connection.

Thanks
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11887
203
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is "B" getting executed?
 
Murthy Manchala
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
first program started executing. then it will call B to get connection object and execute the stored procedures. but its not able to call B. and its not giving any exceptions.

I ran the same sript on unix its working fine.

Thanks
Murthy
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11887
203
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess is that when you run it from within the web application then the path is not set correctly, and so it is not finding java. Do you know how to check your path as an end user and from within the web application?
 
Dawn Charangat
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Murthy.. a couple of questions.

Where are you running your java program from ? The Unix machine itself or from a remote windows machine ?
Does the library you use to make the connection (if running from windows machine) support proper SCP/SSH functionality ? any logs ?
Can you try giving the absolute path of the shell script in your Java file, rather than relative path, and try executing once again ?
 
Murthy Manchala
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrew,

I don,t know how to check the path in web app. can you please give me sample code.

Thanks
 
Murthy Manchala
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dawn,

app server is on Unix box. I am calling the script from from web application. from windows machine when i click the button it will run the shell script. The shell script executes A java programm. A calls B programm to get connection object. I have the class path for all jars in the shell scripts itself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic