JARs included twice in classpath when running jetty from within SBT?

65 views
Skip to first unread message

harryh

unread,
Mar 4, 2010, 3:42:32 PM3/4/10
to simple-build-tool
Running into the following error which I think is SBT related:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/harryh/foursquare.web/
lib_managed/compile/slf4j-log4j12-1.5.11.jar!/org/slf4j/impl/
StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/harryh/foursquare.web/target/
webapp/WEB-INF/lib/slf4j-log4j12-1.5.11.jar!/org/slf4j/impl/
StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
explanation.

It looks like when SBT runs jetty all of my managed jars are double
included on the classpath? Is this actually what is happening?

-harryh

Mark Harrah

unread,
Mar 4, 2010, 4:52:02 PM3/4/10
to simple-b...@googlegroups.com
Hi Harry,

Unfortunately, yes. I pushed a fix, see [1] for instructions for building from
source. Sorry for the trouble and thanks for reporting the problem.

Issue details:

sbt switched over to using Jetty's WebAppClassLoader in 0.7 instead of a
custom class loader. Jetty apparently treats WebAppClassLoader instances
specially and the problem arises from one aspect of this special treatment
that I didn't know about. Jetty sees that the web application class loader is
a WebAppClassLoader and adds the WEB-INF/{lib, classes} directories to the
classpath in addition to the classpath sbt explicitly added.

-Mark

[1] http://code.google.com/p/simple-build-tool/wiki/Build

Reply all
Reply to author
Forward
0 new messages