You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2009/04/10 18:26:25 UTC

DO NOT REPLY [Bug 47013] New: JSP not compiled at startup when used as a servlet

https://issues.apache.org/bugzilla/show_bug.cgi?id=47013

           Summary: JSP not compiled at startup when used as a servlet
           Product: Tomcat 6
           Version: 6.0.18
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: robert.flaherty@oracle.com


I created a servlet with a jsp and the following web.xml entry:

    <servlet>
        <servlet-name>Repository</servlet-name>
        <jsp-file>/Repository.jsp</jsp-file>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Repository</servlet-name>
        <url-pattern>/Repository</url-pattern>
    </servlet-mapping>

I altered the JSP and started Tomcat.  The initial startup invokes the JSP with
the following call stack:

    org.apache.jsp.Repository_jsp.jspInit(Repository_jsp.java:42)
    org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:51)
   
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159)
   
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1191)
    org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992)
   
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
    org.apache.catalina.core.StandardContext.start(StandardContext.java:4371)
    org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    org.apache.catalina.core.StandardService.start(StandardService.java:516)
    org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    org.apache.catalina.startup.Catalina.start(Catalina.java:578)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:597)
    org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

Then I hit the servlet with a normal request with
http://localhost:8080/context/Repository which yields this call stack:

    org.apache.jsp.Repository_jsp.jspInit(Repository_jsp.java:42)
    org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:51)
   
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159)
   
org.apache.jasper.servlet.JspServletWrapper.getDependants(JspServletWrapper.java:263)
    org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:430)
    org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:351)
   
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:582)
   
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    java.lang.Thread.run(Thread.java:619)

The JSP gets compiled on the request, but not at startup.  I backtracked a
little and found StandardWrapper is doing:

    req.setQueryString("jsp_precompile=true");

which is unsafe b/c the precompile param can be specified as system property
org.apache.jasper.Constants.PRECOMPILE.  Instead it should be:

    req.setQueryString(Constants.PRECOMPILE + "=true");

Anyway, I wasn't overriding it so that didn't help.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 47013] JSP not compiled at startup when used as a servlet

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47013


Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 47013] JSP not compiled at startup when used as a servlet

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47013





--- Comment #4 from Mark Thomas <ma...@apache.org>  2009-05-02 18:33:11 PST ---
This has been fixed in trunk and will be in 6.0.20 onwards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 47013] JSP not compiled at startup when used as a servlet

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47013


Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE




--- Comment #1 from Mark Thomas <ma...@apache.org>  2009-04-14 14:58:08 PST ---
I don;t see this with trunk. Looks to be a duplicate of bug 41606 that was
fixed recently.

*** This bug has been marked as a duplicate of bug 41606 ***

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 47013] JSP not compiled at startup when used as a servlet

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47013





--- Comment #2 from Robert Flaherty <ro...@oracle.com>  2009-04-14 15:07:53 PST ---
Shouldn't that precompile flag be changed though (bottom of the note).

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 47013] JSP not compiled at startup when used as a servlet

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47013


Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |




--- Comment #3 from Mark Thomas <ma...@apache.org>  2009-04-14 15:19:01 PST ---
Re-opening to track the secondary issue. It has been fixed in trunk and
proposed for 6.0.x.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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