Hi.
I am trying to use an embedded tomcat servlet container (version 4.1.10) and experience

some problems when I try to load JSPs.
In my class "TomcatService" I create an instance of org.apache.catalina.startup.Embedded. On that I create an engine, a root context, a host and a connector and then register the "examples" webapp context in the following way:
URL url =
new URL("file:/apache/tomcat/jakarta-tomcat-4.1.10"
+ "/webapps/examples");
tomcat.registerWAR("/examples", url);

When I run "TomcatService" and access the URL "http://localhost:8080/examples"

everything looks good, meaning I get the standard directory listing page with the links to images, jsp and servlets. I follow the link to jsp and get the page with all the links to the jsp examples. The trouble starts when I now follow any of the links i.e.

execute date. Then I get the following exception:

Error compiling file:

D:\apache\tomcat\jakarta-tomcat-4.1.10\work\_\localhost\examples\jsp\dates\/date_jsp.java [javac] Compiling 1 source file

StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP
at

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:477)
at

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:182)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain

.java:247)
at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:19

3)
at

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Stand

ardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Stand

ardPipeline.java:643)
at

org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Stand

ardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2397)
at

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Stand

ardPipeline.java:643)
at

org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Stand

ardPipeline.java:641)
at

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Stand

ardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Stand

ardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
at

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http1

1Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
at

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:536)
----- Root Cause -----
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null

Generated servlet error:
[javac] Compiling 1 source file


at

org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:120)
at

org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:315)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:326)
at

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
at

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:182)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain

.java:247)
at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:19

3)
at

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Stand

ardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Stand

ardPipeline.java:643)
at

org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Stand

ardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2397)
at

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Stand

ardPipeline.java:643)
at

org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Stand

ardPipeline.java:641)
at

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Stand

ardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Stand

ardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
at

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http1

1Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
at

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:536)


Anybody there who has experience with embedded tomcat and experienced similar problems? Any help would be appreciated :-)

Thanks