jQuery in Action, 3rd edition
The moose likes Tomcat and the fly likes Running Different thread  application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Running Different thread  application" Watch "Running Different thread  application" New topic

Running Different thread application


Joined: Aug 13, 2002
Posts: 15

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


Thanks<br />chets
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

I would start by reading up on Runtime.exec:

And ServletContextListener:

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.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63868


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.


[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link: http://aspose.com/file-tools
subject: Running Different thread application
It's not a secret anymore!