java.lang.NoSuchMethodError: org.hibernate.internal.CoreMessageLogger.debugf(Ljava/lang/String;I)V

前端 未结 3 811
鱼传尺愫
鱼传尺愫 2021-01-17 18:00

I have one simple @Singleton whitin Java EE project that parses data from internet and saves it with Hibernate to PostgreSQL.

@Startup
@Singleton         


        
相关标签:
3条回答
  • 2021-01-17 18:41

    I solved this problem by deleting jboss-logging jar file from project's lib folder and replacing jboss-logging.jar from glassfish\modules folder to last version from http://mvnrepository.com/artifact/org.jboss.logging/jboss-logging/3.3.0.Final

    0 讨论(0)
  • 2021-01-17 18:49

    The silver bullet for fixing all these maddening version compatibility issues, is to use the Spring IO Platform

    http://platform.spring.io/platform/

    which does dependency management for everything in Spring via Maven or Gradle.

    (After this you do not have to tear your hair and worry about arcane version issues that the typical developer has to keep track of and suffer through every few months when updating or adding projects).

    Also Note: You also need to make sure that all your modules (in a multi-module project) share same version numbers. It sounds obvious but one can forget this when adding modules.

    0 讨论(0)
  • 2021-01-17 18:51

    It seems like there's a version mismatch between the logging libs included in the application server and the logging libs required by Hibernate.

    I had the same problem and my configuration was: Jboss AS 7.1.1.Final and Hibernate 5.1.0 and I solved excluding the jboss logging module in the jboss-deployment-structure.xml

        <jboss-deployment-structure>
            <deployment>
                <!-- ADDED -->
                <exclusions>
                    <module name="org.hibernate" /> <!-- Escludo l'Hibernate integrato in jboss e uso quello interno -->
                    <module name="org.jboss.logging" /> <!-- Escludo li logger integrato in jboss -->
                </exclusions>
                <!-- FINE ADDED -->
                <dependencies>
                </dependencies>
            </deployment>
        </jboss-deployment-structure>
    
    0 讨论(0)
提交回复
热议问题