File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call a stand alone class from WAS???

 
Gaurav Jain
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a standalone class sitting outside WAS.
Is there any way (WAS API) i can start that stand alone class from WAS...that is as soon as my WAS starts that class also starts.
I dont use start that class using the servlet.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no idea what you mean by a "standalone class". Do you mean a class that has a main() method you need to start?
Kyle
 
Gaurav Jain
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes.
A class with a main method.
 
Scott Duncan
Ranch Hand
Posts: 364
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kick off a thread in a servlet's init method that uses the RunTime object. Bad thing is that the thread will kick off when the app is restarted.
 
Gaurav Jain
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont want to use the servlet method.
The update is that i created a java class outside WAS and packaged it in a jar file.
Mentioned the path of the jar file in java VM arguments of WAS.
When i start the server that standalone java class gets executed but then the server stops automatically without giving any error.
What is the problem??
 
venki janapati
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use websphere startup class. if you mention the class with required arguments in the configuration,when the server starts up ,it starts the stand alone program as well
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic