1

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>

  • So your "persistence provider" is not found, as the message says. Is "JavaMelody" a JPA provider? (like DataNucleus, Hibernate, EclipseLink, OpenJPA) because it isn't in the classpath if it is. And if it isn't a JPA provider then fix your `persistence.xml` to not specify it as the JPA provider – Neil Stockton Aug 26 '17 at 15:30
  • Hi Neil. Thats the way java melody wraps and monitor JPA. The "real" provider is in the property "net.bull.javamelody.jpa.provider" => "org.hibernate.jpa.HibernatePersistenceProvider" – Francisco MEndez Aug 28 '17 at 14:44
  • either way, your JPA provider is not saying "I support this persistence unit", so it gives that exception. So if Hibernate works on its own then the error is in JavaMelody and you should raise a bug on them – Neil Stockton Aug 28 '17 at 14:54

0 Answers0