• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Running Different thread application

 
chetan
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

WE are using tomcat4.31.1 in which your main application is running on UNIX server.Now some of the thread based application we running separately using command line which is independent of tomcat server. Now i want to run that thread based application when the tomcat server starts i.e onload.

Please can anybody tell me how to make run different thread based application using tomcat server onload event.


Thanks in advance

Chetan
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would start by reading up on Runtime.exec:
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runtime.html

And ServletContextListener:
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContextListener.html

If the application you need to run is written in Java and you have access to the API (other than the already mentioned command line access) you might want to call it in process right from your webapp.

The context listener won't really run it when Tomcat starts up.
It will run it when the application it is housed in starts up, which may or may not suite your needs.
Another thought is to call it from the Tomcat wrapper scripts.

Without knowing more about this application, it is hard to say which is the best approach from here.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"chetan",

You have been warned on at least two previous occasions to change your display name to conform to JavaRanch standards.

This is not optional. Accounts with invalid display names are closed.

Take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post. You will receive no further warnings.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

bear
Bartender
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic