简体   繁体   中英

JBAS011445: Failed to get adapter for persistence provider using WildFly

We are in the process to migrate Java 7 and JBoss 7 to Wildfly and Java 8.

In the process there is an error.

  16:38:51,323 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.subunit."foo_all.ear"."foo_sb.jar".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."foo_all.ear"."foo_sb.jar".FIRST_MODULE_USE: JBAS018733: Failed to process phase FIRST_MODULE_USE of subdeployment "foo_sb.jar" of deployment "foo_all.ear"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.8.0_45]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_45]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011445: Failed to get adapter for persistence provider 'de.foo.FooHibernatePersistenceProvider'
    at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.getPersistenceProviderAdaptor(PersistenceUnitServiceHandler.java:861)
    at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.addPuService(PersistenceUnitServiceHandler.java:259)
    at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.handleJarDeployment(PersistenceUnitServiceHandler.java:153)
    at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deploy(PersistenceUnitServiceHandler.java:128)
    at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:52)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
    ... 5 more

16:38:51,354 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "foo_all.ear")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.subunit.\"foo_all.ear\".\"foo_sb.jar\".FIRST_MODULE_USE" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"foo_all.ear\".\"foo_sb.jar\".FIRST_MODULE_USE: JBAS018733: Failed to process phase FIRST_MODULE_USE of subdeployment \"foo_sb.jar\" of deployment \"foo_all.ear\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011445: Failed to get adapter for persistence provider 'de.foo.FooHibernatePersistenceProvider'"}}

The ear file can be deployed and the server can be started. But after the ear file has been created a subdeployment has to be deployed in the root directory of the main deployment.

The persistence xml looks like this:

   <?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_1.xsd"
    version="2.1">
    <persistence-unit name="foo">
        <provider>de.foo.srv.persistenceprovider.fooHibernatePersistenceProvider</provider>
        <jta-data-source>java:/foo</jta-data-source>
        <jar-file>foo_sb.jar</jar-file>
        <properties>
            <property name="jboss.as.jpa.adapterModule" value="org.jboss.as.jpa.hibernate:4" />
        </properties>
    </persistence-unit>
</persistence>

I have already installed the ojdbc7.jar and tested the connection. Required Jar's has been connected as in JBoss 7. This worked well in JBoss 7. I don't know why it does not work with Wildfly.

Please help!

我删除了hibernate属性,它工作正常。

<property name="jboss.as.jpa.adapterModule" value="org.jboss.as.jpa.hibernate:4" />

Try to remove hibernate.jar from wildfly/lib. It's bundled in wildfly itself and could cause such problems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM