从网上导入了一个简单的web项目,在注册功能提交时,转到UserService时,一直转圈圈,等了一分钟后跳出报错页面。。求解
你这样提问题就好比问“为什么我在吃饭的时候找不到筷子啊?”
可能是你的Tomcat服务器没启动
可能是数据库连接不上.....你最好贴下异常信息吧
HTTPStatus500-java.lang.reflect.InvocationTargetException
typeExceptionreport
messagejava.lang.reflect.InvocationTargetException
descriptionTheserverencounteredaninternalerrorthatpreventeditfromfulfillingthisrequest.
exception
java.lang.RuntimeException:java.lang.reflect.InvocationTargetException
cn.itcast.servlet.BaseServlet.service(BaseServlet.java:61)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
rootcause
java.lang.reflect.InvocationTargetException
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
cn.itcast.servlet.BaseServlet.service(BaseServlet.java:45)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
rootcause
java.lang.RuntimeException:java.sql.SQLException:Connectionscouldnotbeacquiredfromtheunderlyingdatabase!
cn.itcast.bookstore.user.dao.UserDao.findByUsername(UserDao.java:30)
cn.itcast.bookstore.user.service.UserService.regist(UserService.java:21)
cn.itcast.bookstore.user.web.servlet.UserServlet.regist(UserServlet.java:164)
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
cn.itcast.servlet.BaseServlet.service(BaseServlet.java:45)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
rootcause
java.sql.SQLException:Connectionscouldnotbeacquiredfromtheunderlyingdatabase!
com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:615)
com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
cn.itcast.jdbc.JdbcUtils.getConnection(JdbcUtils.java:43)
cn.itcast.jdbc.TxQueryRunner.query(TxQueryRunner.java:22)
cn.itcast.bookstore.user.dao.UserDao.findByUsername(UserDao.java:28)
cn.itcast.bookstore.user.service.UserService.regist(UserService.java:21)
cn.itcast.bookstore.user.web.servlet.UserServlet.regist(UserServlet.java:164)
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
cn.itcast.servlet.BaseServlet.service(BaseServlet.java:45)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
rootcause
com.mchange.v2.resourcepool.CannotAcquireResourceException:AResourcePoolcouldnotacquirearesourcefromitsprimaryfactoryorsource.
com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1406)
com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:594)
com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:514)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:681)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:608)
com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
cn.itcast.jdbc.JdbcUtils.getConnection(JdbcUtils.java:43)
cn.itcast.jdbc.TxQueryRunner.query(TxQueryRunner.java:22)
cn.itcast.bookstore.user.dao.UserDao.findByUsername(UserDao.java:28)
cn.itcast.bookstore.user.service.UserService.regist(UserService.java:21)
cn.itcast.bookstore.user.web.servlet.UserServlet.regist(UserServlet.java:164)
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
cn.itcast.servlet.BaseServlet.service(BaseServlet.java:45)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
noteThefullstacktraceoftherootcauseisavailableintheApacheTomcat/7.0.42logs.
不好意思啊,刚才明明截图发异常了,回头看却没有了。。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。