It seems that the jar is being excluded when I package the web app (no commons-logging in WEB-INF/lib). However, when I run my app via xsbt-web-plugin with container:start, commons-logging-1.0.4.jar is being loaded from somewhere...
The whole reason for my posting this is that I am receiving a NoClassDefFoundError at runtime:
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
org.apache.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:159)
org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:178)
com.rackspacecloud.client.cloudfiles.FilesClient$1.<init>(FilesClient.java:174)
com.rackspacecloud.client.cloudfiles.FilesClient.<init>(FilesClient.java:174)
com.rackspacecloud.client.cloudfiles.FilesClient.<init>(FilesClient.java:216)
...
java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
java.net.URLClassLoader$1.run(URLClassLoader.java:202)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:190)
sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
java.lang.ClassLoader.loadClass(ClassLoader.java:247)
org.apache.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:159)
org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:178)
com.rackspacecloud.client.cloudfiles.FilesClient$1.<init>(FilesClient.java:174)
com.rackspacecloud.client.cloudfiles.FilesClient.<init>(FilesClient.java:174)
com.rackspacecloud.client.cloudfiles.FilesClient.<init>(FilesClient.java:216)
My Project's Dependencies:
object Dependencies {
val liftVersion = "2.4-M5"
val jettyVersion = "7.4.5.v20110725"
val lift = Seq(
"net.liftweb" %% "lift-webkit" % liftVersion % "compile->default" withSources(),
"net.liftweb" %% "lift-mapper" % liftVersion % "compile->default" withSources(),
"net.liftweb" %% "lift-widgets" % liftVersion % "compile->default" withSources()
)
val jetty = "org.eclipse.jetty" % "jetty-webapp" % jettyVersion % "container"
val servlet = "javax.servlet" % "servlet-api" % "2.5" % "provided"
val scalate = "org.fusesource.scalate" % "scalate-core" % "1.5.3" % "compile"
val slf4j = "org.slf4j" % "slf4j-log4j12" % "1.6.4" % "compile"
val jcl_slf4j = "org.slf4j" % "jcl-over-slf4j" % "1.6.4" % "compile"
val commons_validator = "commons-validator" % "commons-validator" % "1.3.1" % "compile" exclude("commons-logging", "commons-logging")
val httpclient = "org.apache.httpcomponents" % "httpclient" % "4.1.2" % "compile" intransitive()
val httpcore = "org.apache.httpcomponents" % "httpcore" % "4.1.2" % "compile" intransitive()
val dispatch = Seq(
"net.databinder" %% "dispatch-http" % "0.8.7" % "compile" withSources() withJavadoc() intransitive(),
"net.databinder" %% "dispatch-core" % "0.8.7" % "compile" withSources() withJavadoc() intransitive(),
"net.databinder" %% "dispatch-futures" % "0.8.7" % "compile" withSources() withJavadoc() intransitive()
)
val quartz = "org.quartz-scheduler" % "quartz" % "2.1.2" % "compile" withSources()
val junit = "junit" % "junit" % "4.5" % "test->default"
val specs = "org.scala-tools.testing" %% "specs" % "1.6.9" % "test->default"
val postgres = "postgresql" % "postgresql" % "8.4-702.jdbc4" % "runtime->default"
val webapp = Seq(
jetty, servlet,
scalate,
slf4j, jclSlf4j,
commons_validator,
httpcore, httpclient,
quartz,
junit, specs,
postgres
) ++ lift ++ dispatch
}