Announcement Announcement Module
Collapse
No announcement yet.
*AspectJ*Tests no longer work with RC2 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • *AspectJ*Tests no longer work with RC2

    I am fully stymied. After an upgrad to RC2, my tests that used AbstractAspectjJpaTests no longer works. I've debugged as far as I can, but have not been able to learn anything useful. I have used both the RC2 distribution and build the sources myself.

    It would be really useful to know what version of aspect spring was using (ie, it would be nice spring put version numbers on depedent jars).

    java.lang.NullPointerException
    at org.aspectj.weaver.tools.WeavingAdaptor$WeavingCla ssFileProvider.<init>(WeavingAdaptor.java:479)
    at org.aspectj.weaver.tools.WeavingAdaptor.getWovenBy tes(WeavingAdaptor.java:283)
    at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass (WeavingAdaptor.java:212)
    at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java: 65)
    at org.aspectj.weaver.loadtime.ClassPreProcessorAgent Adapter.transform(ClassPreProcessorAgentAdapter.ja va:55)
    at org.springframework.instrument.classloading.Shadow ingClassLoader.applyTransformers(ShadowingClassLoa der.java:119)
    at org.springframework.instrument.classloading.Shadow ingClassLoader.doLoadClass(ShadowingClassLoader.ja va:101)
    at org.springframework.instrument.classloading.Shadow ingClassLoader.loadClass(ShadowingClassLoader.java :58)
    at org.xml.sax.helpers.NewInstance.newInstance(Unknow n Source)
    at org.xml.sax.helpers.XMLReaderFactory.loadClass(Unk nown Source)
    at org.xml.sax.helpers.XMLReaderFactory.createXMLRead er(Unknown Source)
    at org.aspectj.weaver.loadtime.definition.DocumentPar ser.getXMLReader(DocumentParser.java:124)
    at org.aspectj.weaver.loadtime.definition.DocumentPar ser.parse(DocumentParser.java:85)
    at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdap tor.parseDefinitions(ClassLoaderWeavingAdaptor.jav a:170)
    at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdap tor.initialize(ClassLoaderWeavingAdaptor.java:104)
    at org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializ edClassLoaderWeavingAdaptor.initialize(Aj.java:130 )
    at org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializ edClassLoaderWeavingAdaptor.getWeavingAdaptor(Aj.j ava:135)
    at org.aspectj.weaver.loadtime.Aj$WeaverContainer.get Weaver(Aj.java:101)
    at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java: 61)
    at org.aspectj.weaver.loadtime.ClassPreProcessorAgent Adapter.transform(ClassPreProcessorAgentAdapter.ja va:55)
    at org.springframework.instrument.classloading.Shadow ingClassLoader.applyTransformers(ShadowingClassLoa der.java:119)
    at org.springframework.instrument.classloading.Shadow ingClassLoader.doLoadClass(ShadowingClassLoader.ja va:101)
    at org.springframework.instrument.classloading.Shadow ingClassLoader.loadClass(ShadowingClassLoader.java :58)
    at org.apache.commons.logging.impl.LogFactoryImpl$1.r un(LogFactoryImpl.java:441)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.commons.logging.impl.LogFactoryImpl.loa dClass(LogFactoryImpl.java:435)
    at org.apache.commons.logging.impl.LogFactoryImpl.isL og4JAvailable(LogFactoryImpl.java:505)
    at org.apache.commons.logging.impl.LogFactoryImpl.get LogClassName(LogFactoryImpl.java:327)
    at org.apache.commons.logging.impl.LogFactoryImpl.get LogConstructor(LogFactoryImpl.java:368)
    at org.apache.commons.logging.impl.LogFactoryImpl.new Instance(LogFactoryImpl.java:529)
    at org.apache.commons.logging.impl.LogFactoryImpl.get Instance(LogFactoryImpl.java:235)
    at org.apache.commons.logging.impl.LogFactoryImpl.get Instance(LogFactoryImpl.java:209)
    at org.apache.commons.logging.LogFactory.getLog(LogFa ctory.java:351)
    at org.springframework.util.FileCopyUtils.<clinit>(Fi leCopyUtils.java:49)
    at org.springframework.instrument.classloading.Shadow ingClassLoader.doLoadClass(ShadowingClassLoader.ja va:100)
    at org.springframework.instrument.classloading.Shadow ingClassLoader.loadClass(ShadowingClassLoader.java :58)
    at org.springframework.test.jpa.AbstractJpaTests.runB are(AbstractJpaTests.java:175)
    at junit.framework.TestResult$1.protect(TestResult.ja va:110)
    at junit.framework.TestResult.runProtected(TestResult .java:128)
    at junit.framework.TestResult.run(TestResult.java:113 )
    at junit.framework.TestCase.run(TestCase.java:120)
    at junit.framework.TestSuite.runTest(TestSuite.java:2 28)
    at junit.framework.TestSuite.run(TestSuite.java:223)
    at org.junit.internal.runners.OldTestClassRunner.run( OldTestClassRunner.java:35)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestR eference.run(JUnit4TestReference.java:38)
    at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:196)

  • #2
    I just swapped out my version of aspectj jars (1.5.2) for the unknown version distributed with spring -- same problem.

    Comment


    • #3
      Probable cause

      I have been working from spring source during RC1. That is I have the spring eclipse project in my workspace and depend on it directly. However, I have none of the spring lib/*.jar's exported from the spring project. But when I run, all the spring lib/*.jars's ARE included in the classpath.

      It appears as if eclipse 3.2 no longer honors the export of jars from a project. If I uncheck any jars from other eclipse project, those jars too are included in the classpath during running/testing.

      So most likely my problem has to do with conflicting jars on the runtime classpath. But has anybody else seen this eclipse behavior since 3.2?

      Comment


      • #4
        It's a confirmed bug actually in RC2:
        http://opensource.atlassian.com/proj...rowse/SPR-2283

        Comment


        • #5
          Thanks! Another workaround other than reverting to RC1, is to use the aspectjweaver.jar /and/ xercesImpl.jar provided by RC2.

          Again, it would be sooo nice to know the jar versions of the lib/ directory.

          Comment


          • #6
            hmm. I think the aspectjweaver.jar is just version 1.5.2 from the aspectj website and I don't remember seeing a xercesImpl.jar provided with the spring-with-dependencies distro. Where should I look to find that? I am currently using 1.5.2 aspectjweaver.jar but the problem still persists.

            If you have it working with RC2, I wonder what the magic is?

            Comment


            • #7
              It can be found in lib/xerces/xercesImpl.jar

              Comment


              • #8
                Hmm. that folder doesn't exist in the nightly distribution.. In any case, the latest nightly RC3 builds have this problem fixed. My tests are working great now.

                Thanks Juergen!

                Comment

                Working...
                X