Announcement Announcement Module
Collapse
No announcement yet.
Strange behavior on AspectJ compiler with 1.1.1? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Strange behavior on AspectJ compiler with 1.1.1?

    Is it me, am I crazy? ( The proper answer is yes, and yes).

    I'm working on revamping some samples for Roo in Action where I'm testing some relationships using the DataOnDemand classes and the Integration Test framework.

    Every so often, and stickily, I get stuck in a situation where neither maven nor STS can build my application to test it. I've tried mvn test, mvn package (which calls test), etc., including a clean - mvn clean test, etc., to no avail.

    I get

    Code:
    [INFO] ------------------------------------------------------------------------
    [INFO] Building coursemanagerch4
    [INFO]    task-segment: [integration-test]
    [INFO] ------------------------------------------------------------------------
    [INFO] [aspectj:compile {execution: default}]
    [WARNING] advice defined in org.springframework.scheduling.aspectj.AbstractAsyncExecutionAspect has not been applied [Xlint:adviceDidNotMatch]
    [WARNING] advice defined in org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl has not been applied [Xlint:adviceDidNotMatch]
    [WARNING] advice defined in org.springframework.mock.staticmock.AbstractMethodMockingControl has not been applied [Xlint:adviceDidNotMatch]
    [INFO] [resources:resources {execution: default-resources}]
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] Copying 4 resources
    [INFO] [compiler:compile {execution: default-compile}]
    [INFO] Nothing to compile - all classes are up to date
    [INFO] [aspectj:test-compile {execution: default}]
    [ERROR] Missing code implementation in the compiler
    [WARNING] advice defined in org.springframework.orm.jpa.aspectj.JpaExceptionTranslatorAspect has not been applied [Xlint:adviceDidNotMatch]
    [WARNING] advice defined in org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl has not been applied [Xlint:adviceDidNotMatch]
    [WARNING] advice defined in org.springframework.mock.staticmock.AbstractMethodMockingControl has not been applied [Xlint:adviceDidNotMatch]
    [WARNING] advice defined in org.springframework.mock.staticmock.AbstractMethodMockingControl has not been applied [Xlint:adviceDidNotMatch]
    [WARNING] advice defined in org.springframework.scheduling.aspectj.AbstractAsyncExecutionAspect has not been applied [Xlint:adviceDidNotMatch]
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Compiler errors : 
    error at (no source information available)
    /Users/kenrimple/Documents/SpringRooInAction/Example-Code/chapter-04/coursemanagerch4/src/test/java/org/rooina/coursemanager/model/CourseIntegrationTest.java:1:0::0 Missing code implementation in the compiler
    It's extremely frustrating to debug this. STS doesn't complain, I've commented out any code that might be offensive, and the error gives me absolutely no clue as to why it is failing.

    I can get unstuck with this situation if I do an eclipse clean (or something, not 100% sure as it's quite intermittent) and I get the exception below - it's trying to autowire the DoD. I also get ClassNotFound errors on the test itself, etc... Something bad is happening to my project.

    I am about to re-create it from scratch and re-do my examples, just to see "is it me?" But has anyone run into this, and is there any way to get the AspectJ compiler to be less stingy when it comes to what the errors are?

    I'm on a Mac, my system JDK is 6.0.22, and I'm on Roo 1.1.1 with Maven 2.2.1. STS 2.5.2. I do have the new 6.0.23 Apple JDK loaded but it's not the default. I cleaned and got a similar message to this stack trace... about missing code implementation in the compiler.

    Code:
    2011-01-19 00:39:24,731 [main] ERROR org.springframework.test.context.TestContextManager - Caught exception while allowing TestExecutionListener [org.springframework.test.context.s
    upport.DependencyInjectionTestExecutionListener@1294aa42] to prepare test instance [org.rooina.coursemanager.model.CourseIntegrationTest@5e35dc95]
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.rooina.coursemanager.model.CourseIntegrationTest': Injection of autowired dependencies f
    ailed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.rooina.coursemanager.model.CourseDataOnDemand org.rooina.c
    oursemanager.model.CourseIntegrationTest.dod; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [org.rooina.coursemanage
    r.model.CourseDataOnDemand] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.
    beans.factory.annotation.Autowired(required=true)}
    	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:374)
    	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:110)
    	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
    	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:220)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:301)
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:303)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
    	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
    	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
    Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.rooina.coursemanager.model.CourseDataOnDemand org.rooina.coursemanager.mod
    el.CourseIntegrationTest.dod; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [org.rooina.coursemanager.model.CourseDa
    taOnDemand] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.an
    notation.Autowired(required=true)}
    	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:502)
    	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
    	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282)
    	... 26 more
    Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [org.rooina.coursemanager.model.CourseDataOnDemand] found for dependency: expec
    ted at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:920)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:789)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703)
    	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:474)
    	... 28 more

  • #2
    A follow-up. I manually re-created the project, re-ran the roo commands, and so far the tests are all running. I'm thinking something corrupted my Roo project. I can save it off and do some research later, but I'm really confused about what happened to it.

    Comment


    • #3
      You ever find out any more details about what could be going on here?

      I think I have a similar problem.

      http://forum.springsource.org/showth...dod-autowiring

      Comment


      • #4
        Robert,

        I didn't pursue it as I had a workaround. My theory is that the upgrades may have corrected some sort of problem with maven dependencies. The upgrade process between specific versions is a bit imperfect, as documented in the Roo documentation. I would say if you can do a diff between your current pom.xml file and the one from a clean project with the same features, you'd see some differences. Things to look at include the aspectJ version, Spring versions, and plugin settings.

        Ken

        Comment


        • #5
          Thanks. I did check various versions and bumped up a few to make them match, but it didn't help. I realize I could start from scratch again with a new project, but now I'm simply trying to understand some of the magic. I really would like to know how the DoD objects for integration tests are intended to be created. I cannot find a new statement that constructs them in the code, or a <bean> in any XML, so I'm don't understand where they come from.

          Comment

          Working...
          X