wildfly 10: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory

前端 未结 14 987
醉酒成梦
醉酒成梦 2020-11-29 04:25

I have a maven application that works fine in wildfly 8.2, but when Ideployed it in wildfly 10 this error happened:

[2016-02-21 11:22:08,411] Artifact Sarama         


        
14条回答
  •  -上瘾入骨i
    2020-11-29 04:56

    I had the same problem but finally what I did is to remove (redundant) Hibernate libraries from pom.

    As Wildfly is already using Hibernate as JPA provider (https://docs.jboss.org/author/display/WFLY10/JPA+Reference+Guide#JPAReferenceGuide-Introduction), you do not need to provide such classes at all (unless you are directly using Hibernate classes).

    So the minimal config is working fine:

    
      
        
          javax
          javaee-api
          7.0
          provided
        
      
    
    

    And persistence.xml

    
    
        org.hibernate.jpa.HibernatePersistenceProvider
        java:/jdbc/MySqlDS
        
            
            
        
    
    

    Tested on Wildfly 10.

提交回复
热议问题