2013-11-17 14:30题主

请教:安装好了,无法访问wb,报javax.servlet.ServletContext.getContextPath()Ljava/lang/String错误

tomcat、jdk、mysql都装好,昨天晚上还好着呢,今天就不好使了,请教是什么错?该如何处理,谢谢。
下面是报错信息:

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
	com.webbuilder.common.Main.init(Main.java:58)
	javax.servlet.GenericServlet.init(GenericServlet.java:212)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
	org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	java.lang.Thread.run(Thread.java:619)

root cause

java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
	com.webbuilder.common.Main.init(Main.java:54)
	javax.servlet.GenericServlet.init(GenericServlet.java:212)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
	org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	java.lang.Thread.run(Thread.java:619)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.25 logs.

2013-11-17 21:45#1
应该是tomcat新旧版本冲突造成,网上有很多类似的解决方案。
2013-11-18 09:46#2
谢谢,我先baidu看看
2013-11-18 14:23#3
tomcat版本问题,改为tomcat6就ok了,谢谢。
2013-11-22 09:51#4
一台机器上装多个版本的tomcat没必要吧?
2013-12-17 15:05#5
能装好真的是个挑战,一台机子可以装到另外的机子就是不行。
2013-12-17 15:46#6
大部份的错误都是JNDI配置问题,特别是Tomcat环境下JNDI配置后的同步问题。
如在Web应用wb/META-INF/context.xml中配置好JNDI后,在Tomcat/conf/Catalina/localhost/wb.xml中的JNDI未同步过来,简单的办法是手动复制后同步一下即可。

返回开发者社区