Hibernate 5 java.lang.NoSuchMethodError org.jboss.logging.Logger.debugf

后端 未结 15 1941
天涯浪人
天涯浪人 2020-12-01 09:21

I have a problem when I deploy a webapp with hibernate 5

Caused by: java.lang.NoSuchMethodError: org.jboss.logging.Logger.debugf(Ljava/lang/String;I)V
at org         


        
15条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 09:51

    In my case the culprit was the Jersey bean validator artifact. One of its dependencies, bean-validation-2.4.0-b06.jar contains Jboss logging classes, for some reason. I had to exclude the jersey-bean-validation and bean-validator artifacts from the spring-boot-starter-jersey dependency:

    
            org.springframework.boot
            spring-boot-starter-jersey
            
                
                    jersey-bean-validation
                    org.glassfish.jersey.ext
                
                
                    bean-validator
                    org.glassfish.hk2.external
                
            
        
    

    EDIT: As of spring-boot 1.3.0, this is fixed and the exclusions above are not necessary anymore.

提交回复
热议问题