sleeplessman / javamelody

Automatically exported from code.google.com/p/javamelody
0 stars 0 forks source link

jboss eap 6.3 and javamelody ClassCastException #471

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have an EAR which contains javamelody deploying in jBoss EAP 6.3 and getting 
following exception;

Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBA
S011426: Could not deploy application packaged persistence provider 'net.bull.ja
vamelody.JpaPersistence'
        at org.jboss.as.jpa.processor.PersistenceProviderHandler.deploy(Persiste
nceProviderHandler.java:79)
        at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(Pe
rsistenceBeginInstallProcessor.java:45)
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(Deplo
ymentUnitPhaseService.java:159) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0
.Final-redhat-19]
        ... 5 more
Caused by: java.lang.ClassCastException: class net.bull.javamelody.JpaPersistenc
e
        at java.lang.Class.asSubclass(Class.java:3208) [rt.jar:1.7.0_75]
        at org.jboss.as.jpa.processor.PersistenceProviderHandler.deploy(Persiste
nceProviderHandler.java:73)
        ... 7 more

and Deployoment fails. 

It works fine on jBoss EAP 6.1...didn't test on EAP 6.2

Original issue reported on code.google.com by junejo.s...@gmail.com on 27 Mar 2015 at 7:19

GoogleCodeExporter commented 9 years ago
When deploying your application, jboss tries to cast the 
net.bull.javamelody.JpaPersistence class into 
javax.persistence.spi.PersistenceProvider.
This is supposed to work, but does not in your case, perhaps because you have 
several javax.persistence.spi.PersistenceProvider classes loaded: one 
javax.persistence.spi.PersistenceProvider class loaded from jboss and one 
javax.persistence.spi.PersistenceProvider class loaded from your app?

So do you have a jar file of the jpa api in your app, for example 
hibernate-jpa-2.0-api-1.0.1.Final.jar ?
If yes, should this jar file be removed from your app, because it is already 
provided by jboss EAP 6.3?

Original comment by evernat@free.fr on 1 Apr 2015 at 10:33