Error when deploying on Wildfly

3

I'm getting an error while trying to deploy my application on Wildfly 8:

  

Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011445: Failed to get adapter for persistence provider 'org.hibernate.jpa.HibernatePersistenceProvider'

My persistence.xml:

<persistence-unit name="budget-ds" transaction-type="RESOURCE_LOCAL">
    <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
    <jta-data-source>java:jboss/budget-ds</jta-data-source>

    <properties>
        <property name="jboss.as.jpa.providerModule" value="org.hibernate"/>
        <property name="jboss.as.jpa.adapterModule" value="org.jboss.as.jpa.hibernate:4"/>
        <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
        <property name="hibernate.show_sql" value="true" />
        <property name="hibernate.format_sql" value="true" />
        <property name="hibernate.hbm2ddl.auto" value="update" />
    </properties>

</persistence-unit>

I'm using MySQL 5.5, Hibernate 4.1 and Wildfly 8.

Does anyone know the cause of the error, and how to solve it?

    
asked by anonymous 10.02.2014 / 19:15

1 answer

3

The org.hibernate.jpa.HibernatePersistenceProvider class is available starting with version 4.3 of Hibernate.

Prior to this, the correct provider is:

<provider>org.hibernate.ejb.HibernatePersistence</provider>

See the documentation . p>

Update

As reported by the PO, the issue was resolved by removing the line:

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

According to the documentation on Wildfly JPA module properties , the jboss.as.jpa.adapterModule property defines which integration classes the application server should use to work with the persistent provider (Hibernate in this case).

However, if this property is added, Wildfly seems to be unable to find the Hibernate implementation (see error in question).

This is probably a bug related to the fact that you use Hibernate in your application and not what comes in with the server, as described in Native Hibernate Usage . By removing the property, the server is able to use Hibernate's application.

    
10.02.2014 / 19:25