Announcement Announcement Module
Collapse
No announcement yet.
org.aspectj.weaver.BCException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • org.aspectj.weaver.BCException

    I am adding views to retrun json via MappingJacksonJsonView. I changed the resolver in the webmvc-config.xml to:

    Code:
    <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
    	  <property name="mediaTypes">
    	    <map>
    	      <entry key="html" value="text/html"/>
    	      <entry key="json" value="application/json"/>
    	    </map>
    	  </property>
    	  <property name="viewResolvers">
    	    <list>
    	      <bean class="org.springframework.js.ajax.AjaxUrlBasedViewResolver" id="tilesViewResolver">
    			<property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/>
    		  </bean>	      
    	    </list>
    	  </property>
    	  <property name="defaultViews">
    	    <list>
    	      <bean class="org.springframework.web.servlet.view.json.MappingJacksonJsonView" />
    	    </list>
    	  </property>
    	</bean>
    This worked perfectly fine when running tomcat via "mvn tomcat:run" but failed from the tc server within STS 2.2.1 with the following error (truncated due to the size limitations).

    Code:
    Nov 15, 2009 4:07:35 PM org.aspectj.weaver.tools.Jdk14Trace error
    SEVERE: org/codehaus/jackson/map/DeserializationConfig/class
    org.aspectj.weaver.BCException: Null interface signature (element:0 of 1).  Type for which weare looking at interfaces is org.codehaus.jackson.map.MapperConfig.
    when processing declare parents org.codehaus.jackson.map.DeserializationConfig
    when processing type mungers 
    when weaving 
    when weaving type org.codehaus.jackson.map.ClassIntrospector
    when weaving classes 
    
    	at org.aspectj.weaver.bcel.BcelObjectType.getDeclaredInterfaces(BcelObjectType.java:251)
    	at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:594)
    	at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:66)
    	at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:199)
    	at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:181)
    	at org.aspectj.weaver.patterns.ExactTypePattern.matchesSubtypes(ExactTypePattern.java:70)
    	at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:127)
    	at org.aspectj.weaver.patterns.DeclareParents.match(DeclareParents.java:62)
    	at org.aspectj.weaver.patterns.DeclareParents.findMatchingNewParents(DeclareParents.java:347)
    	at org.aspectj.weaver.bcel.BcelWeaver.applyDeclareParents(BcelWeaver.java:1711)
    	at org.aspectj.weaver.bcel.BcelWeaver.weaveParentTypeMungers(BcelWeaver.java:1588)
    	at org.aspectj.weaver.bcel.BcelWeaver.weaveParentsFor(BcelWeaver.java:1449)
    	at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1257)
    	at org.aspectj.weaver.tools.WeavingAdaptor.getWovenBytes(WeavingAdaptor.java:423)
    	at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:286)
    	at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:96)
    	at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52)
    	at com.springsource.tcserver.ltw.TomcatAspectJWeavingClassLoader$LoggingClassFileTransformer.transform(TomcatAspectJWeavingClassLoader.java:99)
    	at org.springframework.instrument.classloading.WeavingTransformer.transformIfNecessary(WeavingTransformer.java:95)
    	at org.springframework.instrument.classloading.WeavingTransformer.transformIfNecessary(WeavingTransformer.java:78)
    	at org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader.findResourceInternal(TomcatInstrumentableClassLoader.java:114)
    	at org.apache.catalina.loader.WebappClassLoader.findResource(WebappClassLoader.java:958)
    	at org.apache.catalina.loader.WebappClassLoader.getResource(WebappClassLoader.java:1093)
    	at org.aspectj.apache.bcel.util.ClassLoaderRepository.toURL(ClassLoaderRepository.java:276)
    	at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:289)
    	at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:390)
    	at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:373)
    	at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107)
    	at org.aspectj.weaver.World.resolveToReferenceType(World.java:397)
    	at org.aspectj.weaver.World.resolve(World.java:282)
    	at org.aspectj.weaver.World.resolve(World.java:195)
    	at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX(BcelGenericSignatureToTypeXConverter.java:95)
    	at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.fieldTypeSignature2TypeX(BcelGenericSignatureToTypeXConverter.java:111)
    	at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.typeSignature2TypeX(BcelGenericSignatureToTypeXConverter.java:184)
    	at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.typeSignature2TypeX(BcelGenericSignatureToTypeXConverter.java:173)
    	at org.aspectj.weaver.bcel.BcelMethod.unpackGenericSignature(BcelMethod.java:552)
    	at org.aspectj.weaver.bcel.BcelMethod.evictWeavingState(BcelMethod.java:572)
    	at org.aspectj.weaver.bcel.BcelObjectType.evictWeavingState(BcelObjectType.java:864)
    	at org.aspectj.weaver.bcel.BcelObjectType.weavingCompleted(BcelObjectType.java:879)
    	at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver.java:1533)
    	at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1322)
    	at org.aspectj.weaver.tools.WeavingAdaptor.getWovenBytes(WeavingAdaptor.java:423)
    	at ..... a lot more of the trace......
    Thanks so much!

  • #2
    Hmm, we have seen problems with cyclic references when using Jackson (it is essentially not aware of them) which is why we have not yet made this feature available in Roo generated applications. But if you say your application works in Tomcat but not tc Server it might make sense to raise this issue in the tc Server forum. Also, maybe you can supply a complete application so we can see and assess the problem better.

    Cheers,
    Stefan

    Comment


    • #3
      Hi,

      The AspectJ weaver does not actually support re-entrancy. However, up until recent builds this was not being policed by the weaver itself. This caused issues like the one described here. As the stack trace shows, it is running AspectJ:

      BcelWeaver.weave(BcelWeaver.java:1322)

      then it calls out to find a resource:

      TomcatInstrumentableClassLoader.findResourceIntern al(TomcatInstrumentableClassLoader.java:114)

      which ends up back in the same weaver:

      BcelWeaver.weave(BcelWeaver.java:1257)

      To address it, you could grab an AspectJ 1.6.7 from http://eclipse.org/aspectj/downloads.php that includes the re-entrancy guard.

      cheers,
      Andy Clement
      AspectJ Lead

      Comment


      • #4
        I downloaded the "Last Known Good developer build", replaced all AspectJ jars in the TC Server's lib directory and the problem went away!

        Thank you very much for the fast in-depth responses!!!!!

        Comment

        Working...
        X