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

后端 未结 15 1827
天涯浪人
天涯浪人 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:24

    Try upgrading jboss-logging.jar to a more recent version. The one you are using does not seem to be compatible with Hibernate 5.

    0 讨论(0)
  • 2020-12-01 09:24

    You can use Eclipse to find out which jar is causing the problem:

    • Setup a project with all your jars on the classpath
    • Navigate -> Open Type...
    • Type in org.jboss.logging.Logger

    This will give you a list of jars which include the class. One of these is out of date and needs to be excluded (refer to other answers for variations on this).

    0 讨论(0)
  • 2020-12-01 09:28

    JBoss 6.1+??

    I set org.jboss.logging for jboss-logging-3.3.0.Final-redhat-1.jar in modules of jboss.

    Its works for me.

    Att.,

    0 讨论(0)
  • 2020-12-01 09:30

    I had the same error, it is solved by First add the dependency of jboss logging jar as follows

    <!-- https://mvnrepository.com/artifact/org.jboss.logging/jboss-logging -->
    <dependency>
        <groupId>org.jboss.logging</groupId>
        <artifactId>jboss-logging</artifactId>
        <version>3.3.0.Final</version>
    </dependency>
    

    And if the error still exists then add following exlcusion to the maven dependency.

    <dependency>
        <groupId>org.glassfish.jersey.ext</groupId>
        <artifactId>jersey-spring3</artifactId>
        <version>2.12</version>
         <exclusions>
                <exclusion>
                        <groupId>org.glassfish.hk2</groupId>
                        <artifactId>hk2</artifactId>
                </exclusion>
            </exclusions>
    </dependency>
    

    After doing these two things, it is working fine for me.I hope it will work for you also.

    0 讨论(0)
  • 2020-12-01 09:36

    I was getting the same error using jersey-spring-3 and hibernate 5.0.1.Final.Excluding org.glassfish.hk2.external:bean-validator from jersy-spring-3 and adding org.glassfish.jersey.ext:jersey-bean-validation worked for me.Here is my final dependency.

    <dependency>
        <groupId>org.glassfish.jersey.ext</groupId>
        <artifactId>jersey-spring3</artifactId>
        <version>2.22.2</version>
        <exclusions>
            <exclusion>
                <groupId>org.glassfish.hk2.external</groupId>
                <artifactId>bean-validator</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.ext</groupId>
        <artifactId>jersey-bean-validation</artifactId>
        <version>2.22.2</version>
    </dependency>
    

    from :

    <dependency>
        <groupId>org.glassfish.jersey.ext</groupId>
        <artifactId>jersey-spring3</artifactId>
        <version>2.22.2</version>
    </dependency>
    
    0 讨论(0)
  • 2020-12-01 09:36

    I too faced this issue. This is what fixed it for me

           <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>4.2.1.RELEASE</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
    
    0 讨论(0)
提交回复
热议问题