报错信息如下: java.lang.ClassNotFoundException:com.mysql.jdbc.Driver in EnvironmentClassLoader[web-app:http://localhost:8080/PetHospital] at com.caucho.loader.DynamicClassLoader.loadClass(DynamicClassLoader.java:1224) at com.caucho.loader.DynamicClassLoader.loadClass(DynamicClassLoader.java:1203) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at com.sjh.dbc.DBConnection.<init>(DBConnection.java:16) at com.sjh.dao.proxy.UserDAOProxy.<init>(UserDAOProxy.java:16) at com.sjh.dao.factory.DAOFactory.getUserDaoInstanceof(DAOFactory.java:12) at com.sjh.servlet.loginServlet.doPost(loginServlet.java:33) at javax.servlet.http.HttpServlet.service(HttpServlet.java:153) at javax.servlet.http.HttpServlet.service(HttpServlet.java:91) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273) at com.caucho.server.port.TcpConnection.run(TcpConnection.java:682) at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:730) at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:649) at java.lang.Thread.run(Thread.java:619)
------解决方案--------------------
------解决方案-------------------- 你的mysql的diver jar包 没有发布到web工程中
------解决方案-------------------- java.lang.ClassNotFoundException:com.mysql.jdbc.Driver in EnvironmentClassLoader[web-app:http://localhost:8080/PetHospital]