Jose,

I have a similar servlet which initializes a singleton class to load the
Tomcat resources for AXIS web service.  The servlet is loaded at startup.
This singleton class uses classes from a jar file located in WEB-INF/lib. MY
servlet and singleton and other classes are in WEB-INF/classes.  

In production environment, servlet and all other classes are in jar under
WEB-INF/lib and these classes use other classes in another jar in
WEB-INF/lib.  It works fine.

Probably having two classes with same name is the problem, but how is that
possible to have two classes with same name in the same package?  If they
are in two different packages, you need to refer that class with complete
package structure, eg : package.className = new package.className();


-Sabitha



Jose Maria Ramirez Martinez a écrit :

>Hi, everybody
>
>I have the next problem:
>A servlet calls a non-servlet class, and this non-servlet class imports
classes from a jar file, 
>but the classloader does not find the class from the jar file
>(so when I call the servlet from an internet browser, I get a
NoClassDefFoundException)
>
>But if a servlet class imports the same classes from the jar, the class
loader does find them...
>I've tried some ways to solve this problem, like:
>   a) unpacking the classes from the jar (this works, but I had the problem
that 2 different jars contained 
>a file with the same name stored in the same directory, so one would
replace the other, and the class fails)
>   b) I thought it would be a security problem so I ran tomcat with a
SecurityManager, but it didn't solve the 
>problem..
>
>does somebody has any idea why this is happening???
>can somebody help me to solve this... thanks in advance
>
>Jose Maria
>
>
>___________________________________________________________
>$0 Web Hosting with up to 200MB web space, 1000 MB Transfer
>10 Personalized POP and Web E-mail Accounts, and much more.
>Signup at www.doteasy.com
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to