EntityManager does not work when using errai-cdi and Infinispan-cdi
jeetu Jan 18, 2013 12:49 PMHi,
I have a web app that uses errai-cdi and infinispan-cdi and i am now try to use the java persistence using the hibernate.
I have a service implementation that will be used by the errai and i am injecting an entitymanager to this service implementation for persisting the state of a page.
@ApplicationScoped
@Service
public class EbizInfraServiceImpl implements EbizInfraService{
@Inject
private EntityManager em;
The app compiles fine and when i try to deploy it on the Jboss EAP 6.0, it throws the following WELD deployment error
10:22:20,243 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."Titan.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."Titan.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [EntityManager] with qualifiers [@Default] at injection point [[field] @Inject private com.clink.titan.controller.EbizInfraServiceImpl.em]
at org.jboss.as.weld.services.WeldService.start(WeldService.java:83)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_30]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_30]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [EntityManager] with qualifiers [@Default] at injection point [[field] @Inject private com.clink.titan.controller.EbizInfraServiceImpl.em]
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:311)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:280)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:143)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:163)
at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:382)
at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:367)
at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:380)
at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83)
at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)
... 5 more
I am using errai-cdi 2.1.0.Final version and Infinispan-cdi's 5.2.0.ALPHA2 version and hibernate's hibernate-jpa-2.0-api 1.0.1.Final version.
Is there a problem with versions mismatch?
I had a similar issue between errai-cdi and infinispan-cdi, i got it resolved with upgrading to the above versions.
Attaching my pom.xml and server log for your reference.
Regards
Jithendra
-
pom.xml 27.0 KB
-
serverLog.txt.zip 5.5 KB