I recently updated from Tomcat 6.0.20 to 6.0.24. Now some jsps with jsf tags are not compiling anymore. Following tag results in a JasperException in 6.0.24 but compiles fine with older versions: <h:outputText value="\\"> Stack: Caused by: org.apache.jasper.JasperException: /pages/preferences.jsp(147,100) According to TLD or attribute directive in tag file, attribute value does not accept any expressions at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148) at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1165) at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:852) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411) at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:871) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411) at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:871) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411) at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:871) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411) at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:871) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411) at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:871) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411) at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:871) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411) at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417) at org.apache.jasper.compiler.Node$Root.accept(Node.java:495) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1775) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:183) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:332) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:312) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:299) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) 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:646) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968) at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:650) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:644) at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:80) ... 67 more
We're also hitting this since upgrading to 6.0.24 -- in our case, the attribute value also contains a '\' character. I'm updating the platform to "All" since we're running on various OS combinations and have seen the issue on both Windows and Mac so far. I also upgraded severity to "major" since it's a significant loss of functionality for those of us who do hit it. :)
I have been able to reproduce this and have added a test case for it to Tomcat 7. I know exactly what caused it. My recent changes to address a number of issues with EL parsing made the incorrect assumption that EL would be valid for any attribute. Clearly that isn't a valid assumption. I agree this is a nasty regression and I am working on a fix. Once I have a fix are either of you willing and able to test it? You'll either need to build Tomcat from source or I can provide a binary patch.
Yeah, I'd be happy to test it. Thanks!
I can also test it but I need a binary patch
Created attachment 24910 [details] Binary patch for testing purposes only This has been fixed in trunk and proposed for 6.0.x. To test if you are happy build from source, checkout tc6.0.x/trunk and apply this patch before building: http://svn.apache.org/viewvc?view=revision&revision=904949 To test with the binary patch, make the following changes to a 6.0.24 installation: 1. Create the following directory structure in $CATALINA_HOME/lib org/apache/jasper/compiler 2. Download the binary patch attachment and extract the 2 class files to the directory you created in step 1. You should now have: $CATALINA_HOME/lib/org/apache/jasper/compiler/AttributeParser.class $CATALINA_HOME/lib/org/apache/jasper/compiler/Parser.class 3. Empty the $CATALINA_BASE/work directory 4. Start Tomcat Please be aware that this patch in both source and binary form is for testing purposes only and is not an official release from the ASF. Let us know how you get on. Thanks in advance.
The fix worked perfectly for me. I took your binary patch to make things a little faster -- let me know if you need extra verification and I can build it from source. Thanks Mark!
The initial JasperException does not occur anymore but I got a new one. Maybe the patch is not fully compatible? Caused by: java.lang.NoSuchMethodError: org.apache.jasper.compiler.PageInfo.isErrorOnUndeclaredNamespace()Z at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1175) at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1422) at org.apache.jasper.compiler.Parser.parse(Parser.java:131) at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255) at org.apache.jasper.compiler.ParserController.parse(ParserController.java:103) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:170) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:332) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:312) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:299) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) 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:646) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968) at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:650) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:644) at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:80) ... 93 more Cause:
(In reply to comment #7) > The initial JasperException does not occur anymore but I got a new one. > Maybe the patch is not fully compatible? > > Caused by: java.lang.NoSuchMethodError: > org.apache.jasper.compiler.PageInfo.isErrorOnUndeclaredNamespace()Z That method was introduced in Tomcat 7. > at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1175) > at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1422) > at org.apache.jasper.compiler.Parser.parse(Parser.java:131) and these line numbers are Tomact 7 line numbers. The binary patch is only intended for testing with Tomcat 6.0.24.
(In reply to comment #6) > The fix worked perfectly for me. I took your binary patch to make things a > little faster -- let me know if you need extra verification and I can build it > from source. > > Thanks Mark! Thanks for the testing. I'll add a note to the STATUS file.
I don't have Tomcat 7, I wasn't even aware of it. I am using 6.0.24 and used the binary patch applied to this bug.
I decompiled the patch and it contains this line: if(pageInfo.isErrorOnUndeclaredNamespace())
Created attachment 24925 [details] Updated source patch for Tomcat 6.0 Updated patch for Tomcat 6.0.24. It is the result of merging revisions 904949, 905226, 906465 from trunk.
Created attachment 24926 [details] Updated binary patch for Tomcat 6.0.24 for testing purposes only Updated binary patch for Tomcat 6.0.24 that corresponds to the source patch from attachment 24925 [details] Its usage is subject to the conditions stated in Comment 5. Please be aware that this patch in both source and binary form is for testing purposes only and is not an official release from the ASF.
This has been fixed in 6.0.x and will be included in 6.0.25 onwards.