2-10 验证Controller

来源:2-9 验证Sevice

幕布斯4782628

2021-03-29

老师好,在谷歌验证时,出现如下错误:
HTTP状态 500 - 内部服务器错误
类型 异常报告
消息 实例化Servlet类[org.springframework.web.servlet.DispatcherServlet]异常
描述 服务器遇到一个意外的情况,阻止它完成请求。
例外情况

javax.servlet.ServletException: 实例化Servlet类[org.springframework.web.servlet.DispatcherServlet]异常
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:544)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:698)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:364)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:616)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
org.apache.coyote.AbstractProtocolConnectionHandler.process(AbstractProtocol.java:831)org.apache.tomcat.util.net.NioEndpointConnectionHandler.process(AbstractProtocol.java:831) org.apache.tomcat.util.net.NioEndpointConnectionHandler.process(AbstractProtocol.java:831)org.apache.tomcat.util.net.NioEndpointSocketProcessor.doRun(NioEndpoint.java:1629)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:617)org.apache.tomcat.util.threads.TaskThreadWorker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThreadWorker.run(ThreadPoolExecutor.java:617)org.apache.tomcat.util.threads.TaskThreadWrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)
根本原因。

java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1372)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1195)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:544)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:698)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:364)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:616)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
org.apache.coyote.AbstractProtocolConnectionHandler.process(AbstractProtocol.java:831)org.apache.tomcat.util.net.NioEndpointConnectionHandler.process(AbstractProtocol.java:831) org.apache.tomcat.util.net.NioEndpointConnectionHandler.process(AbstractProtocol.java:831)org.apache.tomcat.util.net.NioEndpointSocketProcessor.doRun(NioEndpoint.java:1629)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:617)org.apache.tomcat.util.threads.TaskThreadWorker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThreadWorker.run(ThreadPoolExecutor.java:617)org.apache.tomcat.util.threads.TaskThreadWrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)

写回答

1回答

翔仔

2021-03-30

同学好,java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet

pom.xml里面没有引入相关的jar,和视频对比一下哈,这个是springmvc的jar没有引入

0
2
翔仔
回复
幕布斯4782628
404就是路由配置有问题了呢,需要对照视频进行配置
2021-04-01
共2条回复

Java双版本(SSM到SpringBoot)校园商铺全栈开发

SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需

5113 学习 · 8144 问题

查看课程