NutzCN Logo
问答 connection holder is null
发布于 2552天前 作者 啊哈 3344 次浏览 复制 上一个帖子 下一个帖子
标签:

项目一直报connection holder is null ,不知道dao.js 要配置什么东西解决这个问题

8 回复

完整报错信息

2017-11-20 10:03:33:[WARN ][ org.nutz.mvc.impl.processor.FailProcessor.process(F
ailProcessor.java:28)] [org.nutz.mvc.impl.processor.FailProcessor]:Error@/html/c
orp/info/info1 :
org.nutz.dao.DaoException: java.sql.SQLException: connection holder is null
        at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:50)
        at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:205)
        at org.nutz.dao.impl.NutDao.fetch(NutDao.java:551)
        at jdk.nashorn.internal.scripts.Script$Recompilation$59571$87A$\^eval\_.
info(<eval>:14)
        at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunction
Data.java:642)
        at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.jav
a:228)
        at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:3
93)
        at jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectM
irror.java:199)
        at jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScrip
tEngine.java:383)
        at jdk.nashorn.api.scripting.NashornScriptEngine.invokeFunction(NashornS
criptEngine.java:190)
        at com.yyt.cos.bean.NashornRun.run(NashornRun.java:74)
        at com.yyt.cos.mvc.MvcAction.html(MvcAction.java:644)
        at sun.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvok
eProcessor.java:23)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
        at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor
.java:33)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
        at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFilt
ersProcessor.java:40)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
        at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.j
ava:113)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
        at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcess
or.java:27)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcesso
r.java:44)
        at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(
UpdateRequestAttributesProcessor.java:15)
        at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40)
        at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:64)
        at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
        at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:182)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52
)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:219)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:106)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:142)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:79)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAcce
ssLogValve.java:617)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:88)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:518)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
11Processor.java:1091)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:668)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpo
int.java:2463)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoin
t.java:2452)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskTh
read.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLException: connection holder is null
        at com.alibaba.druid.pool.DruidPooledConnection.checkStateInternal(Druid
PooledConnection.java:1120)
        at com.alibaba.druid.pool.DruidPooledConnection.checkState(DruidPooledCo
nnection.java:1113)
        at com.alibaba.druid.pool.DruidPooledConnection.setSavepoint(DruidPooled
Connection.java:976)
        at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:30)
        ... 50 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communicatio
ns link failure

The last packet successfully received from the server was 4,391 milliseconds ago
.  The last packet sent successfully to the server was 0 milliseconds ago.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1
121)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3603)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3492)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4043)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2809)
        at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1811)
        at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1725)
        at com.mysql.jdbc.ConnectionImpl.setSavepoint(ConnectionImpl.java:5522)
        at com.mysql.jdbc.ConnectionImpl.setSavepoint(ConnectionImpl.java:5501)
        at com.alibaba.druid.pool.DruidPooledConnection.setSavepoint(DruidPooled
Connection.java:979)
        at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:30)
        at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:205)
        at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:183)
        at com.yyt.sys.plug.Dao.list(Dao.java:131)
        at jdk.nashorn.internal.scripts.Script$Recompilation$12445$27036A$\^eval
\_.list1(<eval>:898)
        at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunction
Data.java:642)
        at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.jav
a:228)
        at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:3
93)
        at jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectM
irror.java:199)
        at jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScrip
tEngine.java:383)
        at jdk.nashorn.api.scripting.NashornScriptEngine.invokeFunction(NashornS
criptEngine.java:190)
        at com.yyt.cos.bean.NashornRun.run(NashornRun.java:74)
        at com.yyt.cos.mvc.MvcAction.json(MvcAction.java:166)
        at sun.reflect.GeneratedMethodAccessor94.invoke(Unknown Source)
        ... 38 more
Caused by: java.net.SocketException: Software caused connection abort: recv fail
ed
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
        at java.net.SocketInputStream.read(SocketInputStream.java:170)
        at java.net.SocketInputStream.read(SocketInputStream.java:141)
        at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.ja
va:114)
        at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNe
cessary(ReadAheadInputStream.java:161)
        at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.ja
va:189)
        at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:3049)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3503)
        ... 62 more

Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communicatio
ns link failure

网络问题?druid版本多少?

应该不是网路问题吧
版本 1.0.26的
线上项目一直在报哪个错误

线上项目一直在报那个错误

是不是超过数据库的连接数限制了?不是druid的连接数。

Aborted_connects	0
Connection_errors_accept	0
Connection_errors_internal	0
Connection_errors_max_connections	0
Connection_errors_peer_address	0
Connection_errors_select	0
Connection_errors_tcpwrap	0
Connections	155
Max_used_connections	43
Performance_schema_session_connect_attrs_lost	0
Ssl_client_connects	0
Ssl_connect_renegotiates	0
Ssl_finished_connects	0
Threads_connected	41
max_connections	1200

应该没有。最大是1200呢

换1.1.5试试吧😊

添加回复
请先登陆
回到顶部