使用JSP和Servlet发布json对象时遇到了一些问题。我使用的是tomcat 6.0和JDK 1.7.0_09。我想我包括了所有必要的jar。这是错误信息:
java.lang.ClassNotFoundException:org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)处的JsonParser,org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)处的JsonParser。 org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)上的catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1128)在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 129)位于org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)位于org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)位于org.apache.catalina.valves.ErrorReportValve org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :)上的.invoke(ErrorReportValve.java:103):109),位于org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861),位于org.apache.coyote.http11.Http11Protocol的org.apache.catalina.connector.CoyoteAdapter.java(293) org.apache.tomcat.util.net.JIoEndpoint $ Worker.run(JIoEndpoint.java:489)处的$ Http11ConnectionHandler.process(Http11Protocol.java:606)在java.lang.Thread.run(Thread.java:722) 2013年1月4日上午10:24:07 org.apache.catalina.core.StandardWrapperValve调用SEVERE:为servlet JsonParser java.lang.ClassNotFoundException分配异常:org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java上的JsonParser :1680),位于org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1128),位于org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1128),位于org.apache.catalina.loader.WebappClassLoader.java。 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)为org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)处的StandardWrapper.allocate(StandardWrapper.java:827) org.apache.catalina.valves.ErrorReportValve的.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)。org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)处org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)处invoke(ErrorReportValve.java:103) org.apache.coyote.http11.Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:606)上的.coyote.http11.Http11Processor.process(Http11Processor.java:861)在org.apache.tomcat.util.net.JIoEndpoint $ Worker .run(JIoEndpoint.java:489)在java.lang.Thread.run(Thread.java:722)org.apache.tomcat.util.net.JIoEndpoint $ Worker.run(JIoEndpoint.java:489)上的Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:606)在java.lang.Thread.run(Thread.java:722)org.apache.tomcat.util.net.JIoEndpoint $ Worker.run(JIoEndpoint.java:489)上的Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:606)在java.lang.Thread.run(Thread.java:722)
java.lang.ClassNotFoundException:org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)处的JsonParser,org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)处的JsonParser。 org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)上的catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1128)在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 129)位于org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)位于org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)位于org.apache.catalina.valves.ErrorReportValve org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :)上的.invoke(ErrorReportValve.java:103):109),位于org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861),位于org.apache.coyote.http11.Http11Protocol的org.apache.catalina.connector.CoyoteAdapter.java(293) org.apache.tomcat.util.net.JIoEndpoint $ Worker.run(JIoEndpoint.java:489)处的$ Http11ConnectionHandler.process(Http11Protocol.java:606)在java.lang.Thread.run(Thread.java:722)
2013年1月4日上午10:24:07 org.apache.catalina.core.StandardWrapperValve调用SEVERE:为servlet JsonParser java.lang.ClassNotFoundException分配异常:org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java上的JsonParser :1680),位于org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1128),位于org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1128),位于org.apache.catalina.loader.WebappClassLoader.java。 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)为org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)处的StandardWrapper.allocate(StandardWrapper.java:827) org.apache.catalina.valves.ErrorReportValve的.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)。org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)处org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)处invoke(ErrorReportValve.java:103) org.apache.coyote.http11.Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:606)上的.coyote.http11.Http11Processor.process(Http11Processor.java:861)在org.apache.tomcat.util.net.JIoEndpoint $ Worker .run(JIoEndpoint.java:489)在java.lang.Thread.run(Thread.java:722)org.apache.tomcat.util.net.JIoEndpoint $ Worker.run(JIoEndpoint.java:489)上的Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:606)在java.lang.Thread.run(Thread.java:722)org.apache.tomcat.util.net.JIoEndpoint $ Worker.run(JIoEndpoint.java:489)上的Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:606)在java.lang.Thread.run(Thread.java:722)
关于出什么问题有什么想法吗?
确保您已正确命名软件包,因为
在Tomcat 4.x及更高版本中,JSP的软件包永远不会与默认软件包相同。