Bug 12387

Summary: JSP Compilation errors: jars in WEB-INF/lib and classes in WEB-INF/classes not in classpath
Product: Tomcat 4 Reporter: Rainer Langbehn <rainer.langbehn.rl>
Component: Jasper 2Assignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: major CC: clucas, irwanc, jfoster, jorge, kdekooter, klaus.basan, lri, marcl, roytmana, scott, sebastian.schuette.ss
Priority: P3    
Version: 4.1.12   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Temporary resolves the bug. New JspRuntimeContext.class / .java (jasper-compiler.jar)
Patched Compiler.java source
Fixed Compiler.class
New EmbeddedServletOptions to fix NPE
New ESO source
Updated JasperAntLogger
Updated jasper-compiler.jar

Description Rainer Langbehn 2002-09-07 09:37:09 UTC
It seems that classes in WEB-INF/classes and jars in WEB-INF/lib are not added 
to the classpath during compilation of JSPs. This happens after a fresh 
installation and for all webapps which uses JSPs (e.g. examples, admin and my 
own webapps). The problem persists, even after a reboot.

This worked with Tomcat 4.1.7 Beta.

Uninstalled previous Tomcat installation (Tomcat 4.1.7 Beta).
Reboot after installation.
Default configuration unchanged.
Same problem with both installation types:
  - jakarta-tomcat-4.1.10
  - jakarta-tomcat-4.1.10-LE-jdk14

admin webapp: exception from localhost_admin_log ...
2002-09-07 10:10:23 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:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:260)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke
(AuthenticatorBase.java:527)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:171)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.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.processConnectio
n(Http11Protocol.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: 75 in the jsp file: /login.jsp

Generated servlet error:
    [javac] Compiling 1 source file
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:69: 
package org.apache.struts.taglib.html does not exist
      org.apache.struts.taglib.html.HtmlTag _jspx_th_html_html_0 = 
(org.apache.struts.taglib.html.HtmlTag) _jspx_tagPool_html_html_locale.get
(org.apache.struts.taglib.html.HtmlTag.class);
                                   ^



An error occurred at line: 75 in the jsp file: /login.jsp

Generated servlet error:
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:69: 
package org.apache.struts.taglib.html does not exist
      org.apache.struts.taglib.html.HtmlTag _jspx_th_html_html_0 = 
(org.apache.struts.taglib.html.HtmlTag) _jspx_tagPool_html_html_locale.get
(org.apache.struts.taglib.html.HtmlTag.class);
                                                                                
                 ^



An error occurred at line: 75 in the jsp file: /login.jsp

Generated servlet error:
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:69: 
package org.apache.struts.taglib.html does not exist
      org.apache.struts.taglib.html.HtmlTag _jspx_th_html_html_0 = 
(org.apache.struts.taglib.html.HtmlTag) _jspx_tagPool_html_html_locale.get
(org.apache.struts.taglib.html.HtmlTag.class);
                                                                                
                                                                                
           ^



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

Generated servlet error:
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:198: 
package org.apache.struts.taglib.bean does not exist
    org.apache.struts.taglib.bean.MessageTag _jspx_th_bean_message_0 = 
(org.apache.struts.taglib.bean.MessageTag) _jspx_tagPool_bean_message_key.get
(org.apache.struts.taglib.bean.MessageTag.class);
                                 ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:198: 
package org.apache.struts.taglib.bean does not exist
    org.apache.struts.taglib.bean.MessageTag _jspx_th_bean_message_0 = 
(org.apache.struts.taglib.bean.MessageTag) _jspx_tagPool_bean_message_key.get
(org.apache.struts.taglib.bean.MessageTag.class);
                                                                                
                     ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:198: 
package org.apache.struts.taglib.bean does not exist
    org.apache.struts.taglib.bean.MessageTag _jspx_th_bean_message_0 = 
(org.apache.struts.taglib.bean.MessageTag) _jspx_tagPool_bean_message_key.get
(org.apache.struts.taglib.bean.MessageTag.class);
                                                                                
                                                                                
                  ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:213: 
package org.apache.struts.taglib.html does not exist
    org.apache.struts.taglib.html.BaseTag _jspx_th_html_base_0 = 
(org.apache.struts.taglib.html.BaseTag) _jspx_tagPool_html_base.get
(org.apache.struts.taglib.html.BaseTag.class);
                                 ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:213: 
package org.apache.struts.taglib.html does not exist
    org.apache.struts.taglib.html.BaseTag _jspx_th_html_base_0 = 
(org.apache.struts.taglib.html.BaseTag) _jspx_tagPool_html_base.get
(org.apache.struts.taglib.html.BaseTag.class);
                                                                                
               ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:213: 
package org.apache.struts.taglib.html does not exist
    org.apache.struts.taglib.html.BaseTag _jspx_th_html_base_0 = 
(org.apache.struts.taglib.html.BaseTag) _jspx_tagPool_html_base.get
(org.apache.struts.taglib.html.BaseTag.class);
                                                                                
                                                                                
  ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:227: 
package org.apache.struts.taglib.bean does not exist
    org.apache.struts.taglib.bean.MessageTag _jspx_th_bean_message_1 = 
(org.apache.struts.taglib.bean.MessageTag) _jspx_tagPool_bean_message_key.get
(org.apache.struts.taglib.bean.MessageTag.class);
                                 ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:227: 
package org.apache.struts.taglib.bean does not exist
    org.apache.struts.taglib.bean.MessageTag _jspx_th_bean_message_1 = 
(org.apache.struts.taglib.bean.MessageTag) _jspx_tagPool_bean_message_key.get
(org.apache.struts.taglib.bean.MessageTag.class);
                                                                                
                     ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:227: 
package org.apache.struts.taglib.bean does not exist
    org.apache.struts.taglib.bean.MessageTag _jspx_th_bean_message_1 = 
(org.apache.struts.taglib.bean.MessageTag) _jspx_tagPool_bean_message_key.get
(org.apache.struts.taglib.bean.MessageTag.class);
                                                                                
                                                                                
                  ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:242: 
package org.apache.struts.taglib.bean does not exist
    org.apache.struts.taglib.bean.MessageTag _jspx_th_bean_message_2 = 
(org.apache.struts.taglib.bean.MessageTag) _jspx_tagPool_bean_message_key.get
(org.apache.struts.taglib.bean.MessageTag.class);
                                 ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:242: 
package org.apache.struts.taglib.bean does not exist
    org.apache.struts.taglib.bean.MessageTag _jspx_th_bean_message_2 = 
(org.apache.struts.taglib.bean.MessageTag) _jspx_tagPool_bean_message_key.get
(org.apache.struts.taglib.bean.MessageTag.class);
                                                                                
                     ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:242: 
package org.apache.struts.taglib.bean does not exist
    org.apache.struts.taglib.bean.MessageTag _jspx_th_bean_message_2 = 
(org.apache.struts.taglib.bean.MessageTag) _jspx_tagPool_bean_message_key.get
(org.apache.struts.taglib.bean.MessageTag.class);
                                                                                
                                                                                
                  ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:257: 
package org.apache.struts.taglib.bean does not exist
    org.apache.struts.taglib.bean.MessageTag _jspx_th_bean_message_3 = 
(org.apache.struts.taglib.bean.MessageTag) _jspx_tagPool_bean_message_key.get
(org.apache.struts.taglib.bean.MessageTag.class);
                                 ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:257: 
package org.apache.struts.taglib.bean does not exist
    org.apache.struts.taglib.bean.MessageTag _jspx_th_bean_message_3 = 
(org.apache.struts.taglib.bean.MessageTag) _jspx_tagPool_bean_message_key.get
(org.apache.struts.taglib.bean.MessageTag.class);
                                                                                
                     ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:257: 
package org.apache.struts.taglib.bean does not exist
    org.apache.struts.taglib.bean.MessageTag _jspx_th_bean_message_3 = 
(org.apache.struts.taglib.bean.MessageTag) _jspx_tagPool_bean_message_key.get
(org.apache.struts.taglib.bean.MessageTag.class);
                                                                                
                                                                                
                  ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:272: 
package org.apache.struts.taglib.bean does not exist
    org.apache.struts.taglib.bean.MessageTag _jspx_th_bean_message_4 = 
(org.apache.struts.taglib.bean.MessageTag) _jspx_tagPool_bean_message_key.get
(org.apache.struts.taglib.bean.MessageTag.class);
                                 ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:272: 
package org.apache.struts.taglib.bean does not exist
    org.apache.struts.taglib.bean.MessageTag _jspx_th_bean_message_4 = 
(org.apache.struts.taglib.bean.MessageTag) _jspx_tagPool_bean_message_key.get
(org.apache.struts.taglib.bean.MessageTag.class);
                                                                                
                     ^
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:272: 
package org.apache.struts.taglib.bean does not exist
    org.apache.struts.taglib.bean.MessageTag _jspx_th_bean_message_4 = 
(org.apache.struts.taglib.bean.MessageTag) _jspx_tagPool_bean_message_key.get
(org.apache.struts.taglib.bean.MessageTag.class);
                                                                                
                                                                                
                  ^
21 errors


	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:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:260)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke
(AuthenticatorBase.java:527)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:171)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.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.processConnectio
n(Http11Protocol.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)

examples webapp: exception from localhost_examples_log ...

2002-09-07 11:19:31 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:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:260)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke
(AuthenticatorBase.java:471)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:171)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.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.processConnectio
n(Http11Protocol.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: 11 in the jsp file: /jsp/num/numguess.jsp

Generated servlet error:
    [javac] Compiling 1 source file
D:\Apache Group\Tomcat 4.1
\work\Standalone\localhost\examples\jsp\num\numguess_jsp.java:7: package num 
does not exist
import num.NumberGuessBean;
           ^
D:\Apache Group\Tomcat 4.1
\work\Standalone\localhost\examples\jsp\num\numguess_jsp.java:44: package num 
does not exist
      num.NumberGuessBean numguess = null;
         ^



An error occurred at line: 11 in the jsp file: /jsp/num/numguess.jsp

Generated servlet error:
D:\Apache Group\Tomcat 4.1
\work\Standalone\localhost\examples\jsp\num\numguess_jsp.java:46: package num 
does not exist
        numguess = (num.NumberGuessBean) pageContext.getAttribute("numguess", 
PageContext.SESSION_SCOPE);
                       ^



An error occurred at line: 11 in the jsp file: /jsp/num/numguess.jsp

Generated servlet error:
D:\Apache Group\Tomcat 4.1
\work\Standalone\localhost\examples\jsp\num\numguess_jsp.java:49: package num 
does not exist
            numguess = (num.NumberGuessBean) java.beans.Beans.instantiate
(this.getClass().getClassLoader(), "num.NumberGuessBean");
                           ^
4 errors


	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:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:260)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke
(AuthenticatorBase.java:471)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:171)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.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.processConnectio
n(Http11Protocol.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)
Comment 1 Rainer Langbehn 2002-09-07 11:44:13 UTC
After changing the logVerbosityLevel of the JspServlet to DEBUG and execution 
of the admin webapp, the problem comes a bit more clearer:
WEB-INF/classes and WEB-INF/lib are dropped from the classpath

- Installation path: D:\Apache Group\Tomcat 4.1
- CATALINA_HOME: D:\Apache Group\Tomcat 4.1

admin webapp: exception from localhost_admin_log ...
----- Root Cause -----
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 75 in the jsp file: /login.jsp

Generated servlet error:
Detected Java version: 1.4 in: E:\Java\j2sdk1.4.0\jre
Detected OS: Windows NT
    [javac] login_jsp.java added as D:\Apache Group\Tomcat 4.1
\work\Standalone\localhost\admin\login_jsp.class doesn't exist.
    [javac] Compiling 1 source file
    [javac] Using modern compiler
dropping C:\D from path as it doesn't exist
dropping C:\Apache Group\Tomcat 4.1\server\webapps\admin\WEB-INF\classes from 
path as it doesn't exist
dropping C:\Apache Group\Tomcat 4.1\server\webapps\admin\WEB-INF\lib\struts.jar 
from path as it doesn't exist
    [javac] Compilation arguments:
    [javac] '-classpath'
    [javac] 'D:\Apache Group\Tomcat 4.1\bin\bootstrap.jar;D:\Apache 
Group\Tomcat 4.1\server\classes;D:\Apache Group\Tomcat 4.1\server\lib\catalina-
ant.jar;D:\Apache Group\Tomcat 4.1\server\lib\catalina.jar;D:\Apache 
Group\Tomcat 4.1\server\lib\commons-beanutils.jar;D:\Apache Group\Tomcat 4.1
\server\lib\commons-digester.jar;D:\Apache Group\Tomcat 4.1\server\lib\commons-
logging.jar;D:\Apache Group\Tomcat 4.1\server\lib\commons-modeler.jar;D:\Apache 
Group\Tomcat 4.1\server\lib\jakarta-regexp-1.2.jar;D:\Apache Group\Tomcat 4.1
\server\lib\mx4j-jmx.jar;D:\Apache Group\Tomcat 4.1\server\lib\servlets-
common.jar;D:\Apache Group\Tomcat 4.1\server\lib\servlets-default.jar;D:\Apache 
Group\Tomcat 4.1\server\lib\servlets-invoker.jar;D:\Apache Group\Tomcat 4.1
\server\lib\servlets-manager.jar;D:\Apache Group\Tomcat 4.1\server\lib\servlets-
webdav.jar;D:\Apache Group\Tomcat 4.1\server\lib\tomcat-coyote.jar;D:\Apache 
Group\Tomcat 4.1\server\lib\tomcat-http11.jar;D:\Apache Group\Tomcat 4.1
\server\lib\tomcat-jk.jar;D:\Apache Group\Tomcat 4.1\server\lib\tomcat-
jk2.jar;D:\Apache Group\Tomcat 4.1\server\lib\tomcat-util.jar;D:\Apache 
Group\Tomcat 4.1\server\lib\tomcat-warp.jar;D:\Apache Group\Tomcat 4.1
\common\classes;D:\Apache Group\Tomcat 4.1\common\lib\ant.jar;D:\Apache 
Group\Tomcat 4.1\common\lib\commons-collections.jar;D:\Apache Group\Tomcat 4.1
\common\lib\commons-logging-api.jar;D:\Apache Group\Tomcat 4.1
\common\lib\jasper-compiler.jar;D:\Apache Group\Tomcat 4.1\common\lib\jasper-
runtime.jar;D:\Apache Group\Tomcat 4.1\common\lib\naming-common.jar;D:\Apache 
Group\Tomcat 4.1\common\lib\naming-factory.jar;D:\Apache Group\Tomcat 4.1
\common\lib\naming-resources.jar;D:\Apache Group\Tomcat 4.1
\common\lib\servlet.jar;D:\Apache Group\Tomcat 4.1\common\lib\tools.jar'
    [javac] '-sourcepath'
    [javac] 'D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin'
    [javac] '-encoding'
    [javac] 'UTF8'
    [javac] '-g'
    [javac] 
    [javac] The ' characters around the executable and arguments are
    [javac] not part of the command.
    [javac] File to be compiled:
    [javac]     D:\Apache Group\Tomcat 4.1
\work\Standalone\localhost\admin\login_jsp.java
D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\admin\login_jsp.java:69: 
package org.apache.struts.taglib.html does not exist
      org.apache.struts.taglib.html.HtmlTag _jspx_th_html_html_0 = 
(org.apache.struts.taglib.html.HtmlTag) _jspx_tagPool_html_html_locale.get
(org.apache.struts.taglib.html.HtmlTag.class);
                                   ^
Comment 2 Remy Maucherat 2002-09-07 16:13:50 UTC
*** Bug 12385 has been marked as a duplicate of this bug. ***
Comment 3 Remy Maucherat 2002-09-07 17:50:49 UTC
I have 4.1.10 running on XP, installed from the .exe distribution (and running
as a service), and it works fine. I need you to explain me how to reproduce this
bug.
Comment 4 Scott Ahten 2002-09-07 23:50:29 UTC
i'm running into the same problem. Installed from the exe as well. 

Installed 4.1.10 on a fresh install of W2kServer SP2.
Destinataion d:\apache\tomcat41x 
Checked install NT service option. 

When launching Tomcat from "Start>Program Files>Apache Tomcat 1.1>Start 
Tomcat", Tomcat has no problem compiling the admin or example JSPs. 

When starting as a serivce, I get the same error. 
Comment 5 Serg Maslyukov (http://webmill.riverock.org) 2002-09-08 12:14:17 UTC
JDK1.4.0_01
w2kserver_sp2

Generated servlet error:
Detected Java version: 1.4 in: c:\jdk1.4\jre
Detected OS: Windows 2000
    [javac] index_jsp.java added as C:\opt\Tomcat 4.1
\work\Standalone\me.askmore\_\index_jsp.class doesn't exist.
    [javac] Compiling 1 source file
    [javac] Using modern compiler
dropping C:\D from path as it doesn't exist
dropping C:\opt2\_me.askmore.info\data\WEB-INF\classes from path as it doesn't 
exist
dropping C:\opt2\_me.askmore.info\data\WEB-INF\lib\activation.jar from path as 
it doesn't exist
dropping C:\opt2\_me.askmore.info\data\WEB-INF\lib\castor-0.9.3.21.jar from 
path as it doesn't exist
dropping C:\opt2\_me.askmore.info\data\WEB-INF\lib\cos_servlet2.3.jar from path 
as it doesn't exist
dropping C:\opt2\_me.askmore.info\data\WEB-INF\lib\log4j-1.2.6.jar from path as 
it doesn't exist
dropping C:\opt2\_me.askmore.info\data\WEB-INF\lib\mail.jar from path as it 
doesn't exist
dropping C:\opt2\_me.askmore.info\data\WEB-INF\lib\mill_loc.jar from path as it 
doesn't exist
dropping C:\opt2\_me.askmore.info\data\WEB-INF\lib\millengine-v2.jar from path 
as it doesn't exist
dropping C:\opt2\_me.askmore.info\data\WEB-INF\lib\ojdbc14.jar from path as it 
doesn't exist
    [javac] Compilation arguments:
    [javac] '-classpath'
    [javac] 'C:\opt\Tomcat 4.1\bin\bootstrap.jar;C:\opt\Tomcat 4.1
\shared\classes;C:\opt\Tomcat 4.1\common\classes;C:\opt\Tomcat 4.1
\common\lib\jasper-runtime.jar;C:\opt\Tomcat 4.1\common\lib\jasper-
compiler.jar;C:\opt\Tomcat 4.1\common\lib\commons-collections.jar;C:\opt\Tomcat 
4.1\common\lib\naming-resources.jar;C:\opt\Tomcat 4.1\common\lib\naming-
common.jar;C:\opt\Tomcat 4.1\common\lib\commons-logging-api.jar;C:\opt\Tomcat 
4.1\common\lib\ant.jar;C:\opt\Tomcat 4.1\common\lib\servlet.jar;C:\opt\Tomcat 
4.1\common\lib\naming-factory.jar;C:\opt\Tomcat 4.1\common\lib\tools.jar'
    [javac] '-sourcepath'
    [javac] 'C:\opt\Tomcat 4.1\work\Standalone\me.askmore\_'
    [javac] '-encoding'
    [javac] 'UTF8'
    [javac] '-g'
    [javac] 
    [javac] The ' characters around the executable and arguments are
    [javac] not part of the command.
    [javac] File to be compiled:
    [javac]     C:\opt\Tomcat 4.1\work\Standalone\me.askmore\_\index_jsp.java
C:\opt\Tomcat 4.1\work\Standalone\me.askmore\_\index_jsp.java:7: package 
mill.main does not exist
import mill.main.Constants;
                 ^

What this means???:
dropping C:\opt2\_me.askmore.info\data\WEB-INF\lib\castor-0.9.3.21.jar from 
path as it doesn't exist

Comment 6 Serg Maslyukov (http://webmill.riverock.org) 2002-09-08 12:29:53 UTC
part of my server.xml:

			<Host name="me.askmore" debug="0" appBase="d:\opt2
\_me.askmore.info">
				<Alias>test</Alias>
				<Valve 
className="org.apache.catalina.valves.AccessLogValve" suffix=".txt" 
pattern="common" debug="0" directory="c:\opt2\logs\_me.askmore/access" 
prefix="access_log."/>
				<Logger 
className="org.apache.catalina.logger.FileLogger" suffix=".txt" 
timestamp="true" debug="0" directory="c:\opt2\logs\_me.askmore\log" 
prefix="log."/>
				<Context path="" docBase="data" debug="0" 
reloadable="true" useNaming="false" crossContext="true"/>
			</Host>

Why Jasper try load jars from c:\...., not from d:\....?
Comment 7 Remy Maucherat 2002-09-08 15:21:21 UTC
This bug may be caused by Ant under Windows, then. Using Jasper 1 should be a
working workaround.

I'm not sure I understand how to reroduce it. Try to find simple cases which
work, and simple cases which don't.
Comment 8 Serg Maslyukov (http://webmill.riverock.org) 2002-09-08 17:01:09 UTC
steps for reproduce bug:
1. Install standart configuration t4.1.10
2. move webapps folder to any disk (d, e, ... ).
3. correct Host section in conf/server.xml to point new location of webapps
4. create dir webapps/ROOT/WEB-INF/classes
5. create file T.java:
public class T
{
	public T(){}
}
6. compile it  ;)
7. create t.jsp in webapps/ROOT:

<%@page
contentType="text/html; charset=utf-8"
language="java"
import="T"
%>
bug 12387:
<%

	T t = new T();

%>

8. try http://localhost:8080/t.jsp 

Comment 9 Remy Maucherat 2002-09-09 07:25:41 UTC
Yes, I have been able to reproduce the problem and see what was affected. (I'm
relieved to see there are some easy workarounds, and I'm downgrading the bug
severity accordingly)
I think this is caused by Ant bugs, for which I will attempt to find a
workaround. If I fail to find a workaround, Tomcat will be restricted to the
first HD when running on Windows, until Ant fixes the issues.
Comment 10 Remy Maucherat 2002-09-09 14:10:57 UTC
*** Bug 12438 has been marked as a duplicate of this bug. ***
Comment 11 Serg Maslyukov (http://webmill.riverock.org) 2002-09-11 05:24:16 UTC
*** Bug 12504 has been marked as a duplicate of this bug. ***
Comment 12 Randy Carbine 2002-09-12 23:11:43 UTC
The way I fixed this problem (thanks to an article at webmasterbase.com) was to 
take both apache and tomcat and install them in the root of my c:\ drive.  The 
logic behind this is that there is a problem installing in the Program FIles 
directory because of the space between program and files.  I installed apache 
in C:\Apache and tomcat in C:\Apache\Tomcat.  After I did this it worked like a 
champ
Comment 13 Randy Carbine 2002-09-12 23:13:38 UTC
I also installed the zip version of the Tomcat download and not the exe
Comment 14 Remigius Stalder 2002-09-13 09:16:15 UTC
I also encountered this bug. As opposed to other reports, in my setup it also 
occurs if the webapps is on the same drive than tomcat. I extracted the zip to: 
F:\Tools\bin\jakarta-tomcat-4.1.10 (no spaces, same directory layout as in 
zip). However, the JDK is on another drive, namely D:\Java\j2sdk1.4.0_01. With 
4.1.9 in F:\Tools\bin\jakarta-tomcat-4.1.9 it works just fine. Questions: a) 
what are the easy workarounds? b) what version of ant is bundled with tomcat? 
c) what's the ant problem behind this bug? (sorry, just curious, but it may 
also help me to get rid of the problem, as currently I downgraded to 4.1.9).
Comment 15 Holger Morgenstern 2002-09-13 09:43:42 UTC
On my system (Win NT, installed tomcat 4.1.10 and the sdk on e: drive _with_
spaces in the name) everything works o.k. when I run tomcat with the 'start'
link from the setup-created menu link. The bug comes up only when tomcat is run
as a service. Maybe the only the service entries in the win reg are not
correctly set?!? Does some know _what_ to check for in the registry??

--Holger (http://www.morgenstern.net)
Comment 16 Remigius Stalder 2002-09-13 10:03:19 UTC
Holger, Thanks for your input. On my system, it now works fine if the current 
directory is set to tomcat's /bin subdirectory (e.g. double-click on 
startup.bat). Previously, I ran a start-batch file from a shortcut without 
setting the startup directory. Therefore the startup directory was different 
from tomcat's bin directory. It looks like there are references to tomcat's 
startup directory, instead of referring everything to CATALINA_HOME and/or 
paths configured in the respective places. In your case you should try to 
control tomcat's startup directory when it runs as a service. However, I don't 
know of an easy way to do this.
Comment 17 Remigius Stalder 2002-09-13 10:18:30 UTC
Sorry, false alert. After some more experiments, I found out that setting the 
startup path does not work either (I only had to remove the content of the work 
directory and it failed again), but replacing the jasper-JARs with the ones 
from 4.1.9 seems to help.
Comment 18 Carlos Lucas 2002-09-13 11:23:41 UTC
Created attachment 3041 [details]
Temporary resolves the bug. New JspRuntimeContext.class / .java (jasper-compiler.jar)
Comment 19 Remy Maucherat 2002-09-13 11:37:20 UTC
I have committed a possible fix fo that bug (at least, it fixes it for me, 
where I have TC running as a service, installed on the C: drive, and trying to 
run a webapp on another HD).
The fix will be in 4.1.11. If people could test it, that would help.

I don't quite understand why it was working in 4.1.9 but not in 4.1.10. I 
diffed everything, and cannot find any particular change which would explain 
the bug was introduced. However, rewriting the Ant code using different 
(although equivalent according to the docs) API methods fixed the bug (for me).

I'm looking for feedback on this. Thanks.
Comment 20 Carlos Lucas 2002-09-13 11:44:51 UTC
Hi all.
When the installation of jdk, tomcat or your web-applications are on diferent 
Windows Drives (C:, D:, etc) the java compiler looks for any class in the same 
drive the jdk resides.

My new JspRuntimeContext.class (see attach 9/13/02 11:23 -> TemporalPatch.zip) 
removes the first '/' in the url of the libraries that will go on the jsp 
compiler classpath when they looks like an absolute addres in a drive letter 
(   /E:/myapp/WEB-INF ...   ) ... and javac finds every library :)


Comment 21 Remigius Stalder 2002-09-13 11:49:58 UTC
Any idea where this leading slash comes from anywhay???
Comment 22 Carlos Lucas 2002-09-13 11:53:41 UTC
I don't know ...

I'm debugging and tracking back where the classpath (including myapp/WEB-
INF/classes) is generated ... but I don't find anything (I really never looked 
at Tomcat sources ... hehehehe, this is my first time).

(sorry my english)
Comment 23 Holger Morgenstern 2002-09-13 11:54:19 UTC
Where can I find the fix from  Remy Maucherat??

--Holger (http://www.morgenstern.net)
Comment 24 Remigius Stalder 2002-09-13 12:01:57 UTC
Hi all, I have tested the fix and it works (i have removed the compiled classes 
in the work subdirectory first). But I think the leading slash added to the 
classpath somewhere is the cause, this fix removes only the symptoms: what if 
ervery piece of code has to retailor paths? (get the picture...)
Comment 25 Remy Maucherat 2002-09-13 12:03:00 UTC
Created attachment 3042 [details]
Patched Compiler.java source
Comment 26 Remy Maucherat 2002-09-13 12:04:12 UTC
Created attachment 3043 [details]
Fixed Compiler.class
Comment 27 Remy Maucherat 2002-09-13 12:11:02 UTC
I think the leading slash is ok in file paths (I've seen it already, and it 
comes from using URLs), and is there to make a file path looks similar between 
Windows and Unix.
Also, you can't just strip the leading '/': there would be problems on Unix ;-)

The patch also fixes some similar issues, where there's a ' ' in the path to a 
JSP file (somehow Ant didn't handle the includes list correctly, and the patch 
uses a lower lever API to work around that).

I think I understand where the bug comes from, however. The CL now generates 
correct URLs (with the leading '/') in 4.1.10, to fix RMI related issues. If 
the leading '/' is what triggers the bug, then that's why 4.1.9 worked 
(although it was more by accident than by design).

Thanks for the feedback and patience, this will result in a quality 4.1.11 (or 
12) release eventually.
Comment 28 Holger Morgenstern 2002-09-13 12:25:44 UTC
I've just installed the new Compiler.class into 
common\classes\org\apache\jasper\compiler
Is this correct?

Now I get the following error:


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(ApplicationFilt
erChain.java:247)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:193)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2
60)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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:1
91)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
        at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.jav
a:527)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.java:643)
        at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java
:170)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.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.processConnectio
n(Http11Protocol.java:380)
        at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:53
3)
        at java.lang.Thread.run(Thread.java:536)

root cause 

java.lang.NullPointerException: charsetName
        at java.io.OutputStreamWriter.(OutputStreamWriter.java:81)
        at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:208)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
        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(ApplicationFilt
erChain.java:247)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:193)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2
60)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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:1
91)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
        at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.jav
a:527)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.java:643)
        at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java
:170)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.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.processConnectio
n(Http11Protocol.java:380)
        at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:53
3)
        at java.lang.Thread.run(Thread.java:536)

--Holger (http://www.morgenstern.net)
Comment 29 Carlos Lucas 2002-09-13 12:32:37 UTC
Ok. 
I have no time now to find a better solution for the problem, but I think it's 
working OK on linux/unix systems (without any patch).

I thought patching Compiler.java, but it was easier to patch JspRuntimeContext 
(the url's were separated in a vector) and I don't know if some other 
components dependant on JspRuntimeContext share the same problem (and use the 
same classpath).

That was the reason to patch at "upper level", at the first time I looked the 
classpath was being generated.

Now the Windows users are able to use tomcat, with app's and program on 
separated drives (I use a drive for system, another for programs and another 
for data/webs/web-apps).

But they must wait for a "clean" solution. Mine was "Temporal" like I said :)
Comment 30 Remy Maucherat 2002-09-13 12:40:00 UTC
Created attachment 3044 [details]
New EmbeddedServletOptions to fix NPE
Comment 31 Remy Maucherat 2002-09-13 12:41:06 UTC
Created attachment 3045 [details]
New ESO source
Comment 32 Carlos Lucas 2002-09-13 12:51:21 UTC
Using a default javaEncoding="UTF8" in ESO resolves the bug???
I'll test it monday :) tx.


Comment 33 Remy Maucherat 2002-09-13 12:55:15 UTC
Well, the updated Compiler also modifies the way the javaEncoding is used 
(because of another patch), so now it can't be null anymore or you'd get a NPE.
Comment 34 Holger Morgenstern 2002-09-13 13:01:25 UTC
Remy, can you please post the internal Compiler$JasperAntLogger.class too? Or is 
this unchanged?

Now with your new Compiler.class and the new ESO, I get the following:

javax.servlet.ServletException: 
org.apache.jasper.compiler.Compiler$JasperAntLogger.(Lorg/apache/jasper/compiler
/Compiler;)V
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:247)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:193)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2
60)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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:1
91)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
        at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.jav
a:527)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.java:643)
        at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java
:170)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.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.processConnectio
n(Http11Protocol.java:380)
        at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:53
3)
        at java.lang.Thread.run(Thread.java:536)

root cause 

java.lang.NoSuchMethodError: 
org.apache.jasper.compiler.Compiler$JasperAntLogger.(Lorg/apache/jasper/compiler
/Compiler;)V
        at org.apache.jasper.compiler.Compiler.getProject(Compiler.java:149)
        at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:257)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:324)
        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(ApplicationFilt
erChain.java:247)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:193)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2
60)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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:1
91)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
        at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.jav
a:527)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.java:643)
        at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java
:170)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.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.processConnectio
n(Http11Protocol.java:380)
        at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:53
3)
        at java.lang.Thread.run(Thread.java:536)

--Holger (http://www.morgenstern.net)

Comment 35 Remy Maucherat 2002-09-13 18:48:46 UTC
Created attachment 3055 [details]
Updated JasperAntLogger
Comment 36 Remy Maucherat 2002-09-13 18:50:03 UTC
Created attachment 3056 [details]
Updated jasper-compiler.jar
Comment 37 Dave Martin 2002-09-14 01:57:53 UTC
I still get this error when trying to load the index.jsp (even with the latest 
jasper-compiler.jar).

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:313)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:324)
	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:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:260)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.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.StandardContext.invoke
(StandardContext.java:2397)
	at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:180)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:171)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.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.invokeNex
t(StandardPipeline.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.processConnectio
n(Http11Protocol.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:484)



--------------------------------------------------------------------------------

Comment 38 Dave Martin 2002-09-14 02:16:59 UTC
Could it be the offending '/' right before the source file name that is 
offending?  It seems like Windows is happy to open a file with this path,
but who knows about the javac compiler!?


2002-09-13 19:07:02 Error compiling file: C:\jakarta-tomcat-4.1.10
\work\Standalone\localho
st\reporter\/agents_jsp.java     [javac] Compiling 1 source file^M

Comment 39 Remy Maucherat 2002-09-14 06:24:46 UTC
Well, it is working fine for me, so I don't plan to commit any additional fix. 
Check if your configuration is right.
Comment 40 Holger Morgenstern 2002-09-16 09:18:00 UTC
Hi,

I've just tested the new jasper-compiler.jar with the fixes for this bug and it 
works!! (Windows NT, tomcat,jdk installed not on c drive; Tomcat run via 
commandline AND alsa as nt-service) 

Great job - Thanx!!
--Holger (http://www.morgenstern.net)
Comment 41 Remy Maucherat 2002-09-17 08:48:22 UTC
*** Bug 12679 has been marked as a duplicate of this bug. ***
Comment 42 Remy Maucherat 2002-09-19 06:35:18 UTC
*** Bug 12792 has been marked as a duplicate of this bug. ***
Comment 43 Remy Maucherat 2002-09-20 07:01:22 UTC
*** Bug 12824 has been marked as a duplicate of this bug. ***
Comment 44 Remy Maucherat 2002-09-20 07:03:07 UTC
*** Bug 12839 has been marked as a duplicate of this bug. ***
Comment 45 Remy Maucherat 2002-09-26 08:21:59 UTC
*** Bug 13019 has been marked as a duplicate of this bug. ***
Comment 46 Remy Maucherat 2002-09-26 11:18:36 UTC
*** Bug 13028 has been marked as a duplicate of this bug. ***
Comment 47 Adri 2003-01-16 21:48:49 UTC
Hi.

I've found this problem (the way Martin has described) on 4.1.12 from the exe
distribution on W2K wihtout any Service Pack.
I share he's thought about the offending slash and I also  think i've found the
place in the code where it happens and how to correct it.

Looking deeply inside the code (I am not going to walk thru the full path of
code evaluation I did but I'll go straight to the point) it looks that the
method getServletJavaFileName() of the class
org.apache.jasper.JspCompilationContext is intended primary for achieving
physical file system path names and not virtual site names. The problem shows on
line 333 and line 338 of source file for that class where it checks for leading
slashes (hard-coded), where I understand it should be checking for
system-dependent separator (File.separator).

My guess is that replacing the following lines:

333:            if( outputDir.endsWith("/" ) ) {

338:                servletJavaFileName = outputDir + "/" + servletJavaFileName;

with:

333:            if( outputDir.endsWith("/" ) || outputDir.endWith(
File.separator ) ) {

338:                servletJavaFileName = outputDir + File.separator +
servletJavaFileName;

should solve the problem.

Unfortunly I tried to recompile Tomcat after this changes using the scripts set
provided with source code but I couldn't. So I'm posting this here to see if
someone that agrees with me on this can made those changes and recompile so we
can test them and see if they really solve the problem.

Thanks and hope it helps.
Comment 48 Remy Maucherat 2003-01-16 21:56:46 UTC
Please, please, do not attempt to fix that bug, since it is not a bug. Instead,
upgrade to a newer Tomcat release. I'll revert to the original resolution.
Please do not reopen the bug.