Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-M1, 2.0-M2, 2.0-M5
    • Fix Version/s: 2.0-M3
    • Component/s: web
    • Security Level: public (Regular issues)
    • Labels:
      None

      Description

      Deploying a web application with JSP 2.1 features throws error in Jetty and Tomcat

      On Tomcat 6:
      -------------------
      org.apache.jasper.JasperException: /SampleJSP.jsp(12,35) #

      {..} is not allowed in template text
      org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
      org.apache.jasper.compiler.ErrorDispatcher.dispatch (ErrorDispatcher.java:406)
      org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:101)
      org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:710)
      org.apache.jasper.compiler.Node$ELExpression.accept (Node.java:935)
      org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
      org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
      org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392)
      org.apache.jasper.compiler.Node$Root.accept (Node.java:489)
      org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
      org.apache.jasper.compiler.Validator.validate(Validator.java:1679)
      org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:178)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
      org.apache.jasper.JspCompilationContext.compile (JspCompilationContext.java:566)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
      org.apache.jasper.servlet.JspServlet.service (JspServlet.java:266)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:806)

      On Jetty 6.0:
      --------------------
      org.apache.jasper.JasperException: /SampleJSP.jsp(12,35) #{..}

      is not allowed in template text
      at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
      at org.apache.jasper.compiler.ErrorDispatcher.dispatch (ErrorDispatcher.java:406)
      at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:101)
      at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:710)
      at org.apache.jasper.compiler.Node$ELExpression.accept (Node.java:935)
      at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
      at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
      at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392)
      at org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
      at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
      at org.apache.jasper.compiler.Validator.validate(Validator.java:1679)
      at org.apache.jasper.compiler.Compiler.generateJava (Compiler.java:178)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java :273)
      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java:320)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java :459)
      at org.apache.geronimo.jetty6.InternalJettyServletHolder.handle(InternalJettyServletHolder.java:62)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
      at org.apache.geronimo.jetty6.JettyServletHandler.doHandle (JettyServletHandler.java:55)
      at org.apache.geronimo.jetty6.JettyServletHandler$ActualJettyServletHandler.handle(JettyServletHandler.java:62)
      at org.apache.geronimo.jetty6.JettyServletHandler$NoOpChainedHandler.handle (JettyServletHandler.java:70)
      at org.apache.geronimo.jetty6.JettyServletHandler.handle(JettyServletHandler.java:47)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
      at org.apache.geronimo.jetty6.handler.ThreadClassloaderHandler.handle (ThreadClassloaderHandler.java:46)
      at org.apache.geronimo.jetty6.handler.ComponentContextHandler.handle(ComponentContextHandler.java:47)
      at org.apache.geronimo.jetty6.handler.InstanceContextHandler.handle(InstanceContextHandler.java :58)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:389)
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java :123)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
      at org.mortbay.jetty.Server.handle(Server.java:303)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452)
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:721)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:509)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java :209)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:349)
      at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:217)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run (BoundedThreadPool.java:475)

      1. SampleJSP.war
        2 kB
        Krishnakumar B

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        49d 2h 5m 1 Joe Bohn 30/Jan/07 18:57
        Joe Bohn made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Joe Bohn added a comment -

        I checked in a fix for this in trunk with revision 501515. Unfortunately I forgot to reference this JIRA on the check in.

        Show
        Joe Bohn added a comment - I checked in a fix for this in trunk with revision 501515. Unfortunately I forgot to reference this JIRA on the check in.
        Matt Hogstrom made changes -
        Fix Version/s 2.0 [ 12312152 ]
        Fix Version/s 2.0-M2 [ 12312217 ]
        Fix Version/s 2.0-beta1 [ 12312218 ]
        Hide
        Anita Kulshreshtha added a comment -

        The web-app element should not contain 'j2ee' for 2.5, i.e. it should be:
        <web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
        Please see http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd

        Show
        Anita Kulshreshtha added a comment - The web-app element should not contain 'j2ee' for 2.5, i.e. it should be: <web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd "> Please see http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
        Hide
        Joe Bohn added a comment -

        The change in revision http://svn.apache.org/viewcvs?view=rev&rev=494909 which listed this JIRA was not actually for this problem. The JIRA was listed incorrectly in that change and should have been GERONIMO-2719.

        Show
        Joe Bohn added a comment - The change in revision http://svn.apache.org/viewcvs?view=rev&rev=494909 which listed this JIRA was not actually for this problem. The JIRA was listed incorrectly in that change and should have been GERONIMO-2719 .
        Prasad Kashyap made changes -
        Affects Version/s 2.0 [ 12312152 ]
        Fix Version/s 2.0-M2 [ 12312217 ]
        Fix Version/s 2.0 [ 12312152 ]
        Affects Version/s 2.0-M2 [ 12312217 ]
        Hide
        Paul McMahan added a comment -

        I think the problem with deferred assignment in EL might now be fixed in tomcat. See
        http://svn.apache.org/viewvc?view=rev&revision=492639

        Show
        Paul McMahan added a comment - I think the problem with deferred assignment in EL might now be fixed in tomcat. See http://svn.apache.org/viewvc?view=rev&revision=492639
        Hide
        Paul McMahan added a comment -

        and one more thing to add to the sample jsp:

        <%@page trimDirectiveWhitespaces="true" deferredSyntaxAllowedAsLiteral="true"%>

        this allows jasper to pass the value on to jstl. you still need to add jstl.jar to WEB-INF/lib, which is I think a problem.

        Show
        Paul McMahan added a comment - and one more thing to add to the sample jsp: <%@page trimDirectiveWhitespaces="true" deferredSyntaxAllowedAsLiteral="true"%> this allows jasper to pass the value on to jstl. you still need to add jstl.jar to WEB-INF/lib, which is I think a problem.
        Paul McMahan made changes -
        Assignee Paul McMahan [ pmcmahan ] Joe Bohn [ jbohn ]
        Hide
        Paul McMahan added a comment -

        Joe can you please have a look at this?

        The error seems to be related to the attached webapp being constructed incorrectly but also a problem with geronimo's jstl integration.

        First I changed the web-app element in the web.xml to:
        <web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">

        and then added this to the JSP
        <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

        At this point I expected the jsp to work correctly but still got an error message:
        SEVERE: Servlet.service() for servlet jsp threw exception
        org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jst
        l/core cannot be resolved in either web.xml or the jar files deployed with this
        application
        at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorH
        andler.java:51)
        at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.j
        ava:408)
        at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.j
        ava:115)

        Adding jstl-1.2.jar to WEB-INF/lib in the webapp made the error go away. So it seems that adding the jstl.jar to the webapp is required to make this work even though in JEE5 that should not be necessary.

        Show
        Paul McMahan added a comment - Joe can you please have a look at this? The error seems to be related to the attached webapp being constructed incorrectly but also a problem with geronimo's jstl integration. First I changed the web-app element in the web.xml to: <web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd "> and then added this to the JSP <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> At this point I expected the jsp to work correctly but still got an error message: SEVERE: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jst l/core cannot be resolved in either web.xml or the jar files deployed with this application at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorH andler.java:51) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.j ava:408) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.j ava:115) Adding jstl-1.2.jar to WEB-INF/lib in the webapp made the error go away. So it seems that adding the jstl.jar to the webapp is required to make this work even though in JEE5 that should not be necessary.
        Prasad Kashyap made changes -
        Assignee Paul McMahan [ pmcmahan ]
        Show
        Prasad Kashyap added a comment - http://www.nabble.com/forum/ViewPost.jtp?post=7761956&framed=y
        Krishnakumar B made changes -
        Field Original Value New Value
        Attachment SampleJSP.war [ 12347074 ]
        Hide
        Krishnakumar B added a comment -

        sample jsp-2.1 application

        Show
        Krishnakumar B added a comment - sample jsp-2.1 application
        Krishnakumar B created issue -

          People

          • Assignee:
            Joe Bohn
            Reporter:
            Krishnakumar B
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development