Closed GoogleCodeExporter closed 9 years ago
I have reproduced the same exception.
And you can find the class related to this at:
https://code.google.com/p/javamelody/source/browse/trunk/javamelody-core/src/mai
n/java/net/bull/javamelody/JpaPersistence.java#31
First, in your META-INF/persistence.xml file, you have written the following
line to monitor JPA:
<provider>net.bull.javamelody.JpaPersistence</provider>
At the moment, a simple and working workaround to the issue is to not try to
monitor JPA when using WildFly 8.2. That is, keep JavaMelody monitoring but
remove "<provider>net.bull.javamelody.JpaPersistence</provider>" from your
META-INF/persistence.xml file.
Then, this issue happens because the context class loader in the webapp does
not find the org.hibernate.jpa.HibernatePersistenceProvider /
org.hibernate.ejb.HibernatePersistence classes.
So, another workaround is to configure the class loading for WildFly: add a
META-INF/MANIFEST.MF file in the resources of your webapp, with the following
content:
Manifest-Version: 1.0
Dependencies: org.hibernate
That will workaround the issue and will probably make the JPA monitoring work.
References:
https://docs.jboss.org/author/display/WFLY8/JPA+Reference+Guide
https://docs.jboss.org/author/display/WFLY8/Class+Loading+in+WildFly
Meanwhile, I have posted an asynchronous question to Sirona and JavaMelody
mailing lists to ask if that could be simplified for a later release:
https://groups.google.com/forum/#!topic/javamelody/u4iDM4lHxsQ
Original comment by evernat@free.fr
on 21 Mar 2015 at 11:37
After discussion with Sirona devs (Romain in the users' group above), the
suggestion to use
"PersistenceProviderResolverHolder.getPersistenceProviderResolver().getPersisten
ceProviders()" was included in Sirona and is now also included in javamelody.
So the 2 workarounds given in the comment above will not be needed anymore to
monitor JPA in WildFly 8.2, with the next javamelody release.
This is committed in trunk (revision 4051) and ready for the next release
(1.56).
To test that it works, you can download a build of the trunk, including this
change, at:
https://javamelody.ci.cloudbees.com/job/javamelody/net.bull.javamelody$javamelod
y-core/lastSuccessfulBuild/artifact/net.bull.javamelody/javamelody-core/
Original comment by evernat@free.fr
on 1 Apr 2015 at 9:30
Original issue reported on code.google.com by
javafx....@gmail.com
on 26 Feb 2015 at 12:12Attachments: