Glassfish4 + Hibernate = Jboss Logger Error

This is just a self-note.

In the last hour, I fought with this exception:

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

To solve this, create a file glassfish-web.xml inside WebContent/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>```

That’s all. Thanks for the attention.