kirach/grails-glassfish

Problem with SLF4J

Closed this issue · 5 comments

When building the plugin, this is what I'm getting:

Error SLF4J: Class path contains multiple SLF4J bindings.
| Error SLF4J: Found binding in [jar:file:/Users/xx/.grails/ivy-cache/org.glassfish.main.extras/glassfish-embedded-all/jars/glassfish-embedded-all-3.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
| Error SLF4J: Found binding in [jar:file:/Users/xx/.grails/ivy-cache/org.grails/grails-plugin-log4j/jars/grails-plugin-log4j-2.0.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
| Error SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
| Error SLF4J: The requested version 1.5.10 by your slf4j binding is not compatible with [1.6]
| Error SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.

And then I'm getting this: Error Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.AbstractMethodError: org.slf4j.impl.JDK14LoggerAdapter.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V (Use --stacktrace to see the full trace)

The 1.6 version is included in glass fish, but grails or hibernate uses 1.5.10.

Any ideas on how to fix this? Have you experienced the same issue?

Hello! Yes, I have already faced this issue. The fast and the dirty hack - to delete this file from jar archive:

| Error SLF4J: Found binding in [jar:file:/Users/xx/.grails/ivy-cache/org.glassfish.main.extras/glassfish-embedded-all/jars/glassfish-embedded-all-3.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]

I haven't had much time to investigate what's wrong, but I'll try to fix it more gently.

Thanks for the solution, I'll try it out. I guess this plugin is extremely useful to many people and it would be nice to publish it to grails.org/plugins. Also until you find a clean solution to this problem, maybe you can include the modified glassfish jar in the lib folder, so it'll work out of the box :)

Anyway, thanks for your work and help.

Yep, I was going to publish it in central plugin repository, and now that fact, that this plugin is useful for anybody else (except me) will speed up this process:)

What about including modified flassfish jar: this library is in dependecies of plugin. And it is downloaded by grails for local ivy cache every time this plugin is installed. Of course, a can manually include it in libraries of plugins, but this is not good way - library weight > 100MB. I'll try solve this problem with SLF4J.

Finally, I've found way to get through this bug.

Excellent, many thanks. I'll test it out.