[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] LTW exceptions

Your pointcut is enough generic to try weaving Tomcat internal things. I think you can try to refine it using an within.

./alex
--
.w( the_mindstorm )p.


#: Debora Rinkevich changed the world a bit at a time by saying on 10/6/2005 12:48 AM :#
I have a very simple (HelloWorld) servlet with an aspect that I am trying to use with load-time weaving under Tomcat.

My aop.xml:

<aspectj>

   <aspects>

<aspect name="HttpServletMonitor"/>

   </aspects>

    <weaver options="-verbose -XlazyTjp">

        <include within="com.company.HWServlet"/>

   </weaver>

</aspectj>

public aspect HttpServletMonitor {

              public pointcut monitoredOperation(Object operation) :

execution(void HttpServlet.doGet(HttpServletRequest , HttpServletResponse )) && this(operation);

              void around(Object operation) : monitoredOperation(operation) {

                  proceed(operation);

                  // write a tag to file.

              }



              public HttpServletMonitor(){

              }

}



I have the hwmonitor.jar, aop.xml, aspectj.jar and aspectjweaver.jar in my classpath, and defined javaagent



When I run this, I can see the loader trying to weave, but itïs trying to weave everything it comes across instead of just HWServlet!



I end up with lots of exceptions of the following. Any thoughts on what Iïve done to cause these?



warning Register definition failed -- (BCException) malformed org.aspectj.weaver.EffectiveSignature attribute _java.io.EOFException_

malformed org.aspectj.weaver.EffectiveSignature attribute _java.io.EOFException_

_org.aspectj.weaver.BCException_: malformed org.aspectj.weaver.EffectiveSignature attribute _java.io.EOFException_

      at org.aspectj.weaver.AjAttribute.read(_AjAttribute.java:121_)

at org.aspectj.weaver.bcel.BcelAttributes.readAjAttributes(_BcelAttributes.java:59_)

at org.aspectj.weaver.bcel.BcelMethod.unpackAjAttributes(_BcelMethod.java:106_)

      at org.aspectj.weaver.bcel.BcelMethod.<init>(_BcelMethod.java:71_)

at org.aspectj.weaver.bcel.BcelObjectType.getDeclaredMethods(_BcelObjectType.java:188_)

at org.aspectj.weaver.ReferenceType.getDeclaredMethods(_ReferenceType.java:367_)

      at org.aspectj.weaver.ResolvedType.getDeclaredAdvice(_ResolvedType.java:617_)

at org.aspectj.weaver.ResolvedType.getDeclaredShadowMungers(_ResolvedType.java:633_)

at org.aspectj.weaver.ResolvedType.collectShadowMungers(_ResolvedType.java:518_)

at org.aspectj.weaver.ResolvedType.collectCrosscuttingMembers(_ResolvedType.java:448_)

at org.aspectj.weaver.CrosscuttingMembersSet.addOrReplaceAspect(_CrosscuttingMembersSet.java:58_)

      at org.aspectj.weaver.bcel.BcelWeaver.addLibraryAspect(_BcelWeaver.java:166_)

at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerAspects(_ClassLoaderWeavingAdaptor.java:233_)

at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerDefinitions(_ClassLoaderWeavingAdaptor.java:132_)

at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.<init>(_ClassLoaderWeavingAdaptor.java:93_)

      at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(_Aj.java:81_)

      at org.aspectj.weaver.loadtime.Aj.preProcess(_Aj.java:54_)

at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(_ClassPreProcessorAgentAdapter.java:52_)

      at sun.instrument.TransformerManager.transform(_TransformerManager.java:122_)

at sun.instrument.InstrumentationImpl.transform(_InstrumentationImpl.java:155_)

      at java.lang.ClassLoader.defineClass1(_Native Method_)

      at java.lang.ClassLoader.defineClass(_ClassLoader.java:620_)

      at java.security.SecureClassLoader.defineClass(_SecureClassLoader.java:124_)

      at java.net.URLClassLoader.defineClass(_URLClassLoader.java:260_)

      at java.net.URLClassLoader.access$100(_URLClassLoader.java:56_)

      at java.net.URLClassLoader$1.run(_URLClassLoader.java:195_)

      at java.security.AccessController.doPrivileged(_Native Method_)

      at java.net.URLClassLoader.findClass(_URLClassLoader.java:188_)

      at java.lang.ClassLoader.loadClass(_ClassLoader.java:306_)

      at java.lang.ClassLoader.loadClass(_ClassLoader.java:251_)

      at org.apache.catalina.startup.Bootstrap.init(_Bootstrap.java:198_)

      at org.apache.catalina.startup.Bootstrap.main(_Bootstrap.java:386_)





If I change the execution line to look for HWServlet.doGet() I get lots of a different exception:



warning Register definition failed -- (BCException) unknown TypePattern kind: 100

unknown TypePattern kind: 100

_org.aspectj.weaver.BCException_: unknown TypePattern kind: 100

      at org.aspectj.weaver.patterns.TypePattern.read(_TypePattern.java:348_)

at org.aspectj.weaver.patterns.WildTypePattern.readTypePattern150(_WildTypePattern.java:1151_)

at org.aspectj.weaver.patterns.WildTypePattern.read(_WildTypePattern.java:1123_)

      at org.aspectj.weaver.patterns.TypePattern.read(_TypePattern.java:336_)

at org.aspectj.weaver.patterns.SignaturePattern.read(_SignaturePattern.java:622_)

      at org.aspectj.weaver.patterns.KindedPointcut.read(_KindedPointcut.java:272_)

      at org.aspectj.weaver.patterns.Pointcut.read(_Pointcut.java:336_)

      at org.aspectj.weaver.patterns.AndPointcut.read(_AndPointcut.java:129_)

      at org.aspectj.weaver.patterns.Pointcut.read(_Pointcut.java:340_)

at org.aspectj.weaver.ResolvedPointcutDefinition.read(_ResolvedPointcutDefinition.java:76_)

      at org.aspectj.weaver.AjAttribute.read(_AjAttribute.java:101_)

at org.aspectj.weaver.bcel.BcelAttributes.readAjAttributes(_BcelAttributes.java:59_)

at org.aspectj.weaver.bcel.BcelObjectType.unpackAspectAttributes(_BcelObjectType.java:249_)

      at org.aspectj.weaver.bcel.BcelObjectType.<init>(_BcelObjectType.java:119_)

      at org.aspectj.weaver.bcel.BcelWorld.makeBcelObjectType(_BcelWorld.java:244_)

      at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(_BcelWorld.java:239_)

      at org.aspectj.weaver.World.resolveToReferenceType(_World.java:277_)

      at org.aspectj.weaver.World.resolve(_World.java:205_)

      at org.aspectj.weaver.bcel.BcelWeaver.addLibraryAspect(_BcelWeaver.java:144_)

at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerAspects(_ClassLoaderWeavingAdaptor.java:233_)

at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerDefinitions(_ClassLoaderWeavingAdaptor.java:132_)

at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.<init>(_ClassLoaderWeavingAdaptor.java:93_)

      at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(_Aj.java:81_)

      at org.aspectj.weaver.loadtime.Aj.preProcess(_Aj.java:54_)

at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(_ClassPreProcessorAgentAdapter.java:52_)

      at sun.instrument.TransformerManager.transform(_TransformerManager.java:122_)

at sun.instrument.InstrumentationImpl.transform(_InstrumentationImpl.java:155_)

      at java.lang.ClassLoader.defineClass1(_Native Method_)

      at java.lang.ClassLoader.defineClass(_ClassLoader.java:620_)

      at java.security.SecureClassLoader.defineClass(_SecureClassLoader.java:124_)

      at java.net.URLClassLoader.defineClass(_URLClassLoader.java:260_)

      at java.net.URLClassLoader.access$100(_URLClassLoader.java:56_)

      at java.net.URLClassLoader$1.run(_URLClassLoader.java:195_)

      at java.security.AccessController.doPrivileged(_Native Method_)

      at java.net.URLClassLoader.findClass(_URLClassLoader.java:188_)

      at java.lang.ClassLoader.loadClass(_ClassLoader.java:306_)

      at java.lang.ClassLoader.loadClass(_ClassLoader.java:251_)

      at org.apache.catalina.startup.Bootstrap.init(_Bootstrap.java:198_)

      at org.apache.catalina.startup.Bootstrap.main(_Bootstrap.java:386_)





------------------------------------------------------------------------

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users