问题描述
java.lang.ClassNotFoundException:com.mysql.jdbc.Driveratorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)atjava.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)atjava.lang.Class.forName0(NativeMethod)atjava.lang.Class.forName(Class.java:169)atcom.struts.dao.DAO.<init>(DAO.java:17)atcom.struts.action.StudentAction.execute(StudentAction.java:23)atorg.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)atorg.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)atorg.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)atorg.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:710)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:803)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)atorg.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)atjava.lang.Thread.run(Thread.java:619)java.lang.ClassNotFoundException:com.mysql.jdbc.Driveratorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)atjava.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)atjava.lang.Class.forName0(NativeMethod)atjava.lang.Class.forName(Class.java:169)atcom.struts.dao.DAO.<init>(DAO.java:17)atcom.struts.action.StudentAction.execute(StudentAction.java:23)atorg.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)atorg.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)atorg.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)atorg.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:710)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:803)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)atorg.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)atjava.lang.Thread.run(Thread.java:619)这个用struts创建的验证用户名可用不可用,不连接mysql的时候可以用,但是连接mysql以后就会报这个错,这是怎么回事???
解决方案
解决方案二:
导入mysql的驱动包试试看!
解决方案三:
引用1楼qq164681187的回复:
导入mysql的驱动包试试看!
+1java.lang.ClassNotFoundException:com.mysql.jdbc.Driver很明显未找到mysql的jar包。
解决方案四:
没有mysql驱动包或导入包不正确