我在普通的java项目里可以用hibernate,但是在javaweb中就提示出现错误

 我百度有人说是少包,可是我换了几个版本的包还是不行,错误如下,

严重: Servlet.service() for servlet PersonInforServlet threw exception
java.lang.ClassNotFoundException: org.hibernate.cfg.Configuration
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
 at com.cet.Myservlet.PersonInforServlet.doPost(PersonInforServlet.java:57)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
 at java.lang.Thread.run(Thread.java:744)

 

树那边
浏览 2329回答 1
1回答

管理員

java.lang.ClassNotFoundException: org.hibernate.cfg.Configuration少包,不如把配置相关配置都贴出来,ClassNotFoundException类型 都小问题,很容易解决
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java