NoSuchMethodError: org.jboss.logging.Logger.debugf

Solution 1:

hibernate-entitymanager brought in jboss-logging as a dependency, but it is not the most up-to-date version and does not have that method implemented. It looks like you do not need jboss-logging, so try excluding it:

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>5.0.1.Final</version>
    <exclusions>
        <exclusion>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Or if it turns out that you need jboss-logging for hibernate, then add a later version of jboss-logging as an additional dependency.

<dependency>
    <groupId>org.jboss.logging</groupId>
    <artifactId>jboss-logging</artifactId>
    <version>3.3.0.Final</version>
</dependency>

Solution 2:

I had a similar issue, I was able to fix it by creating a glassfish-web.xml file in the WEB-INF directory. The contents of the file are shown below:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
     <class-loader delegate="false"/>
</glassfish-web-app>

This ensures that glassfish does not load it's internal libraries, but libraries from your project.

Solution 3:

The method org.jboss.logging.Logger.debugf is only available in the jboss-logging version 3.3.0, if you have this dependency in your project also you have to check that your GlassFish server also have the same version. I had the same error message and I solved it replacing the jboss-logging.jar at the glassfish installation folder because this jar is a previous version and it does not have the needed method. For example, I have the jar in the following path:

C:\Program Files\glassfish-4.1.1\glassfish\modules\jboss-logging.jar

I deleted the old jar and I put the new jar with same name but with the version 3.3.0. Just restart the GlassFish server and it will take the new jar version and that's all.

Solution 4:

If you are using glassfish jersey then bean-validator comes as dependency and tomcat certainly try to load Logger class from there.

The bean-validator clas also contains Logger class in same package.

Exclude the jar should resolve the issue

<dependency>
            <groupId>org.glassfish.jersey.ext</groupId>
            <artifactId>jersey-spring3</artifactId>
            <version>2.24.1</version>
            <exclusions>
                <exclusion>
                    <artifactId>spring-aop</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>bean-validator</artifactId>
                    <groupId>org.glassfish.hk2.external</groupId>
                </exclusion>
            </exclusions>
        </dependency>

Solution 5:

This problem was caused by conflict in JBoss modules jars. Replacing the file jboss-logging with its latest version solved the problem for me. The file is in the folder modules\system\layers\base\org\jboss\logging\main

Also, you should replace the name of the jar in the file module.xml with the new jar name. The file is located in the same folder.