本人在是刚入门的小白。。在学习中,一直在陆续的写这个练手的项目-ebook,前几天的时候运行的都很正常,突然今天一运行就报错。。这是在MyEclipse中将项目部署在tomcat上的不过不是自带的tomcat,自己加的插件。
异常如下:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class com.itany.jdbc.util.JDBCUtil
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:294)
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.NoClassDefFoundError: Could not initialize class com.itany.jdbc.util.JDBCUtil
com.itany.jdbc.util.JDBCTemplate.query(JDBCTemplate.java:103)
com.itany.ebook.dao.impl.ManagerDaoImpl.queryManagerById(ManagerDaoImpl.java:62)
com.itany.ebook.service.impl.ManagerServiceImpl.queryManagerById(ManagerServiceImpl.java:44)
com.itany.ebook.action.LoginAction.login(LoginAction.java:31)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
我的datasource.properties配置文件如下:
driverClassName=com.mysql.jdbc.Driver
url=jdbc:mysql://127.0.0.1:3306/ebook?useUnicode=true&characterEncoding=utf8
username=root
password=
maxActive=10
initialSize=10
maxWait=5000
求大神。。膜拜膜拜!~~~~~~~~