• Post Reply Bookmark Topic Watch Topic
  • New Topic

Running Different thread application

Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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

Ben Souther
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:

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.
Bear Bibeault
Author and ninkuma
Posts: 65664
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.

Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!