在线等,非常着急,非常急,大家帮帮小弟啦!!!
项目之前运行非常的稳定,没有异常情况
但是项目自从换了服务器之后就出现这样的异常了。
1、项目分成两部分,主站和论坛(论坛与主站的数据库是分开的)。
2、主站首页需要显示论坛的内容(所以连接论坛时又新增了一个数据库连接,是用C3PO连接的)。
3、在主站注册会员的时候,同时把会员信息添加到论坛中(下面的异常就是注册会员添加到论坛时抛出的异常)。
疑点:主站首页显示论坛信息的时候没有发生异常,如果是C3PO连接有问题的话,那主站显示论坛信息的也应该发生异常,
但是只有会员注册的时候发生了异常,这是小弟迷惑的地方,希望各位大哥帮帮忙,谢谢!!!!
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:1307)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:551)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:471)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
at com.czsoft.tax.bbs.DBPool.getConnection(DBPool.java:43)
at com.czsoft.tax.bbs.UserDB.insert(UserDB.java:14)
at com.czsoft.tax.web.action.UserAction.add(UserAction.java:309)
at sun.reflect.GeneratedMethodAccessor709.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
------解决方案--------------------使用的什么论坛?论坛是否提供了这样的接口?检查一下外键约束。
------解决方案--------------------public? 想用单态还不如改成private呢。
我怀疑是主键的问题。
------解决方案--------------------com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
at com.czsoft.tax.bbs.DBPool.getConnection(DBPool.java: