File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes load a class in already running tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "load a class in already running tomcat" Watch "load a class in already running tomcat" New topic

load a class in already running tomcat

Pradeep Negi

Joined: Aug 12, 2005
Posts: 2
I need to load a class which outside on tomcat environment (tomcat is already running).I have a class into different location which I have to load when my application is already running into tomcat. Can someone help me it's possible to load a class into already started tomcat and how?
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

You could write your own custom classloader.

Maybe if you describe, in detail, what you're trying to do, we can suggest an easier alternative.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Pradeep Negi

Joined: Aug 12, 2005
Posts: 2
Thanks for replying,

My application runs in tomcat, once my application start I need to use classes which in a jar file and out of tomcat environment(mean not in a classpath ).Can you help me regarding this.

Do I need to change in server.xml (for security coz I will try to access load jar form out of tomcat environment)? If yes what will be these.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13028
You may find the "class-loader-howto.html" file that comes in a standard Tomcat installation under tomcat-docs to be helpful here.
Note that Tomcat pays no attention to the environment classpath.
The initialization params for your servlet can be used to point to the location of your class files so you should not have to modify server.xml but you will have to set security properties.
I agree. Here's the link:
subject: load a class in already running tomcat
jQuery in Action, 3rd edition