简体   繁体   English

谁能告诉我为什么会这样“ org.hibernate.exception.GenericJDBCException:无法执行查询”?

[英]Can anyone tell me why this is happening “org.hibernate.exception.GenericJDBCException: could not execute query”?

Our server is running on client site from last one year, but last night suddenly the server stopped responding because of some SQL/Hibernate exception, but after restarting server everything started working again. 我们的服务器从去年开始就在客户端站点上运行,但是由于某些SQL / Hibernate异常,昨晚服务器突然停止响应,但是在重新启动服务器后,一切又重新开始工作。

Here is our hibernate configurations(.hbm.xml): 这是我们的休眠配置(.hbm.xml):

<property name="connection.driver_class">org.gjt.mm.mysql.Driver</property>
    <property name="connection.url">jdbc:mysql://127.0.0.1:3306/emessenger</property>
    <property name="hibernate.current_session_context_class">org.hibernate.context.ThreadLocalSessionContext</property>
    <property name="connection.username">root</property>
    <property name="connection.password">root</property>
    <property name="show_sql">false</property>
    <property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
    <property name="c3p0.min_size">1</property>
    <property name="c3p0.max_size">100</property>
    <property name="c3p0.timeout">5</property>
    <property name="c3p0.max_statements">0</property>

Here is the exception trace, (similar three exceptions has been thrown on that time, if you want i can show you those exceptions also): 这是异常跟踪,(当时您抛出了类似的三个异常,如果您希望我也可以向您显示这些异常):

    2014-02-05 02:18:47,116 ERROR [services.alert.AlertDB] [577]: Exception occured while fetching <alert_details> table for quikc message  
   org.hibernate.exception.GenericJDBCException: could not execute query
    at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    at org.hibernate.loader.Loader.doList(Loader.java:2223)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
    at org.hibernate.loader.Loader.list(Loader.java:2099)
    at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
    at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
    at services.alert.AlertDB.retrieveMessageDetails(AlertDB.java:568)
    at services.alert.Alert.getMessages(Alert.java:925)
    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 org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:212)
    at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
    at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
    at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
    at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
    at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:139)
    at org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:837)
    at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:273)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    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:127)
    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:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:619)
        Caused by: java.sql.SQLException: Query execution was interrupted
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1072)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3563)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3495)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2693)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2102)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2261)
    at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
    at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
    at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
    at org.hibernate.loader.Loader.doQuery(Loader.java:674)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
    at org.hibernate.loader.Loader.doList(Loader.java:2220)
    ... 34 more

Would anyone tell me what's wrong here, should we need to upgrade to new hibernate? 谁能告诉我这是怎么回事,我们是否需要升级到新的休眠模式? or some MySQL settings has to be changed? 还是必须更改某些MySQL设置? Or is it related to c3p0 configurations? 还是与c3p0配置有关?

Edited to add the first exception after which everything started: 编辑以添加第一个例外,之后一切开始:

[2014-02-05 02:18:26,085] WARN com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource : com.mchange.v2.resourcepool.BasicResourcePool@1b5c22f -- an attempt to checkout a resource was interrupted, and the pool is still live: some other thread must have either interrupted the Thread attempting checkout! 
 java.lang.InterruptedException
    at java.lang.Object.wait(Native Method)
    at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1315)
    at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
    at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
    at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
    at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:56)
    at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
    at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
    at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
    at org.hibernate.loader.Loader.doQuery(Loader.java:673)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
    at org.hibernate.loader.Loader.doList(Loader.java:2220)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
    at org.hibernate.loader.Loader.list(Loader.java:2099)
    at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
    at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
    at org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:305)
    at global.SessionMgmtListerner.thinClientStatus(SessionMgmtListerner.java:223)
    at global.SessionMgmtListerner.sessionDestroyed(SessionMgmtListerner.java:48)
    at org.apache.catalina.session.StandardSession.expire(StandardSession.java:708)
    at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:575)
    at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:700)
    at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:685)
    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1316)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
    at java.lang.Thread.run(Thread.java:619)

您正在使用旧的mysql驱动程序,请使用

com.mysql.jdbc.Driver

The nested exception suggests that something on the MySQL server-side has interrupted the query. 嵌套异常表明MySQL服务器端的某些内容中断了查询。 I suggest you check the MySQL logs, and the system log (on the database server) for clues as to the possible cause. 我建议您检查MySQL日志和系统日志(在数据库服务器上)以获取有关可能原因的线索。

There is not enough evidence to say whether the root cause is in Hibernate, C3PO, MySQL or the JDBC driver. 没有足够的证据说明根本原因是在Hibernate,C3PO,MySQL还是JDBC驱动程序中。 Or something else. 或者是其他东西。 Without knowing what the root cause, nobody can confidently suggest a fix. 不知道根本原因是什么,没有人可以自信地提出解决方案。 (Or at least, nobody can do that with justifiable confidence. IMO.) (或者至少没有人可以有正当的信心做到这一点。海事组织。)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ested异常是org.hibernate.exception.GenericJDBCException:无法执行查询 - ested exception is org.hibernate.exception.GenericJDBCException: could not execute query org.hibernate.exception.GenericJDBCException:无法执行查询]的根本原因 - org.hibernate.exception.GenericJDBCException: could not execute query] with root cause org.hibernate.exception.GenericJDBCException:无法执行查询 - org.hibernate.exception.GenericJDBCException: could not execute query org.hibernate.exception.GenericJDBCException:无法执行查询 - org.hibernate.exception.GenericJDBCException: could not execute query substr错误:org.hibernate.exception.GenericJDBCException:无法执行查询 - substr error: org.hibernate.exception.GenericJDBCException: could not execute query org.hibernate.exception.GenericJDBCException:无法在hibernate中执行语句 - org.hibernate.exception.GenericJDBCException: could not execute statement in hibernate org.hibernate.exception.GenericJDBCException:无法执行语句 - org.hibernate.exception.GenericJDBCException: could not execute statement 更新查询的 JPA @Query 注释(oracle sql 开发人员)--org.hibernate.exception.GenericJDBCException:无法执行查询 - JPA @Query annotation for update query (oracle sql developer) -- org.hibernate.exception.GenericJDBCException: could not execute query org.hibernate.exception.GenericJDBCException:执行此代码时无法执行查询异常 - org.hibernate.exception.GenericJDBCException: could not execute query Exception while executing this code org.hibernate.exception.GenericJDBCException:无法插入: - org.hibernate.exception.GenericJDBCException: could not insert:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM