This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Calling a JAVA Class in a Deployed Web Application from shell script  RSS feed

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,

I need to call a class packaged in my web application from a shell script to pass an argument to the class. To be more specific, the packaged web archive (WAR) will be deployed in an application server and after its deployed i need to call that particular class present in the WAR file on a continuous basis and pass an argument.

Example: Target class file's directory location in the WAR file - WEB-INF/Classes/com/sample/batch/invokeBatch.java

and i need to call this java file from a shell script from my unix home directory and pass it an argument like

./calljob.sh $java_argument

Can anyone suggest how to proceed further on this. Where can i start from to work on the solution?
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it's deployed locally, this is easy--just use the appropriate classpath.

If it's not, then it's not: send an HTTP request instead--much, much easier.
 
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This was also asked and answered in this duplicate topic. Please do not post the same question to multiple forums: CarefullyChooseOneForum
 
murthy bala
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David and Ulf. i will work on your suggestion.

Ulf, I Will make sure that topics are not posted in multiple forums going forward.
 
murthy bala
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf, Your solution Worked Perfectly.
 
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!