新人求解,关于javaWeb的点击注册的报错信息。

从网上导入了一个简单的web项目,在注册功能提交时,转到UserService时,一直转圈圈,等了一分钟后跳出报错页面。。求解

5个回答

你这样提问题就好比问“为什么我在吃饭的时候找不到筷子啊?”

可能是你的Tomcat服务器没启动

可能是数据库连接不上.....你最好贴下异常信息吧

HTTP Status 500 - java.lang.reflect.InvocationTargetException

type Exception report

message java.lang.reflect.InvocationTargetException

description The server encountered an internal error that prevented it from fulfilling this request.

exception

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
cn.itcast.servlet.BaseServlet.service(BaseServlet.java:61)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
root cause

java.lang.reflect.InvocationTargetException
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
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)
root cause

java.lang.RuntimeException: java.sql.SQLException: Connections could not be acquired from the underlying database!
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(Native Method)
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)
root cause

java.sql.SQLException: Connections could not be acquired from the underlying database!
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(Native Method)
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)
root cause

com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
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(Native Method)
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)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.42 logs.

不好意思啊,刚才明明截图发异常了,回头看却没有了。。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问