title: JBoss as7 to WildFly migration with Hibernate
body: <p>I try to migrate from JBoss AS 7 to Wildfly 8.2. and i have really problems with hibernate.</p>
  
  <p>I'm using maven with the dependenies:</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
    &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
    &lt;version&gt;4.2.0.Final&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
    &lt;artifactId&gt;hibernate-jpa-2.0-api&lt;/artifactId&gt;
    &lt;version&gt;1.0.1.Final&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>When i start my application witch is working in AS 7 i get the error in wildfly:</p>
  
  <pre><code>10:08:11,485 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 53) MSC000001: Failed to start service jboss.persistenceunit."com.haslerrail.MyDatabase.web.war#MyDatabase": org.jboss.msc.service.StartException in service jboss.persistenceunit."com.haslerrail.MyDatabase.web.war#MyDatabase": javax.persistence.PersistenceException: [PersistenceUnit: MyDatabase] Unable to build Hibernate SessionFactory
        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172) [wildfly-jpa-8.2.0.Final.jar:8.2.0.Final]
        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) [wildfly-jpa-8.2.0.Final.jar:8.2.0.Final]
        at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_65]
        at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:474)
        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) [wildfly-jpa-8.2.0.Final.jar:8.2.0.Final]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_65]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_65]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
        at org.jboss.threads.JBossThread.run(JBossThread.java:122)
  Caused by: javax.persistence.PersistenceException: [PersistenceUnit: MyDatabase] Unable to build Hibernate SessionFactory
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:1239) [hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.access$600(EntityManagerFactoryBuilderImpl.java:120) [hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:855) [hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:845) [hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
        at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398) [hibernate-core-4.3.7.Final.jar:4.3.7.Final]
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:844) [hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
        at org.jboss.as.jpa.hibernate4.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44) [jipijapa-hibernate4-3-1.0.1.Final.jar:]
        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154) [wildfly-jpa-8.2.0.Final.jar:8.2.0.Final]
        ... 8 more
  Caused by: org.hibernate.AnnotationException: Attribute [com.haslerrail.MyDatabase.server.db.entity.Widget.type] was annotated as enumerated, but its java type is not an enum [java.lang.String]
        at org.hibernate.cfg.annotations.SimpleValueBinder.setType(SimpleValueBinder.java:257) [hibernate-core-4.3.7.Final.jar:4.3.7.Final]
        at org.hibernate.cfg.annotations.PropertyBinder.makePropertyAndValue(PropertyBinder.java:195) [hibernate-core-4.3.7.Final.jar:4.3.7.Final]
        at org.hibernate.cfg.annotations.PropertyBinder.makePropertyValueAndBind(PropertyBinder.java:216) [hibernate-core-4.3.7.Final.jar:4.3.7.Final]
        at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:2241) [hibernate-core-4.3.7.Final.jar:4.3.7.Final]
        at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:963) [hibernate-core-4.3.7.Final.jar:4.3.7.Final]
        at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:796) [hibernate-core-4.3.7.Final.jar:4.3.7.Final]
        at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3845) [hibernate-core-4.3.7.Final.jar:4.3.7.Final]
        at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3799) [hibernate-core-4.3.7.Final.jar:4.3.7.Final]
        at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1412) [hibernate-core-4.3.7.Final.jar:4.3.7.Final]
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1846) [hibernate-core-4.3.7.Final.jar:4.3.7.Final]
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:852) [hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
        ... 13 more
  </code></pre>
  
  <p>I tried to find any documentation for hibernate and wildfly but the documentaion on <a href="https://docs.jboss.org/author/display/WFLY8/Hibernate" rel="nofollow">https://docs.jboss.org/author/display/WFLY8/Hibernate</a> is empty!!!!</p>
  
  <p>Does anyone have experience with migration from AS 7 to Wildfly and hibernate? What do I need to adjust?</p>