Results 1 to 3 of 3

Thread: Spring Aspects JAR configured as an AJC/AJDT - rehashed

  1. #1
    Join Date
    Mar 2009
    Posts
    13

    Default Spring Aspects JAR configured as an AJC/AJDT - rehashed

    This really needs to get fixed...

    Caused by: java.lang.IllegalStateException: Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?)

    This just happened again. Want to know how I fix it?

    As noted here (http://stackoverflow.com/questions/3...-entitymanager)

    I add the spring-aspects jar to my aspectJ path.

    Want to know what I do then? I remove it and the tests go back to working again just like before when this error was not being thrown. I'll continue like this for a few hours/days until it happens again - seemingly randomly.

    Seriously, this is silly.

  2. #2
    Join Date
    Aug 2010
    Location
    Goteborg, Sweden
    Posts
    434

    Default

    I was having it too and realized I had been trying to use the Data On Demand classes, that Spring Roo had generated for me, without starting up the Spring Framework. Your problem could have been about the lack of the Spring container too, I guess. Perhaps you referred to objects living there unknowingly.
    Last edited by MiB; Dec 9th, 2011 at 04:55 AM.

  3. #3
    Join Date
    May 2006
    Location
    Madrid
    Posts
    382

    Default

    The message means that the EntityManager can't be autowired in an Entity.

    You can also review the @ContextConfigurations of your tests, just in case you're using different applicatioContexts. This annotation is configured in the _Roo_IntegrationTest.aj and you can copy to the java file if you need so.

    The aspects libraries are configured in the pom, make sure you have configured your maven project in your IDE if the issue comes from executing the unit tests individually.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •