首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

Cause: java.sql.SQLException: 关闭的连接]; nested exception is com.ibatis.common.jdbc

2012-05-08 
Cause: java.sql.SQLException: 关闭的连接] nested exception is com.ibatis.common.jdbc.exception.Nes

Cause: java.sql.SQLException: 关闭的连接]; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException
错误如下:
  org.springframework.jdbc.UncategorizedSQLException: (SqlMapClient operation): encountered SQLException [  
--- The error occurred in com/unc/dao/ibatis/maps/SmscList.xml.  
--- The error occurred while applying a parameter map.  
--- Check the selectSmscListClassName-InlineParameterMap.  
--- Check the statement (query failed).  
--- Cause: java.sql.SQLException: 关闭的连接]; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred in com/unc/dao/ibatis/maps/SmscList.xml.  
--- The error occurred while applying a parameter map.  
--- Check the selectSmscListClassName-InlineParameterMap.  
--- Check the statement (query failed).  
--- Cause: java.sql.SQLException: 关闭的连接
com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred in com/unc/dao/ibatis/maps/SmscList.xml.  
--- The error occurred while applying a parameter map.  
--- Check the selectSmscListClassName-InlineParameterMap.  
--- Check the statement (query failed).  
--- Cause: java.sql.SQLException: 关闭的连接
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:185)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:615)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:589)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:95)
at org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:245)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:165)
at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:204)
at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:243)
at com.unc.dao.ibatis.SqlMapSmscListDAO.selectSmscListClassName(SqlMapSmscListDAO.java:54)
at com.unc.services.imp.ListServiceImpl.selectSmscListClassName(ListServiceImpl.java:78)
at com.unc.timing.TimingTask.getSendMessage(TimingTask.java:98)
at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:222)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:165)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:66)
at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
Caused by: java.sql.SQLException: 关闭的连接
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:207)
at oracle.jdbc.driver.OracleStatement.ensureOpen(OracleStatement.java:3520)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3265)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3389)
at com.caucho.sql.UserPreparedStatement.execute(UserPreparedStatement.java:126)
at com.caucho.sql.UserPreparedStatement.execute(UserPreparedStatement.java:126)


at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.ibatis.common.jdbc.logging.PreparedStatementLogProxy.invoke(PreparedStatementLogProxy.java:62)
at $Proxy3.execute(Unknown Source)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:186)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
... 20 more
2008-06-27 05:47:07,995 INFO [org.quartz.core.JobRunShell] - Job DEFAULT.timingJob threw a JobExecutionException: 


请各位朋友帮你个忙看看 是什么原因呢?spring+ibatis连接Oracle

[解决办法]
The error occurred in com/unc/dao/ibatis/maps/SmscList.xml.
--- The error occurred while applying a parameter map.
把相应的xml代码帖下
[解决办法]
SELECT list.MSG_LIST_ID as msgListId,
list.OPERATION_CODE as operationCode,
list.MESSAGE as message,
list.MOBILE as mobile,
list.SEND_TIME as sendTime,
list.IS_SEND as isSend,
list.COUNT as count,
list.PRIORITY as priority,
ser.class_name as className
FROM SMSC_MSG_LIST list,smsc_operation op,smsc_app app,smsc_server ser,smsc_enter en
where list.is_send in(0) and list.operation_code=op.operation_code
and send_time <=sysDate and op.enter_code=en.enter_code
and op.app_code=app.app_code and app.server_id=ser.server_id and rownum <= #rowNum#
order by list.is_send desc,priority desc 

把#rowNum#换成固定值,到数据库执行以下,看看好使不
[解决办法]
http://www.javaeye.com/article/32009
刚搜的
[解决办法]
1、你调用其他sql方法查询是否正确 如果没问题 证明你的数据库链接有问题
2、检查selectSmscListClassName方法,sql语句对吗
[解决办法]
应该是数据库链接问题

热点排行