Re: [aspectwerkz-user] NoClassDefFoundError on applicatoin init

Alexandru Popescu <[email protected]> Tue, 17 May 2005 10:45:17 +0200
Newsgroups gmane.comp.java.aspectwerkz.user
Message-ID <[email protected]>
#: on behalf of Mattias J :: 5/17/2005 8:54 AM :#
> Hi again all.
> Just yesterday we noticed that AspectWerkz throws NoClassDefFoundErrors 
> during startup of our web application. The application is run under Caucho 
> Resin (2.1.16) and one of the servlets that are run on regular intervals, 
> and thus instantiated at application init, contains joinpoints. Therefore, 
> during application init, AW throws the error below one time for each 
> joinpoint. The thing is that the aspect is still applied when the servet is 
> run...
> 
> We use AW 2.0 and this problem occurs with offline weaving only. The errors 
> can be removed by placing aspectwerkz-2.0.jar in Resins lib (or the system 
> classpath), but we do not want to maintain an AW installation on the 
> deployment servers.
> 
> How can we best track down what is the actual problem?
> (Or should we just ignore it, since everything works anyway...?)
> 
> 
> Here is the stacktrace:
> java.lang.NoClassDefFoundError: 
> org/codehaus/aspectwerkz/transform/AspectWerkzPreProcessor
>          at 
> org.codehaus.aspectwerkz.definition.SystemDefinitionContainer.dump(SystemDefinitionContainer.java:369)
>          at 
> org.codehaus.aspectwerkz.definition.SystemDefinitionContainer.registerClassLoader(SystemDefinitionContainer.java:147)
>          at 
> org.codehaus.aspectwerkz.definition.SystemDefinitionContainer.getHierarchicalDefinitionsFor(SystemDefinitionContainer.java:317)
>          at 
> org.codehaus.aspectwerkz.definition.SystemDefinitionContainer.getDefinitionsFor(SystemDefinitionContainer.java:225)
>          at 
> org.codehaus.aspectwerkz.joinpoint.management.JoinPointManager.getAdviceInfoContainerForJoinPoint(JoinPointManager.java:282)
>          at 
> org.codehaus.aspectwerkz.joinpoint.management.JoinPointManager.compileJoinPoint(JoinPointManager.java:230)
>          at 
> org.codehaus.aspectwerkz.joinpoint.management.JoinPointManager.loadJoinPoint(JoinPointManager.java:118)
>          at 
> se.exder.servlet.BundleServlet.aw$initJoinPoints(BundleServlet.java)
>          at se.exder.servlet.BundleServlet.<clinit>(BundleServlet.java)
>          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
> Method)
>          at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>          at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>          at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>          at java.lang.Class.newInstance0(Class.java:350)
>          at java.lang.Class.newInstance(Class.java:303)
>          at java.beans.Beans.instantiate(Beans.java:204)
>          at java.beans.Beans.instantiate(Beans.java:48)
>          at 
> com.caucho.server.http.Application.instantiateServlet(Application.java:3183)
>          at 
> com.caucho.server.http.Application.createServlet(Application.java:3104)
>          at 
> com.caucho.server.http.Application.loadServlet(Application.java:3065)
>          at 
> com.caucho.server.http.Application.initServlets(Application.java:1923)
>          at com.caucho.server.http.Application.init(Application.java:1849)
>          at com.caucho.server.http.VirtualHost.init(VirtualHost.java:728)
>          at 
> com.caucho.server.http.ServletServer.initHosts(ServletServer.java:887)
>          at 
> com.caucho.server.http.ServletServer.initInternal(ServletServer.java:729)
>          at com.caucho.server.http.ServletServer.init(ServletServer.java:538)
>          at com.caucho.server.http.ResinServer.init(ResinServer.java:415)
>          at com.caucho.server.http.ResinServer.main(ResinServer.java:1176)
>          at com.caucho.server.http.HttpServer.main(HttpServer.java:103)
> 
> 

It seems like a CL problem. Isn't it possible to debug your application to see what is really goin'
on? (start Resin in debug mode, hook a remote debug session with your IDE and set a breakpoint for
uncaught NoClassDefFoundError or maybe put directly a breakpoint in SystemDefinitionContainer.dump).

:alex |.::the_mindstorm::.|