java and tomcat problem

E

enantiomer

I have a java application that utilizes a plug-in architecture that I
am trying to integrate into tomcat. It has a ClassLoader class that is
used to discover and load the approprate class in the plugin folder
that implements a common interface. Although it works perfectly when
running from command line, when putting into tomcat, it is never able
to find the class when calling the loadClass method that belongs to the
ClassLoader class. It always gives a ClassNotFoundException. When i
simplify the problem, i try to identify a very simple class in a tester
class that extends ClassLoader... that also doesn't work. It is as
though tomcat doesn't know about the packages being used. The only
thing is that i first put the .jar file for the application in the
application lib directory. When that failed, i tried putting it in
every possible lib directory. Nothing works. Below is what the test
class looks like... Any advise would be helpful. Thanks,

package com.dosCommand;

public class LoadTest extends ClassLoader{

public String findClass(){
String returnValue = "original value...";
try{
Class myClass =
loadClass("com.dosCommand.osCommand");
returnValue = myClass.toString();

}
catch(ClassNotFoundException e){
returnValue = e.toString();
}
return(returnValue);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,096
Latest member
ThurmanCre

Latest Threads

Top