Hibernate 5 + Glassfish 4.1.1: java.lang.NoSuchMethodError: org.jboss.logging.Logger.debugf (Ljava / lang / String; I) V

When I add Hibernate 5 to my site, I cannot get it to work in Glassfish 4.1.1. I always get an error

java.lang.NoSuchMethodError: org.jboss.logging.Logger.debugf (Ljava / languages ​​/ String; I), B

I tried to replace the jboss-logging library in the Glassfish modules folder, as I read in response to a similar problem, but didn't change anything. I also tried using Hibernate 4, but this gave a different error.

+4
source share
3 answers

osgi-cache Glassfish . Payara github: https://github.com/payara/Payara/issues/554 (Payara - Glassfish , , Glassfish)

+2

Hibernate 5 JPA tomcat , 4.1

:

hibernate.properties

, src/main/resources/hibernate.cfg.xml

hibernate-core, hibernate-annotations hibernate-common-annotations, . Hibernate 5 , - . ;)

:

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

jboss-logging.jar: "YOUR_GLASSFISH_FOLDER/GlassFish/"

? 5 jboss-logging, 4 , POM . :

org.jboss.logging jboss-logging 3.3.0.Final

.jar , 2 , , , = D

, : https://medium.com/@mertcal/using-hibernate-5-on-payara-cc242212a5d6#.npq2hdprz

, , Hibernate 4 (4.3.11.Final), , ,

+4

, , glassfish-web.xml WEB-INF. :

<?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 glass fish does not load its internal libraries, but libraries from your project.

+3
source

Source: https://habr.com/ru/post/1624453/


All Articles