在虚拟机中使用jfinal框架出现问题

schooljenry 发布于 2015/09/09 15:30
阅读 534
收藏 0

@JFinal 你好,想跟你请教个问题:

情况是这样的,我在虚拟机中使用jFinal框架,数据库安装在另一个虚拟机中,部署时正常,能够正常查询数据,就是更新数据时出现下面的错误。

[ERROR]-[Thread: http-bio-8080-exec-5]-[com.sc.base.company.CompanyController.save()]: 保存异常
com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: I/O Error: DB server closed connection.
    at com.jfinal.plugin.activerecord.Model.update(Model.java:424)
    at com.sc.base.company.CompanyController.save(CompanyController.java:122)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:55)
    at com.core.NoPowInterceptor.intercept(NoPowInterceptor.java:30)
    at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:51)
    at com.jfinal.plugin.activerecord.tx.TxByRegex$1.run(TxByRegex.java:55)
    at com.jfinal.plugin.activerecord.Db.tx(Db.java:617)
    at com.jfinal.plugin.activerecord.Db$pro.tx(Db.java:958)
    at com.jfinal.plugin.activerecord.tx.TxByRegex.intercept(TxByRegex.java:53)
    at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:51)
    at com.jfinal.core.ActionHandler.handle(ActionHandler.java:73)
    at com.jfinal.ext.handler.UrlSkipHandler.handle(UrlSkipHandler.java:45)
    at com.jfinal.ext.handler.UrlSkipHandler.handle(UrlSkipHandler.java:45)
    at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
    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:957)
    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:620)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLException: I/O Error: DB server closed connection.
    at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1053)
    at net.sourceforge.jtds.jdbc.TdsCore.microsoftPrepare(TdsCore.java:1179)
    at net.sourceforge.jtds.jdbc.ConnectionJDBC2.prepareSQL(ConnectionJDBC2.java:679)
    at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:503)
    at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
    at com.jfinal.plugin.activerecord.Db.update(Db.java:231)
    at com.jfinal.plugin.activerecord.Model.update(Model.java:417)
    ... 34 more
Caused by: java.io.IOException: DB server closed connection.
    at net.sourceforge.jtds.jdbc.SharedSocket.readPacket(SharedSocket.java:848)
    at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:727)
    at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:466)
    at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:103)
    at net.sourceforge.jtds.jdbc.ResponseStream.peek(ResponseStream.java:88)
    at net.sourceforge.jtds.jdbc.TdsCore.wait(TdsCore.java:3932)
    at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1046)
    ... 40 more

2015-09-09 00:03:05
[WARN]-[Thread: http-bio-8080-exec-5]-[com.mchange.v2.c3p0.impl.NewPooledConnection.handleThrowable()]: [c3p0] A PooledConnection that has already signalled a Connection error is still in use!

2015-09-09 00:03:05
[WARN]-[Thread: http-bio-8080-exec-5]-[com.mchange.v2.c3p0.impl.NewPooledConnection.handleThrowable()]: [c3p0] Another error has occurred [ java.sql.SQLException: Invalid state, the Connection object is closed. ] which will not be reported to listeners!
java.sql.SQLException: Invalid state, the Connection object is closed.
    at net.sourceforge.jtds.jdbc.ConnectionJDBC2.checkOpen(ConnectionJDBC2.java:1699)
    at net.sourceforge.jtds.jdbc.ConnectionJDBC2.commit(ConnectionJDBC2.java:2085)
    at com.mchange.v2.c3p0.impl.NewProxyConnection.commit(NewProxyConnection.java:803)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.jfinal.plugin.activerecord.SqlReporter.invoke(SqlReporter.java:58)
    at com.sun.proxy.$Proxy5.commit(Unknown Source)
    at com.jfinal.plugin.activerecord.Db.tx(Db.java:619)
    at com.jfinal.plugin.activerecord.Db$pro.tx(Db.java:958)
    at com.jfinal.plugin.activerecord.tx.TxByRegex.intercept(TxByRegex.java:53)
    at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:51)
    at com.jfinal.core.ActionHandler.handle(ActionHandler.java:73)
    at com.jfinal.ext.handler.UrlSkipHandler.handle(UrlSkipHandler.java:45)
    at com.jfinal.ext.handler.UrlSkipHandler.handle(UrlSkipHandler.java:45)
    at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
    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:957)
    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:620)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

2015-09-09 00:03:05
[WARN]-[Thread: http-bio-8080-exec-5]-[com.mchange.v2.c3p0.impl.NewPooledConnection.handleThrowable()]: [c3p0] A PooledConnection that has already signalled a Connection error is still in use!

加载中
0
JFinal
JFinal
异常信息是: java.sql.SQLException: I/O Error: DB server closed connection. 表明是数据库主动关闭了连接,检查客户端所使用的 ip 以及 user 和 password 是否可以正常访问这个数据库
0
糊搞

引用来自“JFinal”的评论

异常信息是: java.sql.SQLException: I/O Error: DB server closed connection. 表明是数据库主动关闭了连接,检查客户端所使用的 ip 以及 user 和 password 是否可以正常访问这个数据库

楼主的问题是说:“能够正常查询数据,就是更新数据时出现下面的错误

也就是说,连接没有问题,执行时出错

0
红星xx
红星xx

linux 中的 数据库 有问题 吧 , 数据 库 data 没有 写权限 ,能读 ,但是写 就 数据库报错 ,关闭连接 ,

不知道是不是这个原因

0
南湖船老大
南湖船老大
selinux 关了没?
子矜
子矜
selinux经常坑人~
0
12叔
12叔
可能没有写权限
返回顶部
顶部