kundera icon indicating copy to clipboard operation
kundera copied to clipboard

Kundera - Jboss 7.1.1 Final

Open sachur opened this issue 13 years ago • 12 comments

Hi,

I have a problem with the deployment of kundera solutions in Jboss 7.1.1 Final. Actually, my application runs fine in Jboss 6.1, but I have some problems when I try to update to the new version of Jboss. It´s a web app, multi module Maven project, and I have kundera-core like a jar and another module (big-module) with the classes to work with Kundera, like a maven dependency.

If I try to deploy in Jboss 7, I have this error: 12:14:42,640 INFO [com.impetus.kundera.KunderaPersistence](MSC service thread 1-1) Loading Core 12:14:42,640 INFO [com.impetus.kundera.loader.CoreLoader](MSC service thread 1-1) Loading Kundera Core Metdata ... 12:14:42,656 ERROR [org.jboss.msc.service.fail](MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."web.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."web.war".INSTALL: Failed to process phase INSTALL of deployment "web.war" at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_23] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_23] at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_23] Caused by: javax.persistence.PersistenceException: JBAS011466: PersistenceProvider 'com.impetus.kundera.KunderaPersistence' not found at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.lookupProvider(PersistenceUnitDeploymentProcessor.java:555) at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deployPersistenceUnit(PersistenceUnitDeploymentProcessor.java:295) at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addPuService(PersistenceUnitDeploymentProcessor.java:258) at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.handleWarDeployment(PersistenceUnitDeploymentProcessor.java:194) at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deploy(PersistenceUnitDeploymentProcessor.java:118) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] ... 5 more

I had seen in https://community.jboss.org/thread/202099 that you can tunning your Jboss adding in modules folder.

persistence.xml . The tags jta-data-source and non-jta-data-source area empty, and I add one property:

And in MANIFEST of kundera-core-2.2.jar, I put this (like another jars in Jboss datasources configuration) : Manifest-Version: 1.0 Class-Path: Name: com/impetus/kundera/KunderaPersistence.class

I did it, and I obtained that exception:

12:27:47,807 ERROR [com.impetus.kundera.configure.PersistenceUnitConfiguration](MSC service thread 1-1) Error occurred during persistence unit configuration, Caused by:Could not find any META-INF/persistence.xml file in the classpath 12:27:47,807 ERROR [org.jboss.msc.service.fail](MSC service thread 1-1) MSC00001: Failed to start service jboss.persistenceunit."web.war#default": org.jboss.msc.service.StartException in service jboss.persistenceunit."web.war#default": Failed to start service at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_23] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_23] at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_23] Caused by: com.impetus.kundera.loader.PersistenceLoaderException: com.impetus.kundera.utils.InvalidConfigurationException: Could not find any META-INF/persistence.xml file in the classpath at com.impetus.kundera.configure.PersistenceUnitConfiguration.configure(PersistenceUnitConfiguration.java:103) at com.impetus.kundera.configure.Configurator.configure(Configurator.java:64) at com.impetus.kundera.KunderaPersistence.initializeKundera(KunderaPersistence.java:103) at com.impetus.kundera.KunderaPersistence.createEntityManagerFactory(KunderaPersistence.java:81) at com.impetus.kundera.KunderaPersistence.createContainerEntityManagerFactory(KunderaPersistence.java:64) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] ... 3 more Caused by: com.impetus.kundera.utils.InvalidConfigurationException: Could not find any META-INF/persistence.xml file in the classpath at com.impetus.kundera.configure.PersistenceUnitConfiguration.findPersistenceMetadatas(PersistenceUnitConfiguration.java:131) at com.impetus.kundera.configure.PersistenceUnitConfiguration.configure(PersistenceUnitConfiguration.java:86) ... 11 more

Any idea to configure correctly that persistence.xml?

Thanks

sachur avatar Feb 14 '13 15:02 sachur

Hi, Jboss AS7 is based on OSGI model and Kundera relies on TCIL(Thread context class loading) for class loading. Work is planned but we are planning for this in 2.4 possibly. Will soon update on this.

-Vivek

mevivs avatar Feb 14 '13 16:02 mevivs

Any progress on this? Or any potential workarounds for Kundera on Jboss7?

SeanTozer avatar Apr 29 '13 17:04 SeanTozer

Not yet. Planned for 2.6 release.

-Vivek

mevivs avatar Apr 29 '13 17:04 mevivs

When's that scheduled for? Looks like about a month out?

SeanTozer avatar Apr 29 '13 17:04 SeanTozer

Yes, as 2.5 is releasing today. Will post an update once we fix this in current trunk after release.

-Vivek

mevivs avatar Apr 29 '13 17:04 mevivs

Does this mean that there is currently no way to use Kundera in JBoss 7.x?

alexh97 avatar May 14 '13 19:05 alexh97

It has been fixed and releasing with 2.6

-Vivek

mevivs avatar Jul 06 '13 18:07 mevivs

Hi there,

I am trying to port my application to JBoss to enable "Container-managed EntityManager"... I was previously using Tomcat, however it does not offer such support out of the box.

I had some problems, which I managed to get solved, however now I am stucked in this one: javax.persistence.PersistenceException: JBAS011466: PersistenceProvider 'com.impetus.kundera.KunderaPersistence' not found

Can you please give more details on how to configure Kundera (persistence.xml, or other requirements/configurations) in order to have it running in JBoss 7.1.1-final?

If this is not possible at the moment, which alternatives would you suggest to enable "Contrainer-managed EntityManager"? I see Spring in your examples... probably I will give it a try, but would prefer to go for a Java EE solution... I am also trying TomEE, but get another problem (unrelated with Kundera, seems to be something like Jersey, but I am not sure) (reported it here http://openejb.979440.n4.nabble.com/TomEE-and-Jersey-Issue-td4664515.html)... from the TomEE startup logs Kundera seems to be working well with TomEE, as the different persistence units get loaded and "connection pools" initialized without any problems/warnings.

Thank you in advance for your help! Cheers,

Eduardo

PS - If you consider this should be placed in a new issue, I can start a new issue with this.

emgsilva avatar Aug 04 '13 11:08 emgsilva

Hi Eduardo, Please refer: https://github.com/impetus-opensource/Kundera/issues/303 for more details.

-Vivek

mevivs avatar Aug 04 '13 18:08 mevivs

Hi Vivek,

I did see that issue... and I do have the last version from the trunk on my project (.war). I was trying to deploy and use in Eclipse did not work, then created war and deployed it directly on JBoss (deployments directory), the same error takes place: "javax.persistence.PersistenceException: JBAS011466: PersistenceProvider 'com.impetus.kundera.KunderaPersistence' not found"

Can you tell some more details of the solution, from the issue you refer it was solved by using the last version of the trunk, which I do have... so it is not clear why this keeps on failing. Do I need to add something extra to JBoss?

Thank you!

Eduardo

emgsilva avatar Aug 04 '13 20:08 emgsilva

Please verify, if you have these settings in persistence.xml

  1. jboss.as.jpa.managed as false in persistence.xml
  2. include your entity classes with in tag and to true in persistence.xml

-Vivek

mevivs avatar Aug 05 '13 06:08 mevivs

this is still an issue for jboss/wildfly users that are not using spring: (using latest kundera and WF 10) 1.tried as explained in the guide, with jboss.as.jpa.managed=false: getting failed deployment because no one is providing the entitymanagerfactory , thats becuase jboss does not know kundera as a jpa provider - @PersistenceUnit does not know how to inject emf 2.without jboss.as.jpa.managed=false - no provider found exception on server start 3.tried loading kundera as a jboss module(see OP) , but then i get com.impetus.kundera.utils.InvalidConfigurationException: Could not find any META-INF/persistence.xml file in the classpath thats becuase persistence xml is within the application context but kundera is being loaded by jboss class loader , to solve this the jpa spec pass the correct class loader in PersistenceUnitInfo, this loader is completly ignored by PersistenceUnitConfiguration.findPersistenceMetadatas(it uses this.class.getclassloader() , where instead it should pass the correct class loader along this path of methods : createEntityManagerFactory- > EntityManagerFactoryImpl() - > configurePersistenceUnit() ->PersistenceUnitConfiguration.configure()->findPersistenceMetadatas())

asafbennatan avatar Feb 07 '18 15:02 asafbennatan