You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by se...@buerotiger.de on 2018/09/21 08:51:55 UTC

JasperException: Method for function not found in class - Since update from 7.0.90 to 7.0.91

Hello,

Since the update from Tomcat 7.0.90 to 7.0.91 one of my pages fails to load. The log file shows this exception:

org.apache.jasper.JasperException: Method "userMayHideThisMessage " for function "userMayHideThisMessage" not found in class "example.mypackage.Util"
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:445)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:182)
at org.apache.jasper.compiler.Validator$ValidateVisitor$1MapperELVisitor.visit(Validator.java:1744)
at org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:139)
at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:214)
at org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:256)
at org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:61)
at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:214)
at org.apache.jasper.compiler.Validator$ValidateVisitor.getFunctionMapper(Validator.java:1753)
at org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1423)
at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1236)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:881)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1553)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2444)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2450)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:474)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392)
at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1845)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:218)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:374)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:660)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:378)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:64)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:743)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:485)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:410)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:337)
at example.MyServlet.doGet(MyServlet.java:434)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)

The space character at the end of "userMayHideThisMessage " in the exception message seems a bit strange. 

A downgrade back to Tomcat 7.0.90 resolved the problem.

Does one have to change something to be able to continue using custom TLDs / functions with Tomcat 7.0.91+?

What might be the cause of the problem?

Thank you for your hints!

Best wishes,
Sebastian

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


Re: JasperException: Method for function not found in class - Since update from 7.0.90 to 7.0.91

Posted by Mark Thomas <ma...@apache.org>.
On 21/09/18 15:57, sebastian486@buerotiger.de wrote:
>>> org.apache.jasper.JasperException: Method "userMayHideThisMessage " for function "userMayHideThisMessage" not found in class "example.mypackage.Util"
>>> at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56)
>>> at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:445)
>>> at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:182)
>>> at org.apache.jasper.compiler.Validator$ValidateVisitor$1MapperELVisitor.visit(Validator.java:1744)
>>> at org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:139)
>>> at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:214)
>>> at org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:256)
>>> at org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:61)
>>> at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:214)
>>> at org.apache.jasper.compiler.Validator$ValidateVisitor.getFunctionMapper(Validator.java:1753)
>>> at org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1423)
>>> at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1236)
>>> at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:881)
>>> at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1553)
>>> at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392)
>>> at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2444)
>>> at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2450)
>>> at org.apache.jasper.compiler.Node$Root.accept(Node.java:474)
>>> at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392)
>>> at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1845)
>>> at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:218)
>>> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:374)
>>> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
>>> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)
> ...
>>> at example.MyServlet.doGet(MyServlet.java:434)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
>>>
>>> The space character at the end of "userMayHideThisMessage " in the exception message seems a bit strange. 
>>>
>>> A downgrade back to Tomcat 7.0.90 resolved the problem.
>>>
>>> Does one have to change something to be able to continue using custom TLDs / functions with Tomcat 7.0.91+?
>>>
>>> What might be the cause of the problem?
>>
>> Might be related to a fix in TLD whitespace parsing. Can you provide the
>> TLD ?
>>
>> Mark
> 
> Hello Mark,
> 
> Thank you very much for your response! 
> 
> You're idea made me find the reason: The function signature in the TLD contained a space between method name and arguments:
> 
> <function-signature>java.lang.Boolean userMayHideThisMessage (example.mypackage.UserBean, example.mypackage.AbstractMessage)</function-signature>
> 
> While that was ignored in versions <= 7.0.90, such whitespaces seem to interfere with processing now.

Thanks for reporting back. It helps us enormously when folks do this
rather then just fixing their issue and carrying on as it helps us track
down the root cause of any bugs.

My initial impression is that this is a regression. Let me go and check
the spec. Even if the spec does say no space, if Tomcat allowed it
previously, it should probably continue to allow it.

> Removing the space resolves the issue. Lesson learned!
> 
> Thank you very much and keep up the invaluable work at the Tomcat project which is a boon to so many developers out there including me! ;) 

You are welcome.

Mark

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


Re: Re: JasperException: Method for function not found in class - Since update from 7.0.90 to 7.0.91

Posted by se...@buerotiger.de.
> > org.apache.jasper.JasperException: Method "userMayHideThisMessage " for function "userMayHideThisMessage" not found in class "example.mypackage.Util"
> > at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56)
> > at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:445)
> > at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:182)
> > at org.apache.jasper.compiler.Validator$ValidateVisitor$1MapperELVisitor.visit(Validator.java:1744)
> > at org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:139)
> > at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:214)
> > at org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:256)
> > at org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:61)
> > at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:214)
> > at org.apache.jasper.compiler.Validator$ValidateVisitor.getFunctionMapper(Validator.java:1753)
> > at org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1423)
> > at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1236)
> > at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:881)
> > at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1553)
> > at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392)
> > at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2444)
> > at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2450)
> > at org.apache.jasper.compiler.Node$Root.accept(Node.java:474)
> > at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392)
> > at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1845)
> > at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:218)
> > at org.apache.jasper.compiler.Compiler.compile(Compiler.java:374)
> > at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
> > at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)
...
> > at example.MyServlet.doGet(MyServlet.java:434)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
> > 
> > The space character at the end of "userMayHideThisMessage " in the exception message seems a bit strange. 
> > 
> > A downgrade back to Tomcat 7.0.90 resolved the problem.
> > 
> > Does one have to change something to be able to continue using custom TLDs / functions with Tomcat 7.0.91+?
> > 
> > What might be the cause of the problem?
> 
> Might be related to a fix in TLD whitespace parsing. Can you provide the
> TLD ?
> 
> Mark

Hello Mark,

Thank you very much for your response! 

You're idea made me find the reason: The function signature in the TLD contained a space between method name and arguments:

<function-signature>java.lang.Boolean userMayHideThisMessage (example.mypackage.UserBean, example.mypackage.AbstractMessage)</function-signature>

While that was ignored in versions <= 7.0.90, such whitespaces seem to interfere with processing now.

Removing the space resolves the issue. Lesson learned!

Thank you very much and keep up the invaluable work at the Tomcat project which is a boon to so many developers out there including me! ;) 

Best wishes,
Sebastian

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


Re: JasperException: Method for function not found in class - Since update from 7.0.90 to 7.0.91

Posted by Mark Thomas <ma...@apache.org>.
On 21/09/18 09:51, sebastian486@buerotiger.de wrote:
> Hello,
> 
> Since the update from Tomcat 7.0.90 to 7.0.91 one of my pages fails to load. The log file shows this exception:
> 
> org.apache.jasper.JasperException: Method "userMayHideThisMessage " for function "userMayHideThisMessage" not found in class "example.mypackage.Util"
> at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56)
> at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:445)
> at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:182)
> at org.apache.jasper.compiler.Validator$ValidateVisitor$1MapperELVisitor.visit(Validator.java:1744)
> at org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:139)
> at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:214)
> at org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:256)
> at org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:61)
> at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:214)
> at org.apache.jasper.compiler.Validator$ValidateVisitor.getFunctionMapper(Validator.java:1753)
> at org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1423)
> at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1236)
> at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:881)
> at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1553)
> at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392)
> at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2444)
> at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2450)
> at org.apache.jasper.compiler.Node$Root.accept(Node.java:474)
> at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392)
> at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1845)
> at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:218)
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:374)
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)
> at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:660)
> at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:378)
> at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
> at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
> at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:64)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
> at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:743)
> at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:485)
> at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:410)
> at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:337)
> at example.MyServlet.doGet(MyServlet.java:434)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
> 
> The space character at the end of "userMayHideThisMessage " in the exception message seems a bit strange. 
> 
> A downgrade back to Tomcat 7.0.90 resolved the problem.
> 
> Does one have to change something to be able to continue using custom TLDs / functions with Tomcat 7.0.91+?
> 
> What might be the cause of the problem?

Might be related to a fix in TLD whitespace parsing. Can you provide the
TLD ?

Mark

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