tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Hödl" <C.Ho...@gmx.net>
Subject java.lang.ClassNotFoundException: org.apache.jasper.servlet.JspServlet when embedding tomcat 7.0.11
Date Thu, 07 Apr 2011 08:44:58 GMT
Hi,
  I'm trying to start Tomcat 7.0.11 from within an automated test.
  Unfortunately, when I call tomcat.start(), the following
  exception happens:

Servlet /abc/ threw load() exception
java.lang.ClassNotFoundException: org.apache.jasper.servlet.JspServlet
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
        at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
        at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
        at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1062)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1010)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4915)
        at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5242)
        at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5237)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

I am running the test with gradle. This is the runtime classpath, I
think all needed tomcat jars should be on the classpath (especially jasper):

classpath = D:\dev\workspace\gradle_test\test\build\classes\test;D:\dev\workspace\gradle_test\test\build\classes\main;D:
\dev\programs\gradle_cache\cache\org.apache.tomcat.embed\tomcat-embed-core\jars\tomcat-embed-core-7.0.11.jar;D:\dev\prog
rams\gradle_cache\cache\org.apache.tomcat.embed\tomcat-embed-logging-juli\jars\tomcat-embed-logging-juli-7.0.11.jar;D:\d
ev\programs\gradle_cache\cache\org.apache.tomcat.embed\tomcat-embed-jasper\jars\tomcat-embed-jasper-7.0.11.jar;D:\dev\pr
ograms\gradle_cache\cache\org.eclipse.jdt.core.compiler\ecj\jars\ecj-3.6.jar;D:\dev\programs\gradle_cache\cache\junit\ju
nit\jars\junit-4.8.2.jar;D:\dev\programs\gradle_cache\cache\org.spockframework\spock-core\jars\spock-core-0.5-groovy-1.7
.jar;D:\dev\programs\gradle_cache\cache\org.codehaus.groovy\groovy-all\jars\groovy-all-1.7.5.jar;D:\dev\programs\gradle_
cache\cache\junit\junit-dep\jars\junit-dep-4.8.2.jar;D:\dev\programs\gradle_cache\cache\org.hamcrest\hamcrest-core\jars\
hamcrest-core-1.2.jar;D:\dev\programs\gradle_cache\cache\org.scala-tools.testing\specs_2.8.1\jars\specs_2.8.1-1.6.7.2.ja
r;D:\dev\programs\gradle_cache\cache\org.scala-lang\scala-library\jars\scala-library-2.8.1.jar;D:\dev\programs\gradle_ca
che\cache\org.scala-lang\scala-compiler\jars\scala-compiler-2.8.1.jar;D:\dev\programs\gradle_cache\cache\org.scalatest\s
calatest\jars\scalatest-1.3.jar

This is the very simple test (in Scala):

import org.apache.catalina.startup.Tomcat
import java.io.File._
import org.specs._
import org.specs.runner._

class Main extends Specification with ScalaTest {

  "starting the tomcat" should {
        "work" in {
            val contextPath = "/abc/"
            val tomcat = new Tomcat()
            tomcat.setPort(httpPort)
            tomcat.addWebapp(contextPath, "D:\\dev\\workspace\\gradle_test\\build")      
 
            tomcat.start()
            tomcat.getServer().await()
        }
    }
    
}

Does anybody know, what could be the problem here?

Cheers,
  Christian
-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message