2015-05-24 24 views
7

Una volta ho avuto questo problema con wildfly 8, ma è stato risolto include eclipselink.jar in $ WILDFLY_HOME/modules/system/layers/base/org/eclipse/persistence/main e l'aggiornamento del module.xml con risorsa radiceDistribuzione fallita su Wildfly 9

<resource-root path="eclipselink.jar" /> 

e anche per quanto riguarda il mio modulo EJB pom.xml

<dependency> 
     <groupId>org.eclipse.persistence</groupId> 
     <artifactId>eclipselink</artifactId> 
     <version>2.6.0</version> 
     <scope>provided</scope> 
    </dependency> 

Questo funziona bene in wildfly 8. *. Purtroppo impiegando la stessa tecnica per wildfly 9CR1 ha costantemente fallito il con il ceppo di seguito:

08:52:31,028 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.deployment.unit."rga-ear-1.0.ear".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."rga-ear-1.0.ear".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "rga-ear-1.0.ear" 
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:163) 
    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: java.util.ServiceConfigurationError: javax.persistence.spi.PersistenceProvider: Provider org.eclipse.persistence.jpa.PersistenceProvider could not be instantiated 
    at java.util.ServiceLoader.fail(ServiceLoader.java:232) 
    at java.util.ServiceLoader.access$100(ServiceLoader.java:185) 
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384) 
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) 
    at java.util.ServiceLoader$1.next(ServiceLoader.java:480) 
    at org.jboss.as.jpa.persistenceprovider.PersistenceProviderLoader.loadProviderModuleByName(PersistenceProviderLoader.java:70) 
    at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.lookupProvider(PersistenceUnitServiceHandler.java:998) 
    at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.nextPhaseDependsOnPersistenceUnit(PersistenceUnitServiceHandler.java:1046) 
    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:156) 
    ... 5 more 
Caused by: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for interface javax/persistence/spi/PersistenceProvider have different Class objects for the type javax/persistence/spi/ProviderUtil used in the signature 
    at java.lang.Class.getDeclaredConstructors0(Native Method) 
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2658) 
    at java.lang.Class.getConstructor0(Class.java:2964) 
    at java.lang.Class.newInstance(Class.java:403) 
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380) 
    ... 13 more 

08:52:31,195 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "rga-ear-1.0.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"rga-ear-1.0.ear\".FIRST_MODULE_USE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"rga-ear-1.0.ear\".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment \"rga-ear-1.0.ear\" 
    Caused by: java.util.ServiceConfigurationError: javax.persistence.spi.PersistenceProvider: Provider org.eclipse.persistence.jpa.PersistenceProvider could not be instantiated 
    Caused by: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method \"org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;\" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for interface javax/persistence/spi/PersistenceProvider have different Class objects for the type javax/persistence/spi/ProviderUtil used in the signature"}} 

ho anche provato a rimuovere il

<resource-root path="eclipselink.jar" /> 
eclipselink.jar 

ma ottenere un diverso errore di Persistence Provider non trovato. Potrebbe essere un bug Wildfly o c'è qualcosa che non sto facendo bene?

+0

Sembra che tu stia caricando due diverse classi 'javax.persistence.spi.PersistenceProvider'. Eclipse collega questo pacchetto all'interno del suo archivio? –

+0

No, la dose di eclipselink.jar non ha javax.persistence.spi.PersistenceProvider – Paullo

+1

È forse impacchettata nel tuo EAR? Ce ne sono sicuramente due copie sul tuo percorso di classe. –

risposta

20

avuto lo stesso problema, e risolto utilizzando documenti WF9: wildlfy 9 eclipselink

fondamentalmente, invece <resource-root path="eclipselink.jar" />

posto questa

<resource-root path="eclipselink.jar"> 
     <filter> 
       <exclude path="javax/**" /> 
     </filter> 
     </resource-root> 

A proposito, sto usando eclipslink 2.5.2

+0

Soluzione perfetta - ha funzionato per me! Grazie molto! :) – Rafcik