Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Struts Tag Libraries / NoSuchMethodException

Status
Not open for further replies.

sdupont73

Programmer
Jan 30, 2004
2
US
I'm just getting struts 1.1 up and running with Tomcat 5.0. Tomcat is running fine. I am attempting to use the Struts Logic Tag Library by adding :

<%@ taglib uri=&quot;/WEB-INF/struts-logic.tld&quot; prefix=&quot;logic&quot; %>

... to the top of my jsp. I have my tld files in the correct place as shown above. I have all the struts jars in my classpath. My application is up and running fine. However, as soon as i add the tag library include and reload my jsp, I get a NoSuchMethodException:

2004-01-30 15:29:07 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZ)V
at org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(TagLibraryInfoImpl.java:573)
at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:433)
at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:291)
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:205)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:458)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:523)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
at org.apache.jasper.compiler.Parser.parse(Parser.java:171)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:253)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:137)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:552)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)

It appears that Jasper is trying call a 2-String constructor of javax.servlet.jsp.tagext.TagAttributeInfo. However, I have looked at the jasper source and it specifically calls the appropriate 5 param ctor. I am utterly baffled by this out-of-nowhere exception.

I am wondering if anyone else has encountered this problem and the steps they took to solve it.

Thanks in advance
 
Yes, the tlds are correctly in place.

After looking at this more carefully, I begin to suspect that TagLibraryInfoImpl.createAttribute() IS actually calling the 5 param constructor. Upon careful examination ...

java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZ)V

... the 'Z's actually probably represent boolean params. The ctor, thus takes as params: a String, a boolean, String, boolean, boolean. In fact, this is just the constructor that TagAttributeInfo has. I now therefore suspect that somewhere in my set of libraries is an older version of that class that superceded the one I know exists in the most recent servlet.jar. Do you concur?

Thanks.
 
I was having the same problem after upgrading my JBoss 3.2.3 server configuration from Tomcat 4.x to 5.0.x.

I had copied the /jboss-3.2.3/docs/examples/tomcat/jbossweb-tomcat50.sar to my server configuration without using the build script they provide (same directory: build-tc5-config.xml).

The important step that was missed as a result of my copying by hand was that the javax.servlet.jar should not be under your /jboss-3.2.3/server/<you configuration>/lib directory when using Tomcat 5.0.x. So I just whacked it and now everything is fine!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top