Error deploying to Wildfly

Asked

Viewed 1,384 times

3

I’m getting an error trying to do deploy of my Wildfly 8 app:

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.

Someone knows the cause of the mistake, and how to solve it?

1 answer

3


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

Before that, the preview correct is:

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

See the documentation here.


Update

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

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

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

However, if this property is added, Wildfly does not seem to be able to find the Hibernate implementation (see error in the question).

That’s probably a bug related to the fact that you use Hibernate of your application and not what comes embedded with the server, as described in the documentation Native Hibernate Usage. Removing the property, the server can use Hibernate from the application.

  • just got confused.. the version of my Hibernate is the: 4.3.1.Final

  • @Blacksheep The problem may be caused because Wildfly contains a module with an older version of Hibernate, which is taking precedence over the version in your lib. Check the wildfly directories for the version of Hibernate that comes with it.

  • in the directory /opt/servers/wildfly-8.0.0.CR1/modules/system/layers/base/org/Hibernate/main Hibernate-core-4.3.0.Final

  • @Blacksheep I did a search for "Failed to get Adapter for persistence Provider" and nothing relevant appears. Without the application in hand to snoop around it is difficult to help. I would start by reviewing these properties of Hibernate. Look this link. Try to remove these properties jboss.jpa.*. Also try to add jboss.as.jpa.managed worthwhile false.

  • 1

    changed my persitence.XML, took this line here: <Property name="jboss.as.jpa.adapterModule" value="org.jboss.as.jpa.Hibernate:4"/> !!!

  • @Blacksheep Legal. I had no way to test it, but I figured tampering with these properties could result in something, so I put the last comment on removing the properties jboss.as.jpa.* (had misspelled). Anyway, I updated the answer so that someone who finds this question can get help more easily.

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.