Announcement Announcement Module
Collapse
No announcement yet.
TomcatAspectJWeavingClassLoader errors on org.hibernate.search.backend.OptimizeLucene Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • TomcatAspectJWeavingClassLoader errors on org.hibernate.search.backend.OptimizeLucene

    I am getting a Nullpointer when integrating Hibernate Search with Spring on tc Server. I believe this is a bug but wanted to confirm and see if there's a workaround:


    ----
    [TomcatAspectJWeavingClassLoader@38e4cb7d] abort trouble in:
    public class org.hibernate.search.backend.OptimizeLuceneWork extends org.hibernate.search.backend.LuceneWork implements java.io.Serializable:
    public void <init>(Class):
    ALOAD_0 // Lorg/hibernate/search/backend/OptimizeLuceneWork; this (line 17)
    ACONST_NULL
    ACONST_NULL
    ALOAD_1 // Ljava/lang/Class; entity
    INVOKESPECIAL org.hibernate.search.backend.LuceneWork.<init> (Ljava/io/Serializable;Ljava/lang/String;Ljava/lang/ClassV
    constructor-execution(void org.hibernate.search.backend.OptimizeLuceneWork.<i nit>(java.lang.Class))
    | RETURN (line 18)
    constructor-execution(void org.hibernate.search.backend.OptimizeLuceneWork.<i nit>(java.lang.Class))
    end public void <init>(Class)

    public Object getWorkDelegate(org.hibernate.search.backend.WorkV isitor):
    ALOAD_1 // Lorg/hibernate/search/backend/WorkVisitor; visitor (line 22)
    ALOAD_0 // Lorg/hibernate/search/backend/OptimizeLuceneWork; this
    INVOKEINTERFACE org.hibernate.search.backend.WorkVisitor.getDelega te (Lorg/hibernate/search/backend/OptimizeLuceneWorkLjava/lang/Object;
    ARETURN
    end public Object getWorkDelegate(org.hibernate.search.backend.WorkV isitor)

    end public class org.hibernate.search.backend.OptimizeLuceneWork
    -- (NullPointerException) null
    null
    java.lang.NullPointerException
    at org.aspectj.weaver.ResolvedMemberImpl.appendSigWit hTypeVarBoundsRemoved(ResolvedMemberImpl.java:1028 )
    at org.aspectj.weaver.ResolvedMemberImpl.getParameter SigWithBoundsRemoved(ResolvedMemberImpl.java:991)
    at org.aspectj.weaver.ResolvedMemberImpl.matches(Reso lvedMemberImpl.java:950)
    at org.aspectj.weaver.ResolvedType.lookupResolvedMemb er(ResolvedType.java:439)
    at org.aspectj.weaver.JoinPointSignatureIterator.find SignaturesFromSupertypes(JoinPointSignatureIterato r.java:200)
    at org.aspectj.weaver.JoinPointSignatureIterator.find SignaturesFromSupertypes(JoinPointSignatureIterato r.java:238)
    at org.aspectj.weaver.JoinPointSignatureIterator.hasN ext(JoinPointSignatureIterator.java:74)
    at org.aspectj.weaver.patterns.SignaturePattern.match es(SignaturePattern.java:291)
    at org.aspectj.weaver.patterns.KindedPointcut.matchIn ternal(KindedPointcut.java:106)
    at org.aspectj.weaver.patterns.Pointcut.match(Pointcu t.java:146)
    at org.aspectj.weaver.patterns.AndPointcut.matchInter nal(AndPointcut.java:52)
    at org.aspectj.weaver.patterns.Pointcut.match(Pointcu t.java:146)
    at org.aspectj.weaver.ShadowMunger.match(ShadowMunger .java:107)
    at org.aspectj.weaver.Advice.match(Advice.java:110)
    at org.aspectj.weaver.bcel.BcelAdvice.match(BcelAdvic e.java:142)
    at org.aspectj.weaver.bcel.BcelClassWeaver.match(Bcel ClassWeaver.java:3102)
    at org.aspectj.weaver.bcel.BcelClassWeaver.match(Bcel ClassWeaver.java:2565)
    at org.aspectj.weaver.bcel.BcelClassWeaver.weave(Bcel ClassWeaver.java:488)
    at org.aspectj.weaver.bcel.BcelClassWeaver.weave(Bcel ClassWeaver.java:103)
    at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeave r.java:1810)
    at org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDum p(BcelWeaver.java:1755)
    at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify( BcelWeaver.java:1515)
    at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeave r.java:1322)
    at org.aspectj.weaver.tools.WeavingAdaptor.getWovenBy tes(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.ClassPreProcessorAgent Adapter.transform(ClassPreProcessorAgentAdapter.ja va:52)
    at com.springsource.tcserver.ltw.TomcatAspectJWeaving ClassLoader$LoggingClassFileTransformer.transform( TomcatAspectJWeavingClassLoader.java:99)
    at org.springframework.instrument.classloading.Weavin gTransformer.transformIfNecessary(WeavingTransform er.java:95)
    ---

  • #2
    Hi,

    I haven't seen that before so I've raised it as: https://bugs.eclipse.org/bugs/show_bug.cgi?id=300120 against AspectJ.

    Out of interest, what version of AspectJ are you using?

    thanks
    Andy
    ---
    Andy Clement
    AspectJ Project Lead

    Comment


    • #3
      AspectJ 1.5.4 with Spring 3

      Thanks,
      Thomas

      Comment


      • #4
        Of course, you know what my next response will be

        Can you try with the latest AspectJ? 1.6.8 is 2 years newer than 1.5.4. Either it will have been addressed (although I can't find a bug opened with that problem) or at least we'll get a more up to date stack trace as some code is likely to have moved around since then.

        thanks,
        Andy

        Comment


        • #5
          Tried this time with 1.6.6 and got the same error

          INFO : org.springframework.beans.factory.support.DefaultL istableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@5e899a54: defining beans [catalogRepoImpl,catalogServiceImpl,catalogControll er,org.springframework.context.annotation.internal ConfigurationAnnotationProcessor,org.springframewo rk.context.annotation.internalAutowiredAnnotationP rocessor,org.springframework.context.annotation.in ternalRequiredAnnotationProcessor,org.springframew ork.context.annotation.internalCommonAnnotationPro cessor,org.springframework.context.annotation.inte rnalPersistenceAnnotationProcessor,entityManagerFa ctory,dataSource,transactionManager,placeholderPro perties,org.springframework.aop.config.internalAut oProxyCreator,org.springframework.transaction.anno tation.AnnotationTransactionAttributeSource#0,org. springframework.transaction.interceptor.Transactio nInterceptor#0,org.springframework.transaction.con fig.internalTransactionAdvisor,mbeanExporter,org.s pringframework.web.servlet.mvc.annotation.DefaultA nnotationHandlerMapping#0,org.springframework.form at.support.FormattingConversionServiceFactoryBean# 0,org.springframework.web.servlet.mvc.annotation.A nnotationMethodHandlerAdapter#0,org.springframewor k.web.servlet.view.ContentNegotiatingViewResolver# 0]; root of factory hierarchy
          [TomcatAspectJWeavingClassLoader@690bbdb8] abort trouble in:
          public class org.hibernate.search.backend.PurgeAllLuceneWork extends org.hibernate.search.backend.LuceneWork implements java.io.Serializable:
          private static final long serialVersionUID = 8124091288284011715
          public void <init>(Class):
          ALOAD_0 // Lorg/hibernate/search/backend/PurgeAllLuceneWork; this (line 16)
          ACONST_NULL
          ACONST_NULL
          ALOAD_1 // Ljava/lang/Class; entity
          ACONST_NULL
          INVOKESPECIAL org.hibernate.search.backend.LuceneWork.<init> (Ljava/io/Serializable;Ljava/lang/String;Ljava/lang/Class;Lorg/apache/lucene/document/DocumentV
          constructor-execution(void org.hibernate.search.backend.PurgeAllLuceneWork.<i nit>(java.lang.Class))
          | RETURN (line 17)
          constructor-execution(void org.hibernate.search.backend.PurgeAllLuceneWork.<i nit>(java.lang.Class))
          end public void <init>(Class)

          public Object getWorkDelegate(org.hibernate.search.backend.WorkV isitor):
          ALOAD_1 // Lorg/hibernate/search/backend/WorkVisitor; visitor (line 21)
          ALOAD_0 // Lorg/hibernate/search/backend/PurgeAllLuceneWork; this
          INVOKEINTERFACE org.hibernate.search.backend.WorkVisitor.getDelega te (Lorg/hibernate/search/backend/PurgeAllLuceneWorkLjava/lang/Object;
          ARETURN
          end public Object getWorkDelegate(org.hibernate.search.backend.WorkV isitor)

          end public class org.hibernate.search.backend.PurgeAllLuceneWork
          -- (NullPointerException) null
          null
          java.lang.NullPointerException
          at org.aspectj.weaver.ResolvedMemberImpl.appendSigWit hTypeVarBoundsRemoved(ResolvedMemberImpl.java:1028 )
          at org.aspectj.weaver.ResolvedMemberImpl.getParameter SigWithBoundsRemoved(ResolvedMemberImpl.java:991)
          at org.aspectj.weaver.ResolvedMemberImpl.matches(Reso lvedMemberImpl.java:950)
          at org.aspectj.weaver.ResolvedType.lookupResolvedMemb er(ResolvedType.java:439)
          at org.aspectj.weaver.JoinPointSignatureIterator.find SignaturesFromSupertypes(JoinPointSignatureIterato r.java:200)
          at org.aspectj.weaver.JoinPointSignatureIterator.find SignaturesFromSupertypes(JoinPointSignatureIterato r.java:238)
          at org.aspectj.weaver.JoinPointSignatureIterator.hasN ext(JoinPointSignatureIterator.java:74)
          at org.aspectj.weaver.patterns.SignaturePattern.match es(SignaturePattern.java:291)
          at org.aspectj.weaver.patterns.KindedPointcut.matchIn ternal(KindedPointcut.java:106)
          at org.aspectj.weaver.patterns.Pointcut.match(Pointcu t.java:146)
          at org.aspectj.weaver.patterns.AndPointcut.matchInter nal(AndPointcut.java:52)
          at org.aspectj.weaver.patterns.Pointcut.match(Pointcu t.java:146)
          at org.aspectj.weaver.ShadowMunger.match(ShadowMunger .java:107)
          at org.aspectj.weaver.Advice.match(Advice.java:110)
          at org.aspectj.weaver.bcel.BcelAdvice.match(BcelAdvic e.java:142)
          at org.aspectj.weaver.bcel.BcelClassWeaver.match(Bcel ClassWeaver.java:3102)
          at org.aspectj.weaver.bcel.BcelClassWeaver.match(Bcel ClassWeaver.java:2565)
          at org.aspectj.weaver.bcel.BcelClassWeaver.weave(Bcel ClassWeaver.java:488)
          at org.aspectj.weaver.bcel.BcelClassWeaver.weave(Bcel ClassWeaver.java:103)
          at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeave r.java:1810)
          at org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDum p(BcelWeaver.java:1755)
          at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify( BcelWeaver.java:1515)
          at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeave r.java:1322)
          at org.aspectj.weaver.tools.WeavingAdaptor.getWovenBy tes(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.ClassPreProcessorAgent Adapter.transform(ClassPreProcessorAgentAdapter.ja va:52)
          at com.springsource.tcserver.ltw.TomcatAspectJWeaving ClassLoader$LoggingClassFileTransformer.transform( TomcatAspectJWeavingClassLoader.java:99)

          Comment


          • #6
            Hi,

            Sorry for the slow response. I did some digging around the stack trace:

            java.lang.NullPointerException
            at org.aspectj.weaver.ResolvedMemberImpl.appendSigWit hTypeVarBoundsRemoved(ResolvedMemberImpl.java:1028 )
            at org.aspectj.weaver.ResolvedMemberImpl.getParameter SigWithBoundsRemoved(ResolvedMemberImpl.java:991)
            at org.aspectj.weaver.ResolvedMemberImpl.matches(Reso lvedMemberImpl.java:950)
            at org.aspectj.weaver.ResolvedType.lookupResolvedMemb er(ResolvedType.java:439)

            It is indicating that this call in ResolvedMemberImpl:

            UnresolvedType[] myParameterTypes = getGenericParameterTypes();

            is returning an array with null components. In 1.6.8 however that code has changed (due to the reworked matching algorithms):

            UnresolvedType[] myParameterTypes = getParameterTypes();

            Are you able to try 1.6.8?

            cheers,
            Andy

            Comment


            • #7
              I am getting the exact same stacktrace with 1.6.8:

              INFO : org.springframework.beans.factory.support.DefaultL istableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@48454bc7: defining beans [catalogRepoImpl,catalogServiceImpl,catalogControll er,org.springframework.context.annotation.internal ConfigurationAnnotationProcessor,org.springframewo rk.context.annotation.internalAutowiredAnnotationP rocessor,org.springframework.context.annotation.in ternalRequiredAnnotationProcessor,org.springframew ork.context.annotation.internalCommonAnnotationPro cessor,org.springframework.context.annotation.inte rnalPersistenceAnnotationProcessor,entityManagerFa ctory,dataSource,transactionManager,placeholderPro perties,org.springframework.aop.config.internalAut oProxyCreator,org.springframework.transaction.anno tation.AnnotationTransactionAttributeSource#0,org. springframework.transaction.interceptor.Transactio nInterceptor#0,org.springframework.transaction.con fig.internalTransactionAdvisor,mbeanExporter,org.s pringframework.web.servlet.mvc.annotation.DefaultA nnotationHandlerMapping#0,org.springframework.form at.support.FormattingConversionServiceFactoryBean# 0,org.springframework.web.servlet.mvc.annotation.A nnotationMethodHandlerAdapter#0,org.springframewor k.web.servlet.view.ContentNegotiatingViewResolver# 0]; root of factory hierarchy
              [TomcatAspectJWeavingClassLoader@24c3e952] abort trouble in:
              public class org.hibernate.search.backend.PurgeAllLuceneWork extends org.hibernate.search.backend.LuceneWork implements java.io.Serializable:
              private static final long serialVersionUID = 8124091288284011715
              public void <init>(Class):
              ALOAD_0 // Lorg/hibernate/search/backend/PurgeAllLuceneWork; this (line 16)
              ACONST_NULL
              ACONST_NULL
              ALOAD_1 // Ljava/lang/Class; entity
              ACONST_NULL
              INVOKESPECIAL org.hibernate.search.backend.LuceneWork.<init> (Ljava/io/Serializable;Ljava/lang/String;Ljava/lang/Class;Lorg/apache/lucene/document/DocumentV
              constructor-execution(void org.hibernate.search.backend.PurgeAllLuceneWork.<i nit>(java.lang.Class))
              | RETURN (line 17)
              constructor-execution(void org.hibernate.search.backend.PurgeAllLuceneWork.<i nit>(java.lang.Class))
              end public void <init>(Class)

              public Object getWorkDelegate(org.hibernate.search.backend.WorkV isitor):
              ALOAD_1 // Lorg/hibernate/search/backend/WorkVisitor; visitor (line 21)
              ALOAD_0 // Lorg/hibernate/search/backend/PurgeAllLuceneWork; this
              INVOKEINTERFACE org.hibernate.search.backend.WorkVisitor.getDelega te (Lorg/hibernate/search/backend/PurgeAllLuceneWorkLjava/lang/Object;
              ARETURN
              end public Object getWorkDelegate(org.hibernate.search.backend.WorkV isitor)

              end public class org.hibernate.search.backend.PurgeAllLuceneWork
              -- (NullPointerException) null
              null
              java.lang.NullPointerException
              at org.aspectj.weaver.ResolvedMemberImpl.appendSigWit hTypeVarBoundsRemoved(ResolvedMemberImpl.java:1028 )
              at org.aspectj.weaver.ResolvedMemberImpl.getParameter SigWithBoundsRemoved(ResolvedMemberImpl.java:991)
              at org.aspectj.weaver.ResolvedMemberImpl.matches(Reso lvedMemberImpl.java:950)
              at org.aspectj.weaver.ResolvedType.lookupResolvedMemb er(ResolvedType.java:439)
              at org.aspectj.weaver.JoinPointSignatureIterator.find SignaturesFromSupertypes(JoinPointSignatureIterato r.java:200)
              at org.aspectj.weaver.JoinPointSignatureIterator.find SignaturesFromSupertypes(JoinPointSignatureIterato r.java:238)
              at org.aspectj.weaver.JoinPointSignatureIterator.hasN ext(JoinPointSignatureIterator.java:74)
              at org.aspectj.weaver.patterns.SignaturePattern.match es(SignaturePattern.java:291)
              at org.aspectj.weaver.patterns.KindedPointcut.matchIn ternal(KindedPointcut.java:106)
              at org.aspectj.weaver.patterns.Pointcut.match(Pointcu t.java:146)
              at org.aspectj.weaver.patterns.AndPointcut.matchInter nal(AndPointcut.java:52)
              at org.aspectj.weaver.patterns.Pointcut.match(Pointcu t.java:146)
              at org.aspectj.weaver.ShadowMunger.match(ShadowMunger .java:107)
              at org.aspectj.weaver.Advice.match(Advice.java:110)
              at org.aspectj.weaver.bcel.BcelAdvice.match(BcelAdvic e.java:142)
              at org.aspectj.weaver.bcel.BcelClassWeaver.match(Bcel ClassWeaver.java:3102)
              at org.aspectj.weaver.bcel.BcelClassWeaver.match(Bcel ClassWeaver.java:2565)
              at org.aspectj.weaver.bcel.BcelClassWeaver.weave(Bcel ClassWeaver.java:488)
              at org.aspectj.weaver.bcel.BcelClassWeaver.weave(Bcel ClassWeaver.java:103)
              at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeave r.java:1810)
              at org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDum p(BcelWeaver.java:1755)
              at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify( BcelWeaver.java:1515)
              at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeave r.java:1322)
              at org.aspectj.weaver.tools.WeavingAdaptor.getWovenBy tes(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.ClassPreProcessorAgent Adapter.transform(ClassPreProcessorAgentAdapter.ja va:52)
              at com.springsource.tcserver.ltw.TomcatAspectJWeaving ClassLoader$LoggingClassFileTransformer.transform( TomcatAspectJWeavingClassLoader.java:99)
              at org.springframework.instrument.classloading.Weavin gTransformer.transformIfNecessary(WeavingTransform er.java:95)

              Comment


              • #8
                Hi,

                Could there possibly be an older aspectj interfering with that latest run? The stack trace doesn't seem to tie up with AspectJ 1.6.8.

                ResolvedMemberImpl.java:991 doesn't call appendSigWithTypeVarBoundsRemoved()
                ResolvedMemberImpl.java:950 is a comment line

                (whereas they are all correct for 1.6.6)

                sorry to keep getting you to retry, just trying to be absolute certain the most recent AspectJ has this problem because it could prove very tricky to track down. Are you able to distill a testcase down from the part of your application that has this problem?

                cheers,
                Andy

                Comment


                • #9
                  Found it

                  Hey Andy,

                  Sorry it took me a silly long time to get back to you on this. I didn't immediately find the issue as I was using the SpringSource tc server that ships with STS 2.3.0 AspectJ is deployed in the system classpath so my versions within the webapp's container were ignored.
                  Deploying the same app on plain Tomcat 6.0 works fine (I am not even adding AspectJ to the classpath).

                  Thomas

                  Comment


                  • #10
                    Tried STS 2.3.1 with the new tc Server 6.0.20.C (which has aspectjweaver-1.6.8 in its system classpath) which resolved the issue.

                    Comment

                    Working...
                    X