JBoss Community

AS 7 Persistence Provider Problem

created by prinzm in JBoss AS7 Development - View the full discussion

We wrote our own persistence provider which extends the HibernatePersistence class and used it in the persistence.xml

Unfortunately on server startup the following exception occurrs:

 

08:32:08,555 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.deployment.subunit."green-ear.ear"."green-ejb.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."green-ear.ear"."green-ejb.jar".INSTALL: Failed to process phase INSTALL of subdeployment "green-ejb.jar" of deployment "green-ear.ear"

    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)

    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)

    at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_25]

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_25]

    at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]

Caused by: java.lang.NullPointerException

    at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addProviderProperties(PersistenceUnitDeploymentProcessor.java:346)

    at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addPuService(PersistenceUnitDeploymentProcessor.java:253)

    at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.handleJarDeployment(PersistenceUnitDeploymentProcessor.java:115)

    at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deploy(PersistenceUnitDeploymentProcessor.java:96)

    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)

    ... 5 more

 

I looked into the source code and found the following entry in the class JPASubSystemAdd:

 

PersistenceProviderAdapterRegistry.putPersistenceProviderAdaptor(

                        "org.hibernate.ejb.HibernatePersistence", new HibernatePersistenceProviderAdaptor());

 

So Hibernate is set as the default persistence provider, and I could not find any other location in the code, where a persistence provider ist set. Therefore the method call "PersistenceProviderAdapterRegistry.getPersistenceProviderAdaptor(pu.getPersistenceProviderClassName())" in the method addProviderProperties in the class PersistenceUnitDeploymentProcessor always returns null since no other persistence provider than the default one seems to be registered. Or did I miss something? In JBoss AS 6 this worked as expected.

 

Thanks!

Reply to this message by going to Community

Start a new discussion in JBoss AS7 Development at Community