If you are using Hibernate 5.+ and Glassfish 4.X or other earlier version , you will probably see this error. That’s happening because there is a conflict between Glassfish modules and your project dependency, more specifically the lib
It’s happening because the method
org.jboss.logging.Logger.debugf is only available in the jboss-logging version 3.3.0 or later and there is on the Glassfish 4.x module the jboss-logging older version.
Solution 1 – Move back to Hibernate 4
That’s not a great option, but I have to consider it.
Solution 2 – Move to Glassfish 5
The new version of the Glassfish already came with the later version of
Solution 3 – Trying to downgrade the
org.jboss.logging on the Hibernate 5
Some blogs and answers in stackoverflow explain this option. I don’t think it will work in all contexts. But don’t forget to do the same with all dependencies that use the
Solution 4 – Upgrade the
org.jboss.logging in everywhere!
org.jboss.logging in every place that it’s used, like other dependencies and even the Glassfish modules. Just make sure that the library in use is the later version, omitting the possible earling version being used. To upgrade, just do it:
You don’t have to do it, unless a earlier version is being used (not ommited). But, YOU HAVE to upgrade the Glassfish module in
glassfish-root-folder/glassfish/module/jboss-logging.jar, removing it to use only the one from your project or overwriting it with a later one (recommended!).