Impetus / kundera

A JPA 2.1 compliant Polyglot Object-Datastore Mapping Library for NoSQL Datastores.Please subscribe to:
http://groups.google.com/group/kundera-discuss/subscribe
Apache License 2.0
903 stars 233 forks source link

Kundera with EJB 3.x #789

Closed ansarrafique closed 8 years ago

ansarrafique commented 8 years ago

I have created a session bean, but not being able to use Kundera with EJB. I am not able to add persistence.xml file. The EJB project has a default META-INF folder, but when I add persistence.xml file it gives me deployment exception on the server side. If I add persistence.xml file in other location, Kundera is not able to load it.

How this problem can be solved? What should be the location of the persistence.xml other than META-INF folder?

Thnx

ansarrafique commented 8 years ago

In-case you are wondering about the exception on the server side by adding persistence.xml in META-INF OR resources/META-INF folder

19:08:52,261 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeplo ymentUnitProcessor](MSC service thread 1-2) JNDI bindings for session bean name d HelloWorld in deployment unit deployment "TestEJBMaven.jar" are as follows:

    java:global/TestEJBMaven/HelloWorld!com.test.HelloWorldRemote
    java:app/TestEJBMaven/HelloWorld!com.test.HelloWorldRemote
    java:module/HelloWorld!com.test.HelloWorldRemote
    java:jboss/exported/TestEJBMaven/HelloWorld!com.test.HelloWorldRemote
    java:global/TestEJBMaven/HelloWorld
    java:app/TestEJBMaven/HelloWorld
    java:module/HelloWorld

19:08:52,261 ERROR [org.jboss.msc.service.fail](MSC service thread 1-1) MSC0000 1: Failed to start service jboss.deployment.unit."TestEJBMaven.jar".INSTALL: org .jboss.msc.service.StartException in service jboss.deployment.unit."TestEJBMaven .jar".INSTALL: Failed to process phase INSTALL of deployment "TestEJBMaven.jar" at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(Deplo ymentUnitPhaseService.java:119) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(Se rviceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceCont rollerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1145) [rt.jar:1.7.0_67] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:615) [rt.jar:1.7.0_67] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67] Caused by: javax.persistence.PersistenceException: JBAS011466: PersistenceProvid er 'com.impetus.kundera.KunderaPersistence' not found at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.lookupP rovider(PersistenceUnitDeploymentProcessor.java:546) at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addPuSe rvice(PersistenceUnitDeploymentProcessor.java:279) at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.handleJ arDeployment(PersistenceUnitDeploymentProcessor.java:145) at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deploy( PersistenceUnitDeploymentProcessor.java:120) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(Deplo ymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final] ... 5 more

19:08:52,277 INFO [org.jboss.as.controller](DeploymentScanner-threads - 1) JBA S014774: Service status report JBAS014775: New missing/unsatisfied dependencies: service jboss.naming.context.java.comp.TestEJBMaven.TestEJBMaven.HelloWorl d (missing) dependents: [service jboss.naming.context.java.comp.TestEJBMaven.Tes tEJBMaven.HelloWorld.Validator, service jboss.naming.context.java.comp.TestEJBMa ven.TestEJBMaven.HelloWorld.ValidatorFactory] JBAS014777: Services which failed to start: service jboss.deployment.unit ."TestEJBMaven.jar".INSTALL: org.jboss.msc.service.StartException in service jbo ss.deployment.unit."TestEJBMaven.jar".INSTALL: Failed to process phase INSTALL o f deployment "TestEJBMaven.jar"

ansarrafique commented 8 years ago

The exception I get on the server side by adding persistence.xml file in location other than META-INF folder

BException: javax.persistence.PersistenceException: No Persistence provider for EntityManager named cassandra_pu at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInt erceptor.java:166) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final] at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor. java:230) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final] at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java: 304) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final] at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxIntercep tor.java:190) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.ja va:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropogatingInterceptor.p rocessInvocation(EJBRemoteTransactionPropogatingInterceptor.java:80) [jboss-as-e jb3-7.1.0.Final.jar:7.1.0.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.ja va:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInte rceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as -ejb3-7.1.0.Final.jar:7.1.0.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.ja va:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processIn vocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]

    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.ja

va:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocati on(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.0.Final.jar:7.1.0.Final ] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.ja va:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInter ceptor.java:45) [jboss-as-ee-7.1.0.Final.jar:7.1.0.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.ja va:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInte rceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:16 5) [jboss-as-ee-7.1.0.Final.jar:7.1.0.Final] at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageH andler.invokeMethod(MethodInvocationMessageHandler.java:300) [jboss-as-ejb3-7.1. 0.Final.jar:7.1.0.Final] at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageH andler.access$200(MethodInvocationMessageHandler.java:64) [jboss-as-ejb3-7.1.0.F inal.jar:7.1.0.Final] at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageH andler$1.run(MethodInvocationMessageHandler.java:194) [jboss-as-ejb3-7.1.0.Final .jar:7.1.0.Final] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47 1) [rt.jar:1.7.0_67] at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7. 0_67] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1145) [rt.jar:1.7.0_67] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:615) [rt.jar:1.7.0_67] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67] at org.jboss.threads.JBossThread.run(JBossThread.java:122) Caused by: javax.persistence.PersistenceException: No Persistence provider for E ntityManager named cassandra_pu at javax.persistence.Persistence.createEntityManagerFactory(Persistence. java:69) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final] at javax.persistence.Persistence.createEntityManagerFactory(Persistence. java:47) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final] at com.test.HelloWorld.persistUser(HelloWorld.java:36) [TestEJBMaven.jar :] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1 .7.0_67] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:57) [rt.jar:1.7.0_67] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:43) [rt.jar:1.7.0_67] at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_67] at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$Ma nagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodIntercep torFactory.java:72) [jboss-as-ee-7.1.0.Final.jar:7.1.0.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.ja va:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterc eptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.proce ssInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.0.Final.jar:7.1.0. Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.ja va:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocatio n(SBInvocationInterceptor.java:47) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.ja va:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInte rceptor.java:21) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.ja va:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInte rceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor .processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.1.0.Fi nal.jar:7.1.0.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.ja va:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInv ocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0. Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.ja va:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor. java:228) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final] ... 24 more

19:14:34,330 ERROR [org.jboss.remoting.remote.connection](Remoting "ansarr" rea d-1) JBREM000200: Remote connection failed: java.io.IOException: An existing con nection was forcibly closed by the remote host 19:14:34,331 INFO [org.jboss.as.naming](Remoting "ansarr" task-2) JBAS011806: Channel end notification received, closing channel Channel ID 093fd25f (inbound) of Remoting connection 035fcbbf to null

chhavigangwal commented 8 years ago

Please share the JBOSS server details that (along with the version ) you are using in your project. Also, you can mail sample project to us so that we can verify it at our end.

Chhavi

chhavigangwal commented 8 years ago

Also, please set the following in your persistence.xml

<exclude-unlisted-classes>true</exclude-unlisted-classes>

and try running your project Chhavi

ansarrafique commented 8 years ago

I have already emailed you the sample project along with the JBOSS server and version details.

chhavigangwal commented 8 years ago

Hi Ansar,

Sent you the updated project on email

Chhavi