4 Replies Latest reply on Jun 8, 2011 2:23 AM by Jean-Frederic Clere

    Failure to evaluate Ternary operators in EL : JBoss 5.0.0-Be

    Samba Kolusu Newbie

      Hi!
      I'm getting the following error when my page contains Ternary operators in EL :

      javax.servlet.ServletException: Error Parsing: #{width !=null?width:300}
       javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
       org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
       com.avaya.panther.faces.util.ResourceInjectionFilter.doFilter(ResourceInjectionFilter.java:45)
       org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:241)
       org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:198)
       org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:141)
       org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
       org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
      root cause
      
      javax.el.ELException: Error Parsing: #{width !=null?width:300}
       org.apache.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:125)
       org.apache.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:146)
       org.apache.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:190)
       org.apache.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:68)
       com.sun.facelets.tag.TagAttribute.getValueExpression(TagAttribute.java:256)
       com.sun.facelets.tag.jsf.ComponentRule$ValueExpressionMetadata.applyMetadata(ComponentRule.java:69)
       com.sun.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:36)
       com.sun.facelets.tag.MetaTagHandler.setAttributes(MetaTagHandler.java:62)
       com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:144)
       com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
       com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
       com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
       com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
       com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
       com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
      ...................................................................................................
      ...................................................................................................
      
      root cause
      
      org.apache.el.parser.ParseException: Encountered "width: 300" at line 1, column 16.
      Was expecting one of:
       "(" ...
       <IDENTIFIER> ...
       <NAMESPACE> <IDENTIFIER> ...
      
       org.apache.el.parser.ELParser.generateParseException(ELParser.java:1874)
       org.apache.el.parser.ELParser.jj_consume_token(ELParser.java:1754)
       org.apache.el.parser.ELParser.NonLiteral(ELParser.java:1136)
       org.apache.el.parser.ELParser.ValuePrefix(ELParser.java:1030)
       org.apache.el.parser.ELParser.Value(ELParser.java:978)
       org.apache.el.parser.ELParser.Unary(ELParser.java:960)
       org.apache.el.parser.ELParser.Multiplication(ELParser.java:723)
       org.apache.el.parser.ELParser.Math(ELParser.java:643)
       org.apache.el.parser.ELParser.Compare(ELParser.java:455)
       org.apache.el.parser.ELParser.Equality(ELParser.java:349)
       org.apache.el.parser.ELParser.And(ELParser.java:293)
       org.apache.el.parser.ELParser.Or(ELParser.java:237)
       org.apache.el.parser.ELParser.Choice(ELParser.java:203)
       org.apache.el.parser.ELParser.Expression(ELParser.java:183)
      
      
      and more....
      


      We are migrating our code from WAS 6.1 to JBoss.

      The same el expression is working fine in Tomcat 6.0.14 or WebSphere 6.1.

      Can some one explain why the tomcat el processor is not able to parse that expression, when it does if it is not in JBoss!
      Has Jboss done any changes to the Tomcat engine which is causing this failure?
      Or may be am i missing some thing that needs to be done for Jboss?
      awaiting your answer,

      Thanking you in advance,
      Samba

        • 1. Re: Failure to evaluate Ternary operators in EL : JBoss 5.0.0-Be
          CH Srikanth Newbie

          Hi

          I am also facing same issue. Please let me know did you got the solution for this.

          We are migrating an application from WAS to JBoss EAP 5.0.

          The same el expression is working fine in Tomcat 5.0. or WebSphere 7.0.

           

          The error is:

          Caused by: org.apache.jasper.JasperException: An exception occurred processing JSP page /jsp/xxx.jsp at line 27

          24:  {
          25:  %>
          26: <tagName:Set var="backgroundColor" value="#FFF3E7" />
          27: <tagName:Set var="backgroundColor"
          28:  value="${tagName:select('isXXUser##EFF7FF@@!isXXUser##${backgroundColor}', pageContext)}" />
          29: <feba2:Set var="backgroundColor"
          30:  value="${tagName:select('isYYUser##FFFAEB@@!isYYUser##${backgroundColor}', pageContext)}" />


          Stacktrace:
          at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:498)
          at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
          at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
          at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)
          at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444)
          at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
          at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310)
          ... 37 more
          Caused by: javax.el.ELException: Error Parsing: ${feba2:select('isXXUser##EFF7FF@@!isXXUser##${backgroundColor}
          at org.apache.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:125)
          at org.apache.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:150)
          at org.apache.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:194)
          at org.apache.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:68)
          at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:924)
          at org.apache.jsp.jsp.user.DashboardFG.CorporateUserDashboard_jsp._jspx_meth_feba2_005fSet_005f42(CorporateUserDashboard_jsp.java:11164)
          at org.apache.jsp.jsp.user.DashboardFG.CorporateUserDashboard_jsp._jspService(CorporateUserDashboard_jsp.java:4971)
          at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
          at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
          ... 47 more
          Caused by: org.apache.el.parser.ParseException: Encountered " <ILLEGAL_CHARACTER> "\' "" at line 1, column 16.
          Was expecting one of:
              <INTEGER_LITERAL> ...
              <FLOATING_POINT_LITERAL> ...
              <STRING_LITERAL> ...
              "true" ...
              "false" ...
              "null" ...
              "(" ...
              ")" ...
              "!" ...
              "not" ...
              "empty" ...
              "-" ...
              <IDENTIFIER> ...
             
          at org.apache.el.parser.ELParser.generateParseException(ELParser.java:2142)
          at org.apache.el.parser.ELParser.jj_consume_token(ELParser.java:2024)
          at org.apache.el.parser.ELParser.Function(ELParser.java:1207)
          at org.apache.el.parser.ELParser.NonLiteral(ELParser.java:1114)
          at org.apache.el.parser.ELParser.ValuePrefix(ELParser.java:1016)
          at org.apache.el.parser.ELParser.Value(ELParser.java:965)
          at org.apache.el.parser.ELParser.Unary(ELParser.java:947)
          at org.apache.el.parser.ELParser.Multiplication(ELParser.java:711)
          at org.apache.el.parser.ELParser.Math(ELParser.java:631)
          at org.apache.el.parser.ELParser.Compare(ELParser.java:443)
          at org.apache.el.parser.ELParser.Equality(ELParser.java:337)
          at org.apache.el.parser.ELParser.And(ELParser.java:281)
          at org.apache.el.parser.ELParser.Or(ELParser.java:225)
          at org.apache.el.parser.ELParser.Choice(ELParser.java:182)
          at org.apache.el.parser.ELParser.Expression(ELParser.java:174)
          at org.apache.el.parser.ELParser.DynamicExpression(ELParser.java:146)
          at org.apache.el.parser.ELParser.CompositeExpression(ELParser.java:43)
          at org.apache.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:93)
          ... 56 more

           

           

          • 3. Re: Failure to evaluate Ternary operators in EL : JBoss 5.0.0-Be
            CH Srikanth Newbie

            I did not understand. What configuration settings i need to change to resolve this issue.

            • 4. Re: Failure to evaluate Ternary operators in EL : JBoss 5.0.0-Be
              Jean-Frederic Clere Master

              It is not a configuration issue. It is a bug either in your application or in the EL of jbossweb.

              BTW: You are using EAP so probably you have a subscription for support, use it.