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

前端 未结 14 1025
醉酒成梦
醉酒成梦 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条回答
  •  没有蜡笔的小新
    2020-11-29 05:01

    Had the same problem, but I solved it using the hibernate5 official quick start available here https://github.com/wildfly/quickstart/tree/11.x/hibernate5

    Try the hibernate5 quick start, it should work.

    Have a look at the pom.xml, it contains

    
        
            org.hibernate.javax.persistence
            hibernate-jpa-2.1-api
            provided
        
    
        
        
        
        
            org.hibernate
            hibernate-validator
            provided
            
                
                    org.slf4j
                    slf4j-api
                
            
        
    
        
        
        
            org.hibernate
            hibernate-core
            provided
        
    

    Include that and it will work. I had to undeploy my app and restart wildfly.

    If you need to use another Hibernate version than the one provided in Wildfly, follow the official procedure to update the Hibernate version in Wildly, section Replacing the current Hibernate 5.x jars with a newer version.

提交回复
热议问题