aspose file tools*
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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "load a class in already running tomcat" Watch "load a class in already running tomcat" New topic
Author

load a class in already running tomcat

Pradeep Negi
Greenhorn

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
Sheriff

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
Greenhorn

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
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
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.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: load a class in already running tomcat