I want to monitor JPA operations with javamelody, but I get an error on deployment.
16:51:56,294 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."SNEarWeb-2.0.wf10.ear".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."SNEarWeb-2.0.wf10.ear".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "SNEarWeb-2.0.wf10.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.persistence.PersistenceException: WFLYJPA0057: PersistenceProvider 'net.bull.javamelody.JpaPersistence' not found
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.lookupProvider(PersistenceUnitServiceHandler.java:1009)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.nextPhaseDependsOnPersistenceUnit(PersistenceUnitServiceHandler.java:1052)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deploy(PersistenceUnitServiceHandler.java:136)
at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:52)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
... 5 more
I have javamelody jar on the ear, and it works just fine if i don't monitor JPA (removing the provider from the persistence.xml).
this is my persistence.xml
<persistence-unit name="LatinaUCPersistenceUnit">
<provider>net.bull.javamelody.JpaPersistence</provider>
<jta-data-source>java:/RSDS</jta-data-source>
<class>foo.class</class>
<class>foo2.class</class>
<class>foox.class</class>
<class>fooy.class</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.auditable" value="false" />
<property name="net.bull.javamelody.jpa.provider" value="org.hibernate.jpa.HibernatePersistenceProvider" />
<property name="hibernate.transaction.flush_before_completion" value="true" />
</properties>
</persistence-unit>