Announcement Announcement Module
Collapse
No announcement yet.
tc Server and EL Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • tc Server and EL

    Hi all,

    I try to deploy an existing JSF application on tc Server.
    This application was built for WebSphere AS 6 on Servlet 2.4 / JSF 1.1 and I update it to be complient with Servlet 2.5 / JSF 1.2 / JSP 2.1 / EL 1.2 / JSTL 1.2... and I hope it's all a need to do...
    Now the application works well on JBoss AS, Jetty and Tomcat 6.0.18.

    But I have a problem on tc Server, the application is deployed and in running state. But when I navigate on the application, I'm redirected on the error page and I can see in the log file this exception :
    [CODE]27-May-2009 15:25:48 SEVERE org.apache.catalina.core.ApplicationDispatcher.inv oke "Servlet.service()" pour la servlet jsp a lancÚ une exception
    org.apache.jasper.JasperException: Impossible de compiler la classe pour la JSP:

    Une erreur s'est produite Ó la ligne: 54 dans le fichier jsp: /all.jsp
    The method setTest(boolean) in the type IfTag is not applicable for the arguments (String)
    51: <c:if test='${pageBean.properties["toto"]}'>
    52: <option value="/pages/toto.jsf">Toto</option>
    53: </c:if>
    54: <c:if test='{${pageBean.properties["titi"]} or {${pageBean.properties["tata"]}}'>
    55: <option value="/pages/titi.jsf">Titi</option>
    56: </c:if>
    57: </c:when>


    Stacktrace:
    at org.apache.jasper.compiler.DefaultErrorHandler.jav acError(DefaultErrorHandler.java:92)
    at org.apache.jasper.compiler.ErrorDispatcher.javacEr ror(ErrorDispatcher.java:330)
    at org.apache.jasper.compiler.JDTCompiler.generateCla ss(JDTCompiler.java:439)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:334)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:312)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:299)
    at org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:586)
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:317)
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:646)
    at org.apache.catalina.core.ApplicationDispatcher.doI nclude(ApplicationDispatcher.java:551)
    at org.apache.catalina.core.ApplicationDispatcher.inc lude(ApplicationDispatcher.java:488)
    at org.apache.jasper.runtime.JspRuntimeLibrary.includ e(JspRuntimeLibrary.java:968)
    at org.apache.jsp.protected_.pages.common.home.displa yAccountSummary_jsp._jspService(displayAccountSumm ary_jsp.java:481)
    at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:646)
    at org.apache.catalina.core.ApplicationDispatcher.pro cessRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doF orward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.for ward(ApplicationDispatcher.java:302)

    If I understand the error message, my EL expressions are not recognized and it is processed as a simple String (the result of the expression should be a Boolean).
    So I would like to know exactly what are the differences between Tomcat 6.0.18 and tc Server (built on top of Tomcat 6.0.19.A) in terms of EL implementation and if I have something special to do to be able to run it on tc Server.
    I've compared the jars in the "lib" folder between Tomcat and tc Server, and just see some specific code on tc Server, but the JSP/EL versions are the same...

    Best regards,
    Rudy
    Last edited by rkrol; Mar 2nd, 2010, 10:29 AM.

  • #2
    The EL code is byte for byte identical between Tomcat from the ASF and tc Server. However, there were a lot of changes between the ASF 6.0.18 and 6.0.19 tags. As you probably guessed from the version number, tc Server is based on the 6.0.19 tag.

    You may have hit a regression or, more likely, an area where Tomcat had to be stricter in parsing EL to fix a bug and/or confirm to the specs. I'll try and reproduce your problem with the latest Tomcat source. In the meantime, it would be useful to know the results of testing against the current ASF Tomcat 6.0.20 release candidate which can be found here: http://people.apache.org/~remm/tomcat-6/v6.0.20/

    Note that this is a release candidate for testing, not a formal ASF release.

    Cheers,

    Mark

    Comment


    • #3
      Hi Mark,
      Thanks for your help.
      I tried on Tomcat 6.0.20 as you recommend and I don't have the error anymore.
      So may be I hit a regression on 6.0.19, fixed on 6.0.20.
      How can I get Tomcat-6.0.19 release (without tcServer adds) ?
      I would like to test my application on this release to be sure that the error is related this version of Tomcat (and absolutely not related to tc Server).

      Cheers,
      Rudy

      Comment


      • #4
        Really? It works with 6.0.20? That surprises me because my simple test case based on your original post fails for 6.0.20 as well.

        I've looked at this some more, and there are some differences between 6.0.18 and 6.0.19 that explain the behaviour you see.

        A simple version of your code is:
        Code:
        <c:if test='{${"true"} or {${"false"}}'>
        This appears to work on 6.0.18 but throws an error on 6.0.19. I say "appears to work", since the code above seems to evaluate to false rather than throwing an error, at least the text in the c:if block is never displayed. This code example is not valid and should throw an error. That it hasn't up until 6.0.18 is a bug.

        The correct version of the code above is:
        Code:
        <c:if test='${"true" or "false"}'>
        This works with 6.0.19 and the latest ASF Tomcat 6.0.x code.

        The change that is most likely to have fixed the underlying bug and caused the error message you now see to be displayed is: http://svn.apache.org/viewvc?rev=708165&view=rev which addressed a range of edge-cases with the EL parsing code.

        There are no changes between 6.0.19 and 6.0.20 related to EL parsing.

        Comment


        • #5
          Sorry it's a mistake! I didn't see the exception because it was not redirected on the log file (I didn't see it on the terminal).
          Thank you for your help and explanation.

          Cheers,
          Rudy

          Comment


          • #6
            To be honest, I'm not sure why 6.0.18 was evaluating that as false. You'd have to debug your way through the code to find out. If I had to guess, my guess would be that the parser got confused and returned null which was treated as false. But that is only a guess.

            Comment

            Working...
            X