Grails

Run-war has some classpath conflicts

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.2 final
  • Fix Version/s: 1.2 final, 1.2.3, 1.3 RC2
  • Component/s: None
  • Labels:
    None

Description

When I run-war a trivial application with 1 controller that outputs "hello", I see:

Running Grails application..
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/marc/.ivy2/cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/marc/.grails/1.2.0/projects/RunWarTest/war/WEB-INF/lib/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
Server running. Browse to http://localhost:8080/RunWarTest

Issue Links

Activity

Hide
fred carter added a comment -

For what it's worth, I'm seeing the same issue doing a simple run-app. I did NOT see it until I uninstalled the tomcat plugin & installed the jetty plugin. So the issue may be related to some inconsistency in how the dependencies on those plugins are defined.

Show
fred carter added a comment - For what it's worth, I'm seeing the same issue doing a simple run-app. I did NOT see it until I uninstalled the tomcat plugin & installed the jetty plugin. So the issue may be related to some inconsistency in how the dependencies on those plugins are defined.
Hide
Marc Palmer added a comment -

I also see info to state that the NOP logger is being used:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/marc/.ivy2/cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/marc/.grails/1.2.0/projects/WeceemApp/war/WEB-INF/lib/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
loading security config ...
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.

Which might explain why I see no log output with run-war

Show
Marc Palmer added a comment - I also see info to state that the NOP logger is being used: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/Users/marc/.ivy2/cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/Users/marc/.grails/1.2.0/projects/WeceemApp/war/WEB-INF/lib/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. loading security config ... log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository. Which might explain why I see no log output with run-war
Hide
Marc Palmer added a comment -

Yes Fred, it seems to me that the problem is generic - any plugins that inherit the global deps (as they have to to function correctly) - cause this problem when installed into an app.

Show
Marc Palmer added a comment - Yes Fred, it seems to me that the problem is generic - any plugins that inherit the global deps (as they have to to function correctly) - cause this problem when installed into an app.
Hide
Marc Palmer added a comment -

I've upgraded this to critical as logging is killed in apps using plugins that define deps that inherit "global" and I can't find a workaround yet. I'm trying to find a way to tweak the deps in the app but I'm scraping around.

Show
Marc Palmer added a comment - I've upgraded this to critical as logging is killed in apps using plugins that define deps that inherit "global" and I can't find a workaround yet. I'm trying to find a way to tweak the deps in the app but I'm scraping around.
Hide
Graeme Rocher added a comment -

This is not a global problem, but one with the Jetty plugin which has its transitive dependencies incorrectly defined. The problem doesn't occur for me with tomcat

Show
Graeme Rocher added a comment - This is not a global problem, but one with the Jetty plugin which has its transitive dependencies incorrectly defined. The problem doesn't occur for me with tomcat
Hide
Marc Palmer added a comment -

I beg to differ. We don't use Jetty. It happens on all our apps.

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/marc/.ivy2/cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/marc/.grails/1.2.0/projects/NoticeLocal/war/WEB-INF/lib/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
Jan 14, 2010 11:09:35 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
[snip]
Jan 14, 2010 11:10:08 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'grails'
Jan 14, 2010 11:10:08 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Server running. Browse to http://localhost:8080/noticelocal

Coyote all the way my friend.

Show
Marc Palmer added a comment - I beg to differ. We don't use Jetty. It happens on all our apps. SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/Users/marc/.ivy2/cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/Users/marc/.grails/1.2.0/projects/NoticeLocal/war/WEB-INF/lib/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. Jan 14, 2010 11:09:35 AM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext [snip] Jan 14, 2010 11:10:08 AM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'grails' Jan 14, 2010 11:10:08 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Server running. Browse to http://localhost:8080/noticelocal Coyote all the way my friend.
Hide
Graeme Rocher added a comment -

you'll need to provide an example that reproduces the problem then as it is almost certainly a problem with one your dependencies since it doesn't do it locally for me

Show
Graeme Rocher added a comment - you'll need to provide an example that reproduces the problem then as it is almost certainly a problem with one your dependencies since it doesn't do it locally for me
Hide
Graeme Rocher added a comment -

Scratch that i've found a project that reproduces it.. will look at the problem soon

Show
Graeme Rocher added a comment - Scratch that i've found a project that reproduces it.. will look at the problem soon
Hide
David Castro added a comment -

FYI, I've run into this same problem with the nimble plugin 0.4-SNAPSHOT

Show
David Castro added a comment - FYI, I've run into this same problem with the nimble plugin 0.4-SNAPSHOT

People

Vote (8)
Watch (10)

Dates

  • Created:
    Updated:
    Resolved: