java.lang.NoClassDefFoundError: org/hibernate/Session

从我了解你提供的类路径中使用XML的Eclipse,它无关你的Web应用程序的类路径。你得到的NoClassDefFoundError的原因是Tomcat无法找到Hibernate类。确保你的网站模块具有所有必需的罐子在WEB-INF/lib目录。
已标记关键词 清除标记
相关推荐
写了一个 struts + hibernate 在 junit 中单独测试 hibernate 可以正常运行。 可是 在 struts的 Action 中调用 系统就报如下错误 严重: Servlet.service() for servlet action threw exception java.lang.NoClassDefFoundError: org/hibernate/Session at com.action.loginAction.execute(loginAction.java:24) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at com.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:27) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) at java.lang.Thread.run(Unknown Source) [b]问题补充:[/b] 但是 运行 junit测试是可以通过的!!
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页