0

I am doing migration from JDev 12.1.3 to 12.2.0. Now there was some problem durnng compilation but it has been resolved by modifiying class path. Now when I go for deployment then it showing me one exception. That is ...

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

I am using following dependencies..

<dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.2.0.Final</version>
            <type>jar</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate.common</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
            <version>5.0.1.Final</version>
            <type>jar</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.1-api</artifactId>
            <version>1.0.0.Final</version>
            <type>jar</type>
            <scope>provided</scope>
        </dependency>

Apart from these dependencies I also looked into "C:\oracle_home12c\wlserver\modules" folder and found there was one "org.jboss.logging.jboss-logging.jar" file. I replaced the maven repo file from "jboss-logging-3.3.0.Final". I also looked into "jboss-logging-3.3.0.Final" jar file. There is one Logger class file but it does not contain the debugf(String) method.

Exception type;

Caused by: java.lang.NoSuchMethodError: org.jboss.logging.Logger.debugf(Ljava/lang/String;I)V
    at org.hibernate.internal.NamedQueryRepository.checkNamedQueries(NamedQueryRepository.java:149)
    at org.hibernate.internal.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:764)
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:495)
    at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:802)
    at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:135)
    at weblogic.persistence.BasePersistenceUnitInfo.initializeEntityManagerFactory(BasePersistenceUnitInfo.java:611)

Can someone help to get rid off this problem?

Thanks in advance

2 Answers 2

2

If you are using the glassfish server the the problem might be with the lib provided by glassfish. This error is caused by the use of incompatible version.

Just create 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.

Sign up to request clarification or add additional context in comments.

Comments

0

I don't know how JDev classloading works, but maybe it takes the a wrong version of jboss-logging which doesn't have the method? Try removing that from the modules dir. And make sure that your app bundles jboss-logging in the .war. It should be brought in by Hibernate's dependencies. If not, add it to the pom.xml.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.