• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

issue when calling shell script from java

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is "B" getting executed?
 
Murthy Manchala
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic