qq_27664787
Toaok
2017-09-30 04:17

NoClassDefFoundError:

  • server
  • apache
  • tomcat
  • hibernate
  • 框架

我在Inteillj IDEA上搭建Hibernate框架时,测试代码可以运行但在tomcat中就报错:
HTTP Status 500 - Servlet execution threw an exception

type Exception report

message Servlet execution threw an exception

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

exception

javax.servlet.ServletException: Servlet execution threw an exception
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause

java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
com.dissertaion.bbms.utils.HibernateSessionFactory.getSessionFactory(HibernateSessionFactory.java:14)
com.dissertaion.bbms.utils.HibernateSessionFactory.getSession(HibernateSessionFactory.java:18)
com.dissertaion.bbms.dao.BaseDao.getSession(BaseDao.java:25)
com.dissertaion.bbms.dao.impl.BookDaoImpl.getValue(BookDaoImpl.java:31)
com.dissertaion.bbms.service.impl.BookServiceImpl.getValue(BookServiceImpl.java:23)
com.dissertaion.bbms.servlet.BookServlet.search(BookServlet.java:46)
com.dissertaion.bbms.servlet.BookServlet.doPost(BookServlet.java:37)
com.dissertaion.bbms.servlet.BookServlet.doGet(BookServlet.java:27)
javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause

java.lang.ClassNotFoundException: org.hibernate.cfg.Configuration
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
com.dissertaion.bbms.utils.HibernateSessionFactory.getSessionFactory(HibernateSessionFactory.java:14)
com.dissertaion.bbms.utils.HibernateSessionFactory.getSession(HibernateSessionFactory.java:18)
com.dissertaion.bbms.dao.BaseDao.getSession(BaseDao.java:25)
com.dissertaion.bbms.dao.impl.BookDaoImpl.getValue(BookDaoImpl.java:31)
com.dissertaion.bbms.service.impl.BookServiceImpl.getValue(BookServiceImpl.java:23)
com.dissertaion.bbms.servlet.BookServlet.search(BookServlet.java:46)
com.dissertaion.bbms.servlet.BookServlet.doPost(BookServlet.java:37)
com.dissertaion.bbms.servlet.BookServlet.doGet(BookServlet.java:27)
javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.78 logs.

Apache Tomcat/7.0.78

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答

为你推荐

换一换