Eclipse & JSP: java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/207565/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse & JSP: java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZ)V
提问by Ville Salonen
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:
我正在使用 Eclipse 3.4 和 WTP 3.0.2 并运行一个相当大的动态 Web 项目。我已经设置了项目,以便我可以在http://127.0.0.1:8080/share/访问它,但是无论何时,我都会收到以下错误:
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?
由于上述文件都不是我自己的,因此很难指出问题的原因。任何想法从哪里开始寻找?
采纳答案by Ville Salonen
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.
我最终回答了我自己的问题:问题是我添加到 Tomcat 的必要 JAR 中有一个冲突的 servlet.jar。当我删除它时,错误消失了。
回答by Ville Salonen
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.
很可能是eclipse中的tomcat插件导致了冲突问题,我设法通过获取相同版本的jar文件并在eclipse中的tomcat插件中覆盖它来解决问题。
回答by Nitin
I had similar problem and I had fixed this problem by Ensuring that i have correct version of servlet.jarin the classpath that is being taken by my application and also i had kept old J2EE.jarfile 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.
我有类似的问题,我通过确保我的应用程序采用的类路径中有正确版本的servlet.jar解决了这个问题,并且我在类路径中保留了旧的J2EE.jar文件,这导致了主要问题。因此我从类路径中删除了它以确保它默认使用文件。
回答by Mathias Dam
I had the same problem running Eclipse Helios, with Maven handling dependencies and using Jetty as webserver. After updating to Spring 3.1 I suddenly got this problem, but only on my local development machine.
我在运行 Eclipse Helios 时遇到了同样的问题,Maven 处理依赖项并使用 Jetty 作为网络服务器。更新到 Spring 3.1 后,我突然遇到了这个问题,但仅限于我的本地开发机器上。
I first deleted the spring and jetty folders in my local maven repository and updated the dependencies, but that didn't improve the situation.
我首先删除了本地 maven 存储库中的 spring 和 jetty 文件夹并更新了依赖项,但这并没有改善情况。
Then I just deleted the servlet-api and servlet-api-2.5 folders that comes with jetty (but leaving everything else), I got it to work.
然后我只是删除了 jetty 附带的 servlet-api 和 servlet-api-2.5 文件夹(但保留了其他所有内容),我让它工作了。
All hail the magic of the classpath.
所有人都为类路径的魔力而欢呼。
回答by VonC
Did you set a Tomcat path in "Preferences->Tomcat->Advanced->Tomcat base" ?
您是否在“Preferences->Tomcat->Advanced->Tomcat base”中设置了Tomcat路径?
Try to clean that path (getting back to default configuration), and check if that does solve the problem.
尝试清理该路径(恢复默认配置),并检查是否确实解决了问题。