spring mvc hibernate eclipse报如下错误,怎么回事? 10C

HTTP Status 500 – Internal Server Error
Type Exception Report

Message Servlet.init() for servlet [spring-mvc] threw exception

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

javax.servlet.ServletException: Servlet.init() for servlet [spring-mvc] threw exception
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:501)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Unknown Source)
Root Cause

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.alibaba.dao.DAONewsByHibernate] for bean with name 'daoNews' defined in ServletContext resource [/WEB-INF/spring-mvc-servlet.xml]; nested exception is java.lang.ClassNotFoundException: com.alibaba.dao.DAONewsByHibernate
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.alibaba.dao.DAONewsByHibernate] for bean with name 'daoNews' defined in ServletContext resource [/WEB-INF/spring-mvc-servlet.xml]; nested exception is java.lang.ClassNotFoundException: com.alibaba.dao.DAONewsByHibernate
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.alibaba.services.NewsService] for bean with name 'newsService' defined in ServletContext resource [/WEB-INF/spring-mvc-servlet.xml]; nested exception is java.lang.ClassNotFoundException: com.alibaba.services.NewsService
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.alibaba.controllers.NewsController] for bean with name 'newsController' defined in ServletContext resource [/WEB-INF/spring-mvc-servlet.xml]; nested exception is java.lang.ClassNotFoundException: com.alibaba.controllers.NewsController
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:563)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

17个回答

把servlet-api.jar这个jar去掉试一下,该jar包可能会与eclipse自带tomcat中该jar冲突,导致500,望采纳

bean 配错了吧图片说明

看错误里都是:java.lang.ClassNotFoundException,估计是缺少com.alibaba的jar包。

大兄弟,你检查一下配置文件,如果没问题的话就是映射的问题了

应该是jar包没有导入

报500一般是参数不对或请求非法,看一下参数是不是写错了

推测:1.xml配置文件路径不对,2.没有那个类和方法

共17条数据 首页 2
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐