开发了一个图书商城,可是运行时报这个错

cardhouse 发布于 2018/04/30 21:24
阅读 255
收藏 0

严重: Servlet.service() for servlet [CategoryServlet] in context with path [/goods] threw exception
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at cn.itcast.servlet.BaseServlet.service(BaseServlet.java:60)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at cn.itcast.filter.EncodingFilter.doFilter(EncodingFilter.java:30)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at cn.itcast.servlet.BaseServlet.service(BaseServlet.java:44)
    ... 21 more
Caused by: java.lang.RuntimeException: java.sql.SQLException: Connections could not be acquired from the underlying database!
    at cn.itcast.goods.category.service.CategoryService.findAll(CategoryService.java:89)
    at cn.itcast.goods.category.web.servlet.CategoryServlet.findAll(CategoryServlet.java:31)
    ... 26 more
Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
    at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:615)
    at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
    at cn.itcast.jdbc.JdbcUtils.getConnection(JdbcUtils.java:43)
    at cn.itcast.jdbc.TxQueryRunner.query(TxQueryRunner.java:30)
    at cn.itcast.goods.category.dao.CategoryDao.findAll(CategoryDao.java:69)
    at cn.itcast.goods.category.service.CategoryService.findAll(CategoryService.java:87)
    ... 27 more
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
    at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1406)
    at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:594)
    at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:514)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:681)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:608)
    ... 32 more
运行后报错的500,也不知道哪里有问题

加载中
0
不愿透露姓名的Mr成
不愿透露姓名的Mr成
可能是网络,防火墙问题。
0
郭里奥

从错误堆栈里看到的问题是 数据库连接除了问题,检查一下数据库连接的参数;查看一下数据库的连接数

0
铂金小狗
铂金小狗

这年头还有人用JAVA开发图书商城 , PHP7难道满足不了你 ?!~

0
尚浩宇
尚浩宇

换下druid试试

 

0
沙枣
沙枣

果断放弃。

返回顶部
顶部