Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deployment failed on Wildfly 9

I once had this issue with wildfly 8 but was solved include eclipselink.jar in $WILDFLY_HOME/modules/system/layers/base/org/eclipse/persistence/main and updating the module.xml with the resource root

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

and including on my ejb module's POM.xml

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

This works fine in Wildfly 8.*. Unfortunately employing the same technic for Wildfly 9CR1 has consistently failed the with log below:

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"}}

I have also tried removing the

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

But get a different error Persistence Provider Not Found. Could this be a Wildfly bug or there's something I am not doing right?

like image 355
Paullo Avatar asked May 24 '15 08:05

Paullo


People also ask

How to deploy an application on a WildFly domain?

This kind of deployment is available on standalone mode only. Therefore, if you are about to deploy applications on a WildFly domain, you have to use the standard management instruments (CLI or Admin Console). File system deployment just requires that you copy an archive zip into the deployments folder, in order to deploy your application. Example:

What is standalone/deployment in WildFly 8?

Deployment content (for example, war, ear, jar, and sar files) can be placed in the standalone/deployments directory of the WildFly 8 distribution, in order to be automatically deployed into the server runtime.

What happens if a deployment fails?

IMPORTANT: In case a deployment fails, the deployment scanner places a marker file application.failed (ex.Example.ear.failed) in the deployment directory to indicate that the given content failed to deploy into the runtime. The content of the file will include some information about the cause of the failure.

Why can't I start WildFly on a port 8080?

This is one of the most common issues that could happen if you are starting WildFly on a port (8080) that is already used by another WildFly / process. In order to diagnose which service is potentially blocking your WildFly start up, check out this tutorial: Solving java.net.BindException: Address already in use: JVM_Bind


1 Answers

Had the same issue, and resolved using wf9 docs: wildlfy 9 eclipselink

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

place this

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

By the way, I'm using eclipslink 2.5.2

like image 197
esmin Avatar answered Oct 13 '22 08:10

esmin