I have this error while deploying a WAR generated with Roo in Glassfish:
I have changed the transaction type to JTA in persistence.xml but still it gets an error. It says:Code:Error occurred during deployment: Exception while preparing the app : The persistence-context-ref-name [com.springsource.roo.pizzashop.domain.Base/entityManager] in module [pizzashop-0.1.0.BUILD-SNAPSHOT] resolves to a persistence unit called [persistenceUnit] which is of type RESOURCE_LOCAL. Only persistence units with transaction type JTA can be used as a container managed entity manager. Please verify your application.. Please see server.log for more details.
I have searched through the internet on solution with this, tried the codes, but still error occurs. It also says an error with surefire add-on with roo> perform tests (transaction type as JTA), but I guess it is not the real issue...Code:Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in file [/glassfish3/glassfish/domains/domain1/applications/pizzashop-0.1.0.BUILD-SNAPSHOT/WEB-INF/classes/META-INF/spring/applicationContext.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [/glassfish3/glassfish/domains/domain1/applications/pizzashop-0.1.0.BUILD-SNAPSHOT/WEB-INF/classes/META-INF/spring/applicationContext.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: persistenceUnit] Unable to build EntityManagerFactory.


Reply With Quote
