Hi,
I'm trying to implement a simple application. I have a simple class (I took it from http://blog.springsource.com/2009/05/27/roo-part-2/)
and then implemented some other class that uses itCode:@Entity @RooJavaBean @RooToString @RooEntity public class Rsvp { @NotNull @Size(min = 1, max = 30) private String code; @Size(max = 30) private String email; }
When I run it the line "rsvp.persist();" throws an exception "Exception in thread "main" java.lang.IllegalStateException: Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?)" In a debug mode I see that entityManager is not injected.Code:public class MyApplication { public static void main(String params[]) { MyApplication myApp = new MyApplication(); myApp.startMyApp(); } public void startMyApp() { Rsvp rsvp = new Rsvp(); rsvp.setEmail("Email"); System.out.println("Test Rsvp email: " + rsvp.getEmail()); rsvp.persist(); } }
I use SpringSource Tool Suite 2.1.0.SR01 with Eclipse AspectJ Development Tools 2.0.1.e35x-20091001-1600 and included the following libraries in my project
aspectjweaver-1.6.3.jar
org.springframework.beans-3.0.0.RC1.jar
com.springsource.org.aspectj.tools-1.6.5.RELEASE.jar
org.springframework.jdbc-3.0.0.RC1.jar
com.springsource.org.apache.commons.dbcp-1.2.2.osgi.jar
com.springsource.javax.transaction-1.1.0.jar
com.springsource.javax.validation-1.0.0.CR3.jar
com.springsource.org.hibernate.validator-4.0.0.Beta2.jar
com.springsource.slf4j.api-1.5.6.jar
com.springsource.javax.persistence-1.0.0.jar
com.springsource.slf4j.log4j-1.5.6.jar
com.springsource.edu.emory.mathcs.backport-3.1.0.jar
ehcache-1.3.0.jar
com.springsource.org.hibernate.ejb-3.3.2.GA.jar
hibernate-annotations-3.3.1.ga.jar
com.springsource.com.mysql.jdbc-5.1.6.jar
org.springframework.transaction-3.0.0.RC1.jar
org.springframework.aop-3.0.0.RC1.jar
org.springframework.context-3.0.0.RC1.jar
org.springframework.roo.annotations-1.0.0.RC2.jar
com.springsource.org.aspectj.runtime-1.6.5.RELEASE.jar
com.springsource.org.hibernate-3.2.6.ga.jar
org.springframework.orm-3.0.0.RC1.jar
spring-jpa-2.0.6.jar
aspectjrt-1.6.5.jar
hibernate-entitymanager.jar
dbpopulator-0.1.0-SNAPSHOT.jar
org.springframework.core-3.0.0.RC1.jar
org.springframework.aspects-3.0.0.RC1.jar
com.springsource.org.apache.commons.logging-1.1.1.jar
org.springframework.beans-3.0.0.RC1.jar
org.springframework.core-3.0.0.RC1.jar
org.springframework.aspects-3.0.0.RC1.jar
aspectjweaver-1.6.3.jar
org.springframework.transaction-3.0.0.RC1.jar
com.springsource.org.apache.commons.logging-1.1.1.jar
commons-lang-2.4.jar
I read that the reason could be the absence of an aspects library. I also tried to add org.springframework.aspects-3.0.0.RC1.jar to the "AspectJ Build->Aspect path". Nothing helps![]()


Reply With Quote