问题描述
最近弄一个在考试系统jsp+servlet+mysql有dbcp的连接池数据库中有图片开始开发的时候什么都没问题可是上到服务器访问人数超过40这个项目中有数据库操作的功能就不能访问了
解决方案
解决方案二:
你配置的数据连接池maxActive是不是限制了你的访问量啊?改下maxActive="100"就应该好了
解决方案三:
数据库操作的功能就不能访问了这个很明显的原因是连接池的最大连接数应该被占满。需要把连接池的最大连接数。楼上正解。
解决方案四:
我的链接数配了1000怎么可能用完啊
解决方案五:
<Resourcename="jdbc/onlinetest"auth="Container"type="javax.sql.DataSource"maxActive="1000"maxIdle="2000"maxWait="-1"username="root"password="123456"driverClassName="com.mysql.jdbc.Driver"url="jdbc:mysql://172.19.69.199:3306/onlinetest?autoReconnect=true"/>
解决方案六:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:Thedriverwasunabletocreateaconnectionduetoaninabilitytoestablishtheclientportionofasocket.Thisisusuallycausedbyalimitonthenumberofsocketsimposedbytheoperatingsystem.Thislimitisusuallyconfigurable.ForUnix-basedplatforms,seethemanualpageforthe'ulimit'command.Kernelorsystemreconfigurationmayalsoberequired.ForWindows-basedplatforms,seeMicrosoftKnowledgeBaseArticle196271(Q196271).连接建立错误atsun.reflect.GeneratedConstructorAccessor28.newInstance(UnknownSource)atsun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)atjava.lang.reflect.Constructor.newInstance(Constructor.java:513)atcom.mysql.jdbc.Util.handleNewInstance(Util.java:406)atcom.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)atcom.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2104)atcom.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:729)atcom.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)atsun.reflect.GeneratedConstructorAccessor6.newInstance(UnknownSource)atsun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)atjava.lang.reflect.Constructor.newInstance(Constructor.java:513)atcom.mysql.jdbc.Util.handleNewInstance(Util.java:406)atcom.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)atcom.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:283)atjava.sql.DriverManager.getConnection(DriverManager.java:582)atjava.sql.DriverManager.getConnection(DriverManager.java:185)atcom.test.util.DbUtil.getConnection(DbUtil.java:52)atcom.test.util.DbUtil.executeQueryBySql(DbUtil.java:118)atcom.test.dao.impl.CyDaoImpl.findAllCy(CyDaoImpl.java:72)atcom.test.biz.impl.CyBizImpl.findAllCy(CyBizImpl.java:24)atcom.test.web.StuLoginServlet.doPost(StuLoginServlet.java:126)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:637)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:717)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atcom.test.util.EncodeChinese.doFilter(EncodeChinese.java:23)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)atorg.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)atorg.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)atjava.lang.Thread.run(Thread.java:619)