- This topic has 2 replies, 1 voice, and was last updated 19 years, 8 months ago by ivj.
-
AuthorPosts
-
ivjMemberI’m using resin-3.0.12-pro, and I’m having a problem – I get java.lang.NoClassDefFoundError when it’s reading my web.xml. Web.xml:
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>Test</display-name> <listener> <listener-class>package.MyClass</listener-class> </listener> <!-- The Usual Welcome File List --> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/Error/Throwable.jsp</location> </error-page> <error-page> <error-code>404</error-code> <location>/Error/404.jsp</location> </error-page> <error-page> <error-code>403</error-code> <location>/Error/403.jsp</location> </error-page> </web-app>
And package.myClass exists as it’s supposed to (WEB-INF/classes/package/MyClass).
The error I get is:
[18:41:20.156] com.caucho.config.LineConfigException: WEB-INF/web.xml:9: java.lang.NoClassDefFoundError: package/MyClass$1
I have no idea why. Such thing never happened in the past. The only thing I can think of is the fact that this application is deployed. So I look in my $RESIN_HOME/deploy folder – everything’s perfect.
Anybody knows what could be causing this?
I begin to wonder, how does deploy feature work? My resin.conf doesn’t say anything about “deploy” folder except that it’s for ear and rar expansion (which doesn’t seem to be the case), so anybody knows?
It doesn’t matter, but I will note that MyClass is a proper Listener.
Thanks in advance!
ivjMemberI arrived at a very idiotic solution. I packaged that class into a .jar, and put that jar into WEB-INF/lib. Now everything works just fine.
The question is: why the hell?
BTW my CLASSPATH is: .
ivjMemberYAY I Solved it!
I set my CLASSPATH to:
%CLASSPATH%;.
And it started working. But I want to understand WHY.. What the hell does %CLASSPATH% do? Calling myself a programmer, wouldn’t java look inside the %CLASSPATH% variable, which would recursively give us %CLASSPATH% and so on? Somebody please reveal this mystery to me or I will kill my dog.
-
AuthorPosts