Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] CFlowCounter internal error when loading application in tomcat

Hi,

That is a funny one...

> Caused by: java.lang.NullPointerException
>        at
> org.aspectj.runtime.internal.cflowstack.ThreadStackFactoryImpl.<clinit>(ThreadStackFactoryImpl.java:1)

There is no clinit (static initializer) in ThreadStackFactoryImpl, so
I can't tell what is null.

You aren't accidentally using a woven aspectjrt.jar are you?  Do you
have spring insight in the mix? (since that would also be weaving
things).  Any other load time weaving going on?

You could try setting this system property for the launch to send the
cflow initialization code down a different route:

aspectj.runtime.cflowstack.usethreadlocal=false

Just to see if that makes a difference.

Andy

On 25 June 2012 08:52, rmizzi <ruthmizzi@xxxxxxxxx> wrote:
> 've been struggling with this problem for a whole day today :( .. I really
> wish it is something obvious which you can help me out with ..
>
> so I'm using aspectJ to add some aspect advice to a web application. I'm
> doing things quite untidily - in a manual way but I still can;t see what can
> be wrong ..
>
> So my pointcut and aspect advice are as follows:
>
> pointcut call_classPreInit():
> staticinitialization(ExtensionSystemInitializationContextListener);
>
> after():call_classPreInit() && !cflow(adviceexecution()) {
>    // do something
> }
>
> I'm using eclipse to weave this advice into the original system code. Then I
> copy the resultant class directories into my WEB-INF/classes tomcat folder
> and restart tomcat.
> On trying to load the application, the pointcut described above is reached
> and the following exception is thrown ..
>
> 25-Jun-2012 16:37:33 org.apache.catalina.core.StandardContext listenerStart
> SEVERE: Error configuring application listener of class
> org.agnitas.emm.extension.listener.ExtensionSystemInitializationContextListener
> java.lang.ExceptionInInitializerError
>        at
> org.aspectj.runtime.internal.CFlowCounter.getThreadLocalStackFactory(CFlowCounter.java:49)
>        at
> org.aspectj.runtime.internal.CFlowCounter.selectFactoryForVMVersion(CFlowCounter.java:64)
>        at
> org.aspectj.runtime.internal.CFlowCounter.<clinit>(CFlowCounter.java:29)
>        at aspects.Aspect_openemm_0.ajc$preClinit(Aspect_openemm_0.aj:1)
>        at aspects.Aspect_openemm_0.<clinit>(Aspect_openemm_0.aj)
>        at
> org.agnitas.emm.extension.listener.ExtensionSystemInitializationContextListener.<clinit>(ExtensionSystemInitializationContextListener.java:23)
>        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>        at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
>        at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
>        at java.lang.Class.newInstance0(Class.java:372)
>        at java.lang.Class.newInstance(Class.java:325)
>        at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4150)
>        at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
>        at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
>        at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
>        at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
>        at
> org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
>        at
> org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
>        at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
>        at
> org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
>        at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
>        at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
>        at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
>        at
> org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
>        at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
>        at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
>        at
> org.apache.catalina.core.StandardService.start(StandardService.java:525)
>        at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
>        at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>        at java.lang.reflect.Method.invoke(Method.java:616)
>        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
>        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
> Caused by: java.lang.NullPointerException
>        at
> org.aspectj.runtime.internal.cflowstack.ThreadStackFactoryImpl.<clinit>(ThreadStackFactoryImpl.java:1)
>        ... 36 more
>
>
> I'm finding it very strange that searching for this particular exception on
> the web hardly gives any results .. making me think i'm doing something
> obviously wrong ... but what??!
> Any help would be greatly appreciated!
>
> --
> View this message in context: http://aspectj.2085585.n4.nabble.com/CFlowCounter-internal-error-when-loading-application-in-tomcat-tp4650399.html
> Sent from the AspectJ - users mailing list archive at Nabble.com.
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top