Question

I have a problem at deploying a lift application on a Tomcat Server. At server start the log shows an error:

INFO: Deploying web application archive lift.war
Nov 08, 2013 5:47:18 PM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Nov 08, 2013 5:47:18 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/lift] startup failed due to previous errors

The error occurs on either Tomcat 6 and 7 with lift Version 2.6 with scala 2.10.3 on Tomcat 7

Thanks in advance!

EDIT: Here's the stack trace from Tomcat:

SCHWERWIEGEND: Exception starting filter LiftFilter
java.lang.NoSuchMethodError: scala.Predef$.Map()Lscala/collection/immutable/Map$;
at net.liftweb.common.BoxTrait$class.$init$(Box.scala:62)
at net.liftweb.common.Box$.<init>(Box.scala:49)
at net.liftweb.common.Box$.<clinit>(Box.scala)
at net.liftweb.util.Props$.mode$lzycompute(Props.scala:112)
at net.liftweb.util.Props$.mode(Props.scala:110)
at net.liftweb.util.Props$.devMode$lzycompute(Props.scala:204)
at net.liftweb.util.Props$.devMode(Props.scala:204)
at net.liftweb.http.LiftRules$.<init>(LiftRules.scala:79)
at net.liftweb.http.LiftRules$.<clinit>(LiftRules.scala)
at net.liftweb.http.provider.servlet.ServletFilterProvider$class.init(ServletFilterProvider.scala:38)
at net.liftweb.http.LiftFilter.init(LiftServlet.scala:928)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4649)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5305)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

EDIT: Here is my build.sbt:

name := "lift_project"

version := "0.0.1"

organization := "net.liftweb"

scalaVersion := "2.10.3"

resolvers ++= Seq("snapshots"     at "http://oss.sonatype.org/content/repositories/snapshots",
              "staging"       at "http://oss.sonatype.org/content/repositories/staging",
              "releases"      at "http://oss.sonatype.org/content/repositories/releases"
             )

seq(com.github.siasia.WebPlugin.webSettings :_*)

unmanagedBase <<= baseDirectory { base => base / "lib" }

unmanagedJars in Compile <<= baseDirectory map { base => (base ** "*.jar").classpath }

unmanagedResourceDirectories in Test <+= (baseDirectory) { _ / "src/main/webapp" }

scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature", "-language:implicitConversions", "-language:postfixOps")

libraryDependencies ++= {
  val liftVersion = "2.6-M1"
  Seq(
    "net.liftweb"       %% "lift-webkit"        % liftVersion        % "compile",
    "net.liftweb"       %% "lift-mapper"        % liftVersion        % "compile",
    "net.liftweb"       %% "lift-ldap"        % liftVersion        % "compile",
    "org.eclipse.jetty" % "jetty-webapp"        % "8.1.7.v20120910"  % "container,test",
    "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "container,test" artifacts Artifact("javax.servlet", "jar", "jar"),
    "ch.qos.logback"    % "logback-classic"     % "1.0.6",
    "com.h2database"    % "h2"                  % "1.3.167",
    "mysql"             % "mysql-connector-java" % "5.1.25",
    "javax.servlet" % "servlet-api" % "2.5" % "provided->default"
  )
}

net.virtualvoid.sbt.graph.Plugin.graphSettings

EDIT: And the content of the lib folder:

activation-1.1.jar
commons-codec-1.6.jar
commons-fileupload-1.2.2.jar
h2-1.3.167.jar
htmlparser-1.4.jar
iText-2.1.5.jar
jcommon-1.0.18.jar
jfreechart-1.0.15.jar
jfreechart-1.0.15-demo.jar
jfreechart-1.0.15-experimental.jar
jfreechart-1.0.15-swt.jar
joda-convert-1.2.jar
joda-time-2.1.jar
junit.jar
lift-actor_2.10-2.6-M1.jar
lift-common_2.10-2.6-M1.jar
lift-db_2.10-2.6-M1.jar
lift-json_2.10-2.6-M1.jar
lift-ldap_2.10-2.6-M1.jar
lift-mapper_2.10-2.6-M1.jar
lift-markdown_2.10-2.6-M1.jar
lift-proto_2.10-2.6-M1.jar
lift-util_2.10-2.6-M1.jar
lift-webkit_2.10-2.6-M1.jar
logback-classic-1.0.6.jar
logback-core-1.0.6.jar
mail-1.4.4.jar
mysql-connector-java-5.1.25.jar
paranamer-2.4.1.jar
sbt-launch.jar
scala-compiler.jar
scala-library.jar
scalap-2.10.0.jar
scala-reflect-2.10.3.jar
slf4j-api-1.7.2.jar
swtgraphics2d.jar
Was it helpful?

Solution 3

After using some try&error methods I finally identified the jar causing trouble:

sbt-launch.jar

After removing this from the lib folder everything works fine on Tomcat (and Jetty as well)

OTHER TIPS

Ok. I guess the problem lies here:

unmanagedJars in Compile <<= baseDirectory map { base => (base ** "*.jar").classpath }

This simply adds every jar under your project to the WAR. I don't know which SBT version you're using but IIRC older versions of SBT put scala-library.jar in their build path under your project root (baseDirectory), which, in your case, gets included during the build process, resulting in a jar conflict.

Try removing the suspected line or change 'baseDirectory' to something more specific like 'unmanagedBase'.

scala-library.jar does look suspicious, as we cannot tell the version from the file name. Maybe it is an old standard library, for which your lift version is not working.

Try

unzip -p scala-library.jar META-INF/MANIFEST.MF

to see the version, you need it to be 2.10.0 or newer.

I agree with harp seal pup that the problem is probably caused by your copying of the unmanaged jars. Try not to use unmanaged jars (remove the line, let sbt manage the dependencies).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top