title: JBAS011445: Failed to get adapter for persistence provider using WildFly
body: <p>We are in the process to migrate Java 7 and JBoss 7 to Wildfly and Java 8.</p>
  
  <p>In the process there is an error.</p>
  
  <pre><code>  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" =&gt; "foo_all.ear")]) - failure description: {"JBAS014671: Failed services" =&gt; {"jboss.deployment.subunit.\"foo_all.ear\".\"foo_sb.jar\".FIRST_MODULE_USE" =&gt; "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'"}}
  </code></pre>
  
  <p>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.</p>
  
  <p>The persistence xml looks like this:</p>
  
  <pre><code>   &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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"&gt;
      &lt;persistence-unit name="foo"&gt;
          &lt;provider&gt;de.foo.srv.persistenceprovider.fooHibernatePersistenceProvider&lt;/provider&gt;
          &lt;jta-data-source&gt;java:/foo&lt;/jta-data-source&gt;
          &lt;jar-file&gt;foo_sb.jar&lt;/jar-file&gt;
          &lt;properties&gt;
              &lt;property name="jboss.as.jpa.adapterModule" value="org.jboss.as.jpa.hibernate:4" /&gt;
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>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.</p>
  
  <p>Please help!</p>