java javax.servlet.ServletContext.getContextPath()Ljava/lang/String
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11897074/
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
javax.servlet.ServletContext.getContextPath()Ljava/lang/String
提问by U?ur Tangl
**hi friends i am new to use Tomcat6 i had everything done last week and Tomcat was worked. But now i can't use Tomcat6 other machine. I searched lot but i could not find true answer for my problem
**嗨,朋友们,我是使用 Tomcat6 的新手,上周我已经完成了所有工作,并且 Tomcat 工作正常。但是现在我不能使用Tomcat6其他机器。我搜索了很多,但我找不到我的问题的真正答案
please help me **
请帮我 **
SEVERE: Error deploying configuration descriptor host-manager.xml
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
at org.apache.catalina.core.StandardHost$MemoryLeakTrackingListener.lifecycleEvent(StandardHost.java:616)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4700)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
回答by Sai Ye Yan Naing Aye
It look like that you've an older version of the Servlet API somewhere in the classpath which overrides the Tomcat 6.0 Servlet API (Servlet API 2.5).
看起来您在类路径中的某个地方有一个旧版本的 Servlet API,它覆盖了 Tomcat 6.0 Servlet API (Servlet API 2.5)。
回答by Hasnain Ali Bohra
This is the weird ERROR. Causes of problem:- the servlet api which is in ur Java-Built path overrides the servlet-api of ur Tomcat Server. Solution :-first goto ur project Built path and remove ur Sevlet-api of version whuch is not supported by ur Tomcat Server 6. Then goto>Java Built Path > Libraries if u have the Apache Tomcat v6.0 [Apache Tomcat v6.0 ] library it is done. else goto > add Library > Server Runtime > and select Apache Tomcat v6.0 and click Ok.
这是奇怪的错误。问题原因:-您的Java-Built路径中的servlet api覆盖了您的Tomcat服务器的servlet-api。解决方案:-首先转到您的项目构建路径并删除您的 Tomcat Server 6 不支持的版本的 Sevlet-api。如果您有 Apache Tomcat v6.0 [Apache Tomcat v6.0,则转到>Java 构建路径>库] 库就完成了。否则转到 > 添加库 > 服务器运行时 > 并选择 Apache Tomcat v6.0 并单击确定。