views:

2744

answers:

5

I'm using Eclipse 3.4 with WTP 3.0.2 and running a fairly large Dynamic Web Project. I've set up the project so that I can access it at http://127.0.0.1:8080/share/ but whenever I do, I get the following error:

  java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.(Ljava/lang/String;ZLjava/lang/String;ZZ)V
  at org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(TagLibraryInfoImpl.java:572)
  at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:401)
  at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:248)
  at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:162)
  at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:423)
  at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
  at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1552)
  at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
  at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
  at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
  at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)
  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
  at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
  at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
  at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
  at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
  at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
  at java.lang.Thread.run(Unknown Source)

As none of the above files is my own, pointing out the cause of the problem is quite hard. Any ideas where to start looking?

A: 

Did you set a Tomcat path in "Preferences->Tomcat->Advanced->Tomcat base" ?

Try to clean that path (getting back to default configuration), and check if that does solve the problem.

VonC
+1  A: 

I ended up answering my own question: the problem was that among the necessary JARs that I had added to Tomcat was a conflicting servlet.jar. When I removed this, the error disappeared.

Ville Salonen
+1  A: 

Hi, i am getting the same problem.....and checked the Tomcat path in "Preferences->Tomcat->Advanced->Tomcat base" . There is nothing defined here, still i am getting this error. Please help.

A: 

most probably the tomcat plugin in the eclipse cause the conflict problem, i manage to solve the problem by getting the same version jar file and override it in the tomcat plugin in the eclipse.

A: 

I had similar problem and I had fixed this problem by Ensuring that i have correct version of servlet.jar in the classpath that is being taken by my application and also i had kept old J2EE.jar file in the classpath and that was causing the main problem. Hence I removed it from the classpath to ensure that it uses by default files.

Nitin
This will only cause future trouble. You should NEVER include server-specific libraries in webapp-specific library like `/WEB-INF/lib`. You should NEVER copy/duplicate loose server-specific JAR files around. `servlet.jar` is Tomcat specific. `j2ee.jar` is Glassfish specific. Don't mix them. Keep them there where they belongs, in the server's library. All you basically need to do is to add its file system path to the classpath (build path). In Eclipse, all you need to do is to integrate the server in *Servers* view and associate it with project by *Targeted Runtime* in project properties.
BalusC