在线急等spring的jdbc.UncategorizedSQLException异常

异常信息为:
org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; [http-nio-31103-exec-3] Timeout: Pool empty. Unable to fetch a connection in 1 seconds, none available[size:30; busy:30; idle:0; lastwait:1000].; nested exception is org.apache.tomcat.jdbc.pool.PoolExhaustedException: [http-nio-31103-exec-3] Timeout: Pool empty. Unable to fetch a connection in 1 seconds, none available[size:30; busy:30; idle:0; lastwait:1000].

1个回答

楼主你好,请问你用的是什么数据库?什么数据库框架呢?hibernate、mybaties???你最好看一下自己数据库表字段是否和Java实体类映射的上

a18729216266
一直特立独行的猫 谢谢、我这个使用的是mysql数据库、用的是Spring的JdbcTemplate、已找到问题、大致是我这个方法需要返回新增记录的主键、用到了keyHolder、可能是使用的方式不正确、所以报此异常
3 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
org.springframework.jdbc.UncategorizedSQLException
springboot+mybatis连接oracle数据库,select报错,insert,update,delete都没问题 org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column 'STROPERATORQQ' from result set. Cause: java.sql.SQLException: 无法转换为内部表示 ; uncategorized SQLException; SQL state [99999]; error code [17059]; 无法转换为内部表示; nested exception is java.sql.SQLException: 无法转换为内部表示 然后对比了一下也没发现任何问题![数据库字段](https://img-ask.csdn.net/upload/201904/25/1556178496_404830.png)![映射](https://img-ask.csdn.net/upload/201904/25/1556178504_418839.png)![实体](https://img-ask.csdn.net/upload/201904/25/1556178513_816348.png) SQL就是一句最简单的: SELECT * FROM OPERATOR WHERE OPERATOR.LNGOPERATORID = ? 对比都没发现问题,已经纠结好久了,求大神帮帮忙!
spring4.0+jdbc+oracle获取自增主键
最近在用spring4.0,用spring的jdbctemplate,从oracle数据库中添加数据,然后获取自增主键,可是出现的问题,可以正常的插入数据但是不能获取到主键值,请大家帮忙看看。我用的oracle驱动是ojdbc6.jar,oracle是11g,下面是我的代码 //保存数据的代码 public int saveProduct(){ KeyHolder kh = new GeneratedKeyHolder(); final String sql = "insert into n_show(id,cname) values(seq_niupai.nextval,?)"; jdbc.update(new PreparedStatementCreator() { @Override public PreparedStatement createPreparedStatement(Connection conn) throws SQLException { // TODO Auto-generated method stub PreparedStatement ps = conn.prepareStatement(sql); ps.setString(1, "111"); return ps; } }, kh); int key = kh.getKey().intValue(); return key; } 运行后能正常的插入数据 下面是错误,有点长,请大家耐心看看,谢谢!! 8:01:10,470 DEBUG org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator:281 - Unable to translate SQLException with Error code '17090', will now try the fallback translator 18:01:10,470 DEBUG org.springframework.jdbc.support.SQLStateSQLExceptionTranslator:95 - Extracted SQL state class '99' from value '99999' 18:01:10,471 DEBUG org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver:134 - Resolving exception from handler [public java.lang.String com.lanrui.web.shopadmin.ProductSetController.saveorupdatePro(javax.servlet.http.HttpServletRequest,org.springframework.ui.ModelMap)]: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL []; SQL state [99999]; error code [17090]; 不允许的操作; nested exception is java.sql.SQLException: 不允许的操作 18:01:10,473 DEBUG org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver:134 - Resolving exception from handler [public java.lang.String com.lanrui.web.shopadmin.ProductSetController.saveorupdatePro(javax.servlet.http.HttpServletRequest,org.springframework.ui.ModelMap)]: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL []; SQL state [99999]; error code [17090]; 不允许的操作; nested exception is java.sql.SQLException: 不允许的操作 18:01:10,474 DEBUG org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver:134 - Resolving exception from handler [public java.lang.String com.lanrui.web.shopadmin.ProductSetController.saveorupdatePro(javax.servlet.http.HttpServletRequest,org.springframework.ui.ModelMap)]: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL []; SQL state [99999]; error code [17090]; 不允许的操作; nested exception is java.sql.SQLException: 不允许的操作 18:01:10,475 DEBUG org.springframework.web.servlet.DispatcherServlet:969 - Could not complete request org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL []; SQL state [99999]; error code [17090]; 不允许的操作; nested exception is java.sql.SQLException: 不允许的操作 at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:84) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:630) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:913) at com.lanrui.dao.ProductDao.saveProduct(ProductDao.java:107) at com.lanrui.service.ProductService.saveproduct(ProductService.java:58) at com.lanrui.web.shopadmin.ProductSetController.saveorupdatePro(ProductSetController.java:110) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
JTA使用Propagation.NESTED事务传播方式报错
# JTA使用Propagation.NESTED事务传播方式报错 spring boot配置JTA后,使用Propagation.NESTED事务传播方式,出现异常,切换其他传播方式代码正常。 <br/> 事务配置: A service: @Transactional @Override public void saveOrUpdate(Msg msg) { msgJDBCDAO.save(msg); MsgReceiver msgReceiver = new MsgReceiver(); msgReceiver.setId(msg.getMsgId()); msgReceiver.setMsgId(msg.getMsgId()); msgReceiver.setUserId(1000L); msgReceiver.setReadFlag(0); msgReceiver.setDeleteFlag(0); msgReceiverJDBCService.save(msgReceiver); } B service: @Transactional(propagation = Propagation.NESTED) @Override public void save(MsgReceiver msgReceiver) { msgReceiverJDBCDAO.save(msgReceiver); } <br/> <br/><br/><br/> ## 报错信息如下: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [insert into t_msg_receiver values (?, ?, ?, ?, ?)]; SQL state [null]; error code [0]; Failed to suspend branch: XAResourceTransaction: 3139322E3136382E3232372E322E746D313537343036303233343835373030303031:3139322E3136382E3232372E322E746D31; nested exception is com.atomikos.jdbc.AtomikosSQLException: Failed to suspend branch: XAResourceTransaction: 3139322E3136382E3232372E322E746D313537343036303233343835373030303031:3139322E3136382E3232372E322E746D31 at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1442) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:632) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:861) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:916) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:926) at com.spring.boot.example.dao.jdbc.MsgReceiverJDBCDAO.save(MsgReceiverJDBCDAO.java:16) at com.spring.boot.example.dao.jdbc.MsgReceiverJDBCDAO$$FastClassBySpringCGLIB$$bdb85c72.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) at com.spring.boot.example.dao.jdbc.MsgReceiverJDBCDAO$$EnhancerBySpringCGLIB$$6e56ffb6.save(<generated>) at com.spring.boot.example.service.jdbc.impl.MsgReceiverJDBCServiceImpl.save(MsgReceiverJDBCServiceImpl.java:21) at com.spring.boot.example.service.jdbc.impl.MsgReceiverJDBCServiceImpl$$FastClassBySpringCGLIB$$a40f40ea.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) at com.spring.boot.example.service.jdbc.impl.MsgReceiverJDBCServiceImpl$$EnhancerBySpringCGLIB$$65349f92.save(<generated>) at com.spring.boot.example.service.jdbc.impl.MsgJDBCServiceImpl.saveOrUpdate(MsgJDBCServiceImpl.java:46) at com.spring.boot.example.service.jdbc.impl.MsgJDBCServiceImpl$$FastClassBySpringCGLIB$$a07b1dd9.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) at com.spring.boot.example.service.jdbc.impl.MsgJDBCServiceImpl$$EnhancerBySpringCGLIB$$ecf643bf.saveOrUpdate(<generated>) at com.spring.boot.example.service.MsgJDBCServiceTest.test(MsgJDBCServiceTest.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74) at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) Caused by: com.atomikos.jdbc.AtomikosSQLException: Failed to suspend branch: XAResourceTransaction: 3139322E3136382E3232372E322E746D313537343036303233343835373030303031:3139322E3136382E3232372E322E746D31 at com.atomikos.jdbc.AtomikosSQLException.throwAtomikosSQLException(AtomikosSQLException.java:29) at com.atomikos.jdbc.AtomikosConnectionProxy.enlist(AtomikosConnectionProxy.java:217) at com.atomikos.jdbc.AtomikosConnectionProxy.invoke(AtomikosConnectionProxy.java:122) at com.sun.proxy.$Proxy98.prepareStatement(Unknown Source) at org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator.createPreparedStatement(JdbcTemplate.java:1555) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:614) ... 63 more Caused by: com.atomikos.datasource.xa.session.InvalidSessionHandleStateException: Failed to suspend branch: XAResourceTransaction: 3139322E3136382E3232372E322E746D313537343036303233343835373030303031:3139322E3136382E3232372E322E746D31 at com.atomikos.datasource.xa.session.BranchEnlistedStateHandler.transactionSuspended(BranchEnlistedStateHandler.java:98) at com.atomikos.datasource.xa.session.TransactionContext.transactionSuspended(TransactionContext.java:94) at com.atomikos.datasource.xa.session.SessionHandleState.notifyBeforeUse(SessionHandleState.java:165) at com.atomikos.jdbc.AtomikosConnectionProxy.enlist(AtomikosConnectionProxy.java:207) ... 67 more Caused by: com.mysql.cj.jdbc.MysqlXAException: XAER_INVAL: Invalid arguments (or unsupported command) at com.mysql.cj.jdbc.MysqlXAConnection.mapXAExceptionFromSQLException(MysqlXAConnection.java:344) at com.mysql.cj.jdbc.MysqlXAConnection.dispatchCommand(MysqlXAConnection.java:329) at com.mysql.cj.jdbc.MysqlXAConnection.end(MysqlXAConnection.java:267) at com.atomikos.datasource.xa.XAResourceTransaction.xaSuspend(XAResourceTransaction.java:700) at com.atomikos.datasource.xa.session.BranchEnlistedStateHandler.transactionSuspended(BranchEnlistedStateHandler.java:94) ... 70 more Caused by: java.sql.SQLException: XAER_INVAL: Invalid arguments (or unsupported command) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:764) at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:648) at
本人使用的是spring mvc c3p0 不知道怎么回事 总数服务器蹦了
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; An attempt by a client to checkout a Connection has timed out
Spring+Mybatis 向oracle的Clob字段插入报错 在线等!
项目是使用Spring+SpringMVC+Mybatis构建的,使用JUnit4写了个测试类直接调用serivice层的update方法是可以成功插入,但是在Controler层调用service中的update方法就报错,下o: Cause: java.sql.SQLException: 数据大小超出此类型的最大值: 35845 ; uncategorized SQLException for SQL []; SQL state [null]; error code [17070]; 数据大小超出此类型的最大值: 35845; nested exception is java.sql.SQLException: 数据大小超出此类型的最大值: 35845 org.springframework.jdbc.UncategorizedSQLException: ### Error updating database. Cause: java.sql.SQLException: 数据大小超出此类型的最大值: 35845 ### The error may involve com.ffcs.cq.repository.mybatis.work.BugMybatisDao.update-Inline ### The error occurred while setting parameter DETAIL=? WHERE DBID = ? ### Cause: java.sql.SQLException: 数据大小超出此类型的最大值: 3650 ; uncategorized SQLException for SQL []; SQL state [null]; error code [17070]; 数据大小超出此类型的最大值: 3650; nested exception is java.sql.SQLException: 数据大小超出此类型的最大值: 3650 at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:84) ~[spring-jdbc-4.0.5.RELEASE.jar:4.0.5.RELEASE] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-4.0.5.RELEASE.jar:4.0.5.RELEASE] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-4.0.5.RELEASE.jar:4.0.5.RELEASE] at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) ~[mybatis-spring-1.2.2.jar:1.2.2] at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371) ~[mybatis-spring-1.2.2.jar:1.2.2] at com.sun.proxy.$Proxy18.update(Unknown Source) ~[na:na] at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:254) ~[mybatis-spring-1.2.2.jar:1.2.2] at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:54) ~[mybatis-3.2.8.jar:3.2.8] at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52) ~[mybatis-3.2.8.jar:3.2.8] at com.sun.proxy.$Proxy35.update(Unknown Source) ~[na:na] at com.ffcs.cq.service.work.BugService.modify(BugService.java:395) ~[BugService.class:na] at com.ffcs.cq.service.work.BugService$$FastClassBySpringCGLIB$$83194116.invoke(<generated>) ~[spring-core-4.0.5.RELEASE.jar:na] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.0.5.RELEASE.jar:4.0.5.RELEASE] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) ~[spring-aop-4.0.5.RELEASE.jar:4.0.5.RELEASE]
junit 测试时出错SQLException
org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [SELECT PRICE FROM BOOK WHILE isbn=?]; SQL state [null]; error code [17004]; 无效的列类型; nested exception is java.sql.SQLException: 无效的列类型 at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:602) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:636) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:665) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:673) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:728) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:744) at org.springframework.jdbc.core.JdbcTemplate.queryForInt(JdbcTemplate.java:775) at com.cn.spring.tx.BookShopDaoImpl.findBookPriceByIsbn(BookShopDaoImpl.java:15) at com.cn.spring.tx.SpringTransactionTest.testBookShopDaoFindPriceByIsbn(SpringTransactionTest.java:19) 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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41) at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:220) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.sql.SQLException: 无效的列类型 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208) at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:9168) at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8749) at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:9471) at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:9454) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setObject(NewProxyPreparedStatement.java:365) at org.springframework.jdbc.core.StatementCreatorUtils.setValue(StatementCreatorUtils.java:351) at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal(StatementCreatorUtils.java:216) at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue(StatementCreatorUtils.java:144) at org.springframework.jdbc.core.ArgPreparedStatementSetter.doSetValue(ArgPreparedStatementSetter.java:65) at org.springframework.jdbc.core.ArgPreparedStatementSetter.setValues(ArgPreparedStatementSetter.java:46) at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:641) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586) ... 32 more
索引中丢失IN或OUT参数问题
添加操作,第一次页面输入,添加成功;第二次输入数据,添加就报错错信息误如下:(断点查看参数并无异常) ==============异常开始============= org.springframework.jdbc.UncategorizedSQLException: ### Error updating database. Cause: java.sql.SQLException: 索引中丢失 IN 或 OUT 参数:: 8 ### The error may involve AccountFlowApplyMapper.save-Inline ### The error occurred while setting parameters ### SQL: insert into "PLATFORM_ACCOUNT_FLOW_APPLY" ( "ID", "APPLY_TIME", "UPDATE_TIME", "FLOW_TYPE", "AMOUNT", "TYPE", "OPERATE", "STATUS", "APPLY_USER", "VERIFY_USER" ) values ( account_flow_apply_seq.nextval, sysdate, sysdate, ?, ?, ?, ?, ?, ?, ? ) ### Cause: java.sql.SQLException: 索引中丢失 IN 或 OUT 参数:: 8 ; uncategorized SQLException for SQL []; SQL state [null]; error code [17041]; 索引中丢失 IN 或 OUT 参数:: 8; nested exception is java.sql.SQLException: 索引中丢失 IN 或 OUT 参数:: 8 at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:84) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:71) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:364)
Spring 配置weblogic中的JNDI数据源,发现部分模块数据查询失败
配置了weblogic的数据源(经测试可用),在项目applicationContext.xml文件中做了如下修改: ``<bean id="defaultDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="JNDI/Szzjj"></property> </bean> `` 启动项目后发现,有部分模块easyUI datagrid列表展示不出数据,但是可以保存添加数据,后台报错为: ``` org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL []; SQL state [99999]; error code [17104]; SQL statement to execute cannot be empty or null; nested exception is java.sql.SQLException: SQL statement to execute cannot be empty or null at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:84) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:649) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:684) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:711) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:761) at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:192) at cn.jasgroup.jasframework.dataaccess3.core.BaseNamedParameterJdbcTemplate.queryForList(BaseNamedParameterJdbcTemplate.java:284) at cn.jasgroup.jasframework.dataaccess.springhelper.JdbcDaoHelper.getPage(JdbcDaoHelper.java:533) at cn.jasgroup.jasframework.dataaccess.base.BaseJdbcDao.getPage(BaseJdbcDao.java:282) at cn.jasgroup.jasframework.engine.service.AbstractCommonDataService.getPage(AbstractCommonDataService.java:197) at cn.jasgroup.jasframework.engine.service.AbstractCommonDataService$$FastClassBySpringCGLIB$$6c27ab1d.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) at cn.jasgroup.entmanagement.gasservicepoint.service.GasServicePointService$$EnhancerBySpringCGLIB$$6aae7027.getPage(<generated>) at cn.jasgroup.entmanagement.gasservicepoint.controller.GasServicePointController.getPage(GasServicePointController.java:245) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:220) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:134) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78) at cn.jasgroup.jasframework.security.base.SetCacheFilter.doFilter(SetCacheFilter.java:42) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78) at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78) at cn.jasgroup.jasframework.dataaccess.filter.DataSourceFilter.doFilter(DataSourceFilter.java:46) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3706) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3672) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:328) at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197) at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203) at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71) at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269) at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1705) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1665) at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272) at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352) at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337) at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57) at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41) at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:652) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:420) at weblogic.work.ExecuteThread.run(ExecuteThread.java:360) Caused by: java.sql.SQLException: SQL statement to execute cannot be empty or null at oracle.jdbc.driver.PhysicalConnection.prepareStatementInternal(PhysicalConnection.java:1642) at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:1620) at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:1547) at weblogic.jdbc.common.internal.ConnectionEnv.makeStatement(ConnectionEnv.java:2206) at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:1902) at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:1816) at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:1809) at weblogic.jdbc.wrapper.Connection.prepareStatement(Connection.java:658) at org.springframework.jdbc.core.PreparedStatementCreatorFactory$PreparedStatementCreatorImpl.createPreparedStatement(PreparedStatementCreatorFactory .java:238) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:627) ... 71 more ``` ,各位大神有知道什么原因的吗?是缺少什么东西吗?用Tomcat的jndi测试没有问题,可以正常展示。
执行insert操作时报错,求问错误原因
在程序执行一个insert操作时,出现报错,求问各位大佬问题出在哪里? 报错为: org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; --- The error occurred while applying a parameter map. --- Check the IfapChatRecord.insertSelective-InlineParameterMap. --- Check the parameter mapping for the 'content' property. --- Cause: java.lang.IllegalStateException: Spring transaction synchronization needs to be active for setting values in iBATIS TypeHandlers that delegate to a Spring LobHandler; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred while applying a parameter map. --- Check the IfapChatRecord.insertSelective-InlineParameterMap. --- Check the parameter mapping for the 'content' property. --- Cause: java.lang.IllegalStateException: Spring transaction synchronization needs to be active for setting values in iBATIS TypeHandlers that delegate to a Spring LobHandler
java 如何保存、读取数据库字段为blob类型的值
java 如何保存、读取javaBean中定义String类型,oracle数据库字段为blob类型的值 这是我的业务逻辑代码 try { String encoding = "GBK"; File file = new File("E:\\workspaceNeuSoft\\tomcat7.0.40\\logs\\localhost.2015-12-07.log"); if (file.isFile() && file.exists()) { // 判断文件是否存在 InputStreamReader read = new InputStreamReader( new FileInputStream(file), encoding);// 考虑到编码格式 BufferedReader bufferedReader = new BufferedReader(read); String lineTxt = null; while ((lineTxt = bufferedReader.readLine()) != null) { // System.out.println(lineTxt); interfaceLog.setFwqIp(ip); interfaceLog.setJkLog(lineTxt); interfaceLogService.createInterfaceLog(interfaceLog); } read.close(); } else { System.out.println("找不到指定的文件"); } } catch (Exception e) { System.out.println("读取文件内容出错"); e.printStackTrace(); } 这个是mybatis中代码 <insert id="save" parameterType="interfaceLog"> <selectKey keyProperty="rowId" order="BEFORE" resultType="long"> SELECT seq_neu_interfacelog_id.NEXTVAL FROM DUAL </selectKey> <![CDATA[ INSERT INTO neu_interfacelog DS (DS.ROW_ID, DS.CREATE_BY, DS.CREATE_DATE, DS.REMARK, DS.FWQ_IP, DS.INTERFACELOG ) VALUES (#{rowId}, #{createBy}, SYSDATE, #{remark}, #{fwqIp}, #{jkLog}) ]]> </insert> 现在控制台报异常 015-12-08 15:00:00,620 INFO org.quartz.plugins.history.LoggingTriggerHistoryPlugin.triggerComplete:432 - Trigger neuSoftWorkPlatform_TRIGGER_GROUP.interfaceLogExpireBean completed firing job neuSoftWorkPlatform_JOB_GROUP.interfaceLogExpire at 15:00:00 12/08/2015 with resulting trigger instruction code: DO NOTHING org.springframework.jdbc.UncategorizedSQLException: ### Error updating database. Cause: java.sql.SQLException: ORA-01465: 无效的十六进制数字 ### The error may exist in file [E:\workspaceNeuSoft\neuSoftWorkPlatform\neuSoftWorkPlatform-biz\target\classes\mybatis\mappers\interfaceLog\InterfaceLogMapper.xml] ### The error may involve com.neusoft.interfaceLog.dao.InterfaceLogDAO.save-Inline ### The error occurred while setting parameters ### SQL: INSERT INTO neu_interfacelog DS (DS.ROW_ID, DS.CREATE_BY, DS.CREATE_DATE, DS.REMARK, DS.FWQ_IP, DS.INTERFACELOG ) VALUES (?, ?, SYSDATE, ?, ?, ?) ### Cause: java.sql.SQLException: ORA-01465: 无效的十六进制数字 ; uncategorized SQLException for SQL []; SQL state [72000]; error code [1465]; ORA-01465: 无效的十六进制数字 ; nested exception is java.sql.SQLException: ORA-01465: 无效的十六进制数字 at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:71) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365) at com.sun.proxy.$Proxy27.insert(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:237) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:79) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:40) at com.sun.proxy.$Proxy86.save(Unknown Source) at com.neusoft.interfaceLog.service.impl.InterfaceLogServiceImpl.createInterfaceLog(InterfaceLogServiceImpl.java:60) at com.haier.openplatform.showcase.quartz.InterfaceLogExpireJob.execute(InterfaceLogExpireJob.java:52) at org.quartz.core.JobRunShell.run(JobRunShell.java:213) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) Caused by: java.sql.SQLException: ORA-01465: 无效的十六进制数字 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216) at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:955) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285) at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3390) at com.haier.openplatform.jdbc.HOPPraparedStatement$3.run(HOPPraparedStatement.java:183) at com.haier.openplatform.jdbc.HOPPraparedStatement$3.run(HOPPraparedStatement.java:180) at com.haier.openplatform.jdbc.HOPPraparedStatement.doProfile(HOPPraparedStatement.java:382) at com.haier.openplatform.jdbc.HOPPraparedStatement.execute(HOPPraparedStatement.java:180) at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:41) at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:66) at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:45) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:108) at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:145) at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:134) 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:601) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:355) ... 9 more
spring+ibatis分布式事务异常!!
spring + ibatis框架,使用jotm分布式事务控制,在运行过程中偶尔会出现异常,请高手指点。 spring配置文件: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> <!--指定Spring配置中用到的属性文件 --> <bean id="propertyConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>WEB-INF/config/db/jdbc.properties</value> <value>WEB-INF/config/db/webservice.properties</value> <!-- <value>WEB-INF/config/db/cache.properties</value> --> <!-- 类路径的写法 <value>classpath:com/dhc/epos/demo/conf/jdbc-demo.properties</value> --> </list> </property> <property name="fileEncoding" value="UTF-8" /> </bean> <!-- 分布式事务的配置方式 begin --> <bean id="jotm" class="org.springframework.transaction.jta.JotmFactoryBean"> <property name="defaultTimeout" value="500000"/> </bean> <bean id="jtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name="userTransaction" ref="jotm" /> </bean> <bean id="dataSource" class="org.enhydra.jdbc.pool.StandardXAPoolDataSource" destroy-method="close"> <property name="dataSource"> <bean class="org.enhydra.jdbc.standard.StandardXADataSource" destroy-method="shutdown"> <property name="transactionManager" ref="jotm" /> <property name="driverName" value="${jdbc11.driverName}" /> <property name="url" value="${jdbc11.url}" /> <property name="user" value="${jdbc11.user}" /> <property name="password" value="${jdbc11.password}" /> </bean> </property> <property name="user" value="${jdbc11.user}" /> <property name="password" value="${jdbc11.password}" /> </bean> <bean id="dataSourceBi" class="org.enhydra.jdbc.pool.StandardXAPoolDataSource" destroy-method="close"> <property name="dataSource"> <bean class="org.enhydra.jdbc.standard.StandardXADataSource" destroy-method="shutdown"> <property name="transactionManager" ref="jotm" /> <property name="driverName" value="${jdbc6.driverName}" /> <property name="url" value="${jdbc6.url}" /> <property name="user" value="${jdbc6.user}" /> <property name="password" value="${jdbc6.password}" /> </bean> </property> <property name="user" value="${jdbc6.user}" /> <property name="password" value="${jdbc6.password}" /> </bean> <bean id="dataSourceWms" class="org.enhydra.jdbc.pool.StandardXAPoolDataSource" destroy-method="close"> <property name="dataSource"> <bean class="org.enhydra.jdbc.standard.StandardXADataSource" destroy-method="shutdown"> <property name="transactionManager" ref="jotm" /> <property name="driverName" value="${jdbc6.driverName}" /> <property name="url" value="${jdbc6.url}" /> <property name="user" value="${jdbc6.user}" /> <property name="password" value="${jdbc6.password}" /> </bean> </property> <property name="user" value="${jdbc6.user}" /> <property name="password" value="${jdbc6.password}" /> </bean> <bean id="dataSourceCrm" class="org.enhydra.jdbc.pool.StandardXAPoolDataSource" destroy-method="close"> <property name="dataSource"> <bean class="org.enhydra.jdbc.standard.StandardXADataSource" destroy-method="shutdown"> <property name="transactionManager" ref="jotm" /> <property name="driverName" value="${jdbc6.driverName}" /> <property name="url" value="${jdbc6.url}" /> <property name="user" value="${jdbc6.user}" /> <property name="password" value="${jdbc6.password}" /> </bean> </property> <property name="user" value="${jdbc6.user}" /> <property name="password" value="${jdbc6.password}" /> </bean> <!-- 分布式事务的配置方式 end --> <tx:advice id="txAdvice" transaction-manager="jtaTransactionManager"> <tx:attributes> <tx:method name="get*" read-only="true" /> <tx:method name="find*" read-only="true" /> <tx:method name="exclusive__*" propagation="REQUIRES_NEW" rollback-for="Exception"/> <tx:method name="*" propagation="REQUIRED" rollback-for="Exception" /> </tx:attributes> </tx:advice> <aop:config> <aop:advisor pointcut="execution(* *..as*..*(..))" advice-ref="txAdvice"/> </aop:config> <!-- 与数据库类型无关的序号生成器 end --> <import resource="classpath:com/dhc/sms/*/conf/applicationContext*.xml" /> <import resource="classpath:com/dhc/sms/ifm/*/conf/applicationContext*.xml" /> </beans> 异常信息: exception in ReceiveVipLevelDaoImpl.doInsertVipLevelList; nested exception is org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; --- The error occurred in /com/dhc/sms/webservice/crm/points/dao/ibatis/maps/ifm_vip_level_temp_et.xml. --- The error occurred while executing mapped statement. --- Check the IfmVipLevelTem.insert. --- Check the statement or the result map. --- Cause: java.sql.SQLException: StandardXAConnectionHandle:prepareStatement should not be used outside an EJBServer; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in /com/dhc/sms/webservice/crm/points/dao/ibatis/maps/ifm_vip_level_temp_et.xml. --- The error occurred while executing mapped statement. --- Check the IfmVipLevelTem.insert. --- Check the statement or the result map. --- Cause: java.sql.SQLException: StandardXAConnectionHandle:prepareStatement should not be used outside an EJBServer
ibatis oracle连接异常关闭
2016-07-04 11:01:50,762 INFO [org.springframework.jdbc.support.SQLErrorCodesFactory] - SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase] 2016-07-04 11:02:11,795 WARN [org.springframework.jdbc.support.SQLErrorCodesFactory] - Error while extracting database product name - falling back to empty error codes org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (IO 错误: The Network Adapter could not establish the connection) at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:296) at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:320) at org.springframework.jdbc.support.SQLErrorCodesFactory.getErrorCodes(SQLErrorCodesFactory.java:212) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.setDataSource(SQLErrorCodeSQLExceptionTranslator.java:141) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.<init>(SQLErrorCodeSQLExceptionTranslator.java:104) at org.mybatis.spring.MyBatisExceptionTranslator.initExceptionTranslator(MyBatisExceptionTranslator.java:83) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:70) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:364) at sun.proxy.$Proxy8.selectOne(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:159) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:66) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:35) at sun.proxy.$Proxy18.selectByAaaaId(Unknown Source) at com.richeninfo.esop.kms.admin.dao.KmsAdminDao.selectByAaaaId(KmsAdminDao.java:58) at com.richeninfo.esop.kms.admin.service.KmsAdminManager.selectByAaaaId(KmsAdminManager.java:77) at com.richeninfo.esop.kms.admin.controller.AdminController.login(AdminController.java:201) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:471) at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:408) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:774) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) 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 javacommon.filter.LoggerMDCFilter.doFilterInternal(LoggerMDCFilter.java:43) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 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(Unknown Source) Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (IO 错误: The Network Adapter could not establish the connection) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:855) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at net.sf.log4jdbc.DataSourceSpyInterceptor.invoke(DataSourceSpyInterceptor.java:20) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at sun.proxy.$Proxy6.getConnection(Unknown Source) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:214) at sun.proxy.$Proxy19.getMetaData(Unknown Source) at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:285) ... 49 more Caused by: java.sql.SQLException: IO 错误: The Network Adapter could not establish the connection at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:419) at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:536) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521) at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851) ... 65 more Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:375) at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:422) at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:678) at oracle.net.ns.NSProtocol.connect(NSProtocol.java:238) at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1054) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:308) ... 73 more Caused by: java.net.ConnectException: Connection timed out: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:201) at oracle.net.nt.ConnOption.connect(ConnOption.java:123) at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:353) ... 78 more org.springframework.jdbc.UncategorizedSQLException:
java+Spring+mybatis 查询sql报错:无效的序列号!
java+Spring+mybatis+lucens+达梦数据库。应该能判断和数据库和lucen没关系。,着急在线等! mybatis: <select id="countByGroup" resultType="int" parameterType="java.util.Map"> SELECT COUNT(*) FROM "user_task" <where> <if test="title!=null"> "title" like '%"#{title}"%' </if> <if test="status!=null"> And "status"=#{status} </if> And <foreach item="item" index="index" collection="groupIds" open="(" separator=" OR " close=")"> "group_id" LIKE '%"#{item}"%'</foreach> </where> </select> 如下报错 三月 13, 2015 3:17:47 下午 cn.com.people.data.pds.framework.filter.UrlFilter doFilter 信息: ====>URI : /bmcms/admin/column/dm org.springframework.jdbc.UncategorizedSQLException: ### Error querying database. Cause: java.sql.SQLException: 序列号无效 ### The error may exist in cn/com/people/data/pds/user/dao/UserTaskMapper.xml ### The error may involve cn.com.people.data.pds.user.dao.UserTaskMapper.countByGroup-Inline ### The error occurred while setting parameters ### SQL: SELECT COUNT(*) FROM "user_task" WHERE "title" like '%"?"%' And "status"=? And ( "group_id" LIKE '%"?"%' OR "group_id" LIKE '%"?"%' OR "group_id" LIKE '%"?"%') ### Cause: java.sql.SQLException: 序列号无效 ; uncategorized SQLException for SQL []; SQL state [HY093]; error code [6010]; 序列号无效; nested exception is java.sql.SQLException: 序列号无效 at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371) at com.sun.proxy.$Proxy16.selectOne(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:163) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:43) at com.sun.proxy.$Proxy44.countByGroup(Unknown Source) at cn.com.people.data.pds.library.controller.ColumnController.countByUserId(ColumnController.java:72) 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 org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) 。。。 。。。 。。。 Caused by: java.sql.SQLException: 序列号无效 at dm.jdbc.dbaccess.DBError.throwSQLException(DBError.java:52) at dm.jdbc.driver.DmdbPreparedStatement_bs.checkIndexInner(DmdbPreparedStatement_bs.java:145) at dm.jdbc.driver.DmdbPreparedStatement_bs.paramBindPrepare(DmdbPreparedStatement_bs.java:153) at dm.jdbc.driver.DmdbPreparedStatement_bs.setInt(DmdbPreparedStatement_bs.java:999) at dm.jdbc.driver.DmdbPreparedStatement.setInt(DmdbPreparedStatement.java:308) at org.apache.ibatis.type.IntegerTypeHandler.setNonNullParameter(IntegerTypeHandler.java:28) at org.apache.ibatis.type.IntegerTypeHandler.setNonNullParameter(IntegerTypeHandler.java:23) at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:46) at org.apache.ibatis.type.UnknownTypeHandler.setNonNullParameter(UnknownTypeHandler.java:42) at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:46) at org.apache.ibatis.scripting.defaults.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:77) at org.apache.ibatis.executor.statement.PreparedStatementHandler.parameterize(PreparedStatementHandler.java:77) at org.apache.ibatis.executor.statement.RoutingStatementHandler.parameterize(RoutingStatementHandler.java:58) at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:71) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:56) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:259) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:132) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81) at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:46) at cn.com.people.data.pds.framework.orm.mybatis.pageable.MyBatisPageableInterceptor.intercept(MyBatisPageableInterceptor.java:104) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:57) at com.sun.proxy.$Proxy33.query(Unknown Source) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:62) at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358) ... 90 more
重复的事务标识,求解决方案,框架:springMVC+mybatis,数据库oracle
项目总是隔两天报一次错误:重复的事物标识,报错的sql总是涉及到 使用 db_link的sql语句,重启项目后就好了,求高手解答!!! 报错内容如下: ``` HTTP Status 500 - Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: type Exception report message Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: description The server encountered an internal error that prevented it from fulfilling this request. exception org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: ### Error querying database. Cause: java.sql.SQLException: ORA-24757: 重复的事务处理标识 ORA-02063: 紧接着 line (起自 XBZHPDB) ### The error may exist in file [C:\tomcat\apache-tomcat-7.0.70\webapps\webApi\WEB-INF\classes\com\petrochina\mapping\StaypxsjhMapper.xml] ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: SELECT nvl(sum(A.XSL/A.ZB),0) FROM (SELECT nvl(sum(QY_PFWCL+ QY_LSWCL+CY_PFWCL+ CY_LSWCL),0) as XSL,MZXNJG, (select AREA_SCZB FROM BASE_PROVINCIAL_AREA@xbzhpdb WHERE AREA_SQBM = MZXNJG) as ZB FROM STA_YPXSJH_WC WHERE to_char(CALDAY,'yyyy-mm-dd') BETWEEN ? and ? GROUP BY MZXNJG) A WHERE A.ZB is not null ### Cause: java.sql.SQLException: ORA-24757: 重复的事务处理标识 ORA-02063: 紧接着 line (起自 XBZHPDB) ; uncategorized SQLException for SQL []; SQL state [99999]; error code [24757]; ORA-24757: 重复的事务处理标识 ORA-02063: 紧接着 line (起自 XBZHPDB) ; nested exception is java.sql.SQLException: ORA-24757: 重复的事务处理标识 ORA-02063: 紧接着 line (起自 XBZHPDB) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:973) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) root cause org.springframework.jdbc.UncategorizedSQLException: ### Error querying database. Cause: java.sql.SQLException: ORA-24757: 重复的事务处理标识 ORA-02063: 紧接着 line (起自 XBZHPDB) ### The error may exist in file [C:\tomcat\apache-tomcat-7.0.70\webapps\webApi\WEB-INF\classes\com\petrochina\mapping\StaypxsjhMapper.xml] ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: SELECT nvl(sum(A.XSL/A.ZB),0) FROM (SELECT nvl(sum(QY_PFWCL+ QY_LSWCL+CY_PFWCL+ CY_LSWCL),0) as XSL,MZXNJG, (select AREA_SCZB FROM BASE_PROVINCIAL_AREA@xbzhpdb WHERE AREA_SQBM = MZXNJG) as ZB FROM STA_YPXSJH_WC WHERE to_char(CALDAY,'yyyy-mm-dd') BETWEEN ? and ? GROUP BY MZXNJG) A WHERE A.ZB is not null ### Cause: java.sql.SQLException: ORA-24757: 重复的事务处理标识 ORA-02063: 紧接着 line (起自 XBZHPDB) ; uncategorized SQLException for SQL []; SQL state [99999]; error code [24757]; ORA-24757: 重复的事务处理标识 ORA-02063: 紧接着 line (起自 XBZHPDB) ; nested exception is java.sql.SQLException: ORA-24757: 重复的事务处理标识 ORA-02063: 紧接着 line (起自 XBZHPDB) org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:84) org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371) com.sun.proxy.$Proxy13.selectOne(Unknown Source) org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:163) org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:68) org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52) com.sun.proxy.$Proxy30.queryShengTotalZhanBi(Unknown Source) com.petrochina.service.impl.staypxsjhServiceImpl.XBWL_scgk(staypxsjhServiceImpl.java:383) com.petrochina.controller.HomeController.XBWL_scgk(HomeController.java:1041) sun.reflect.GeneratedMethodAccessor146.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:690) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) note The full stack trace of the root cause is available in the Apache Tomcat/7.0.70 logs. Apache Tomcat/7.0.70 ```
刚刚学有点懵逼了500 - Request processing failed
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型: 1111 ; uncategorized SQLException for SQL []; SQL state [99999]; error code [17004]; 无效的列类型: 1111; nested exception is java.sql.SQLException: 无效的列类型: 1111 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:948) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838) javax.servlet.http.HttpServlet.service(HttpServlet.java:648) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) root cause org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型: 1111 ; uncategorized SQLException for SQL []; SQL state [99999]; error code [17004]; 无效的列类型: 1111; nested exception is java.sql.SQLException: 无效的列类型: 1111 org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:71) org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:364) com.sun.proxy.$Proxy8.selectOne(Unknown Source) org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:159) org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63) org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:43) com.sun.proxy.$Proxy16.loginman(Unknown Source) com.dlsp.dao.impl.UserLoginDaoImpl.loginman(UserLoginDaoImpl.java:23) com.dlsp.controller.PaiMaicontroler.denglu(PaiMaicontroler.java:46) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838) javax.servlet.http.HttpServlet.service(HttpServlet.java:648) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) root cause java.sql.SQLException: 无效的列类型: 1111 oracle.jdbc.driver.OracleStatement.getInternalType(OracleStatement.java:3900) oracle.jdbc.driver.OraclePreparedStatement.setNullCritical(OraclePreparedStatement.java:4406) oracle.jdbc.driver.OraclePreparedStatement.setNull(OraclePreparedStatement.java:4388) oracle.jdbc.driver.OraclePreparedStatementWrapper.setNull(OraclePreparedStatementWrapper.java:1281) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:63) com.sun.proxy.$Proxy18.setNull(Unknown Source) org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:39) org.apache.ibatis.scripting.defaults.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:77) org.apache.ibatis.executor.statement.PreparedStatementHandler.parameterize(PreparedStatementHandler.java:77) org.apache.ibatis.executor.statement.RoutingStatementHandler.parameterize(RoutingStatementHandler.java:58) org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:71) org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:56) org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:259) org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:132) org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105) org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81) org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104) org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98) org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:62) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:354) com.sun.proxy.$Proxy8.selectOne(Unknown Source) org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:159) org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63) org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:43) com.sun.proxy.$Proxy16.loginman(Unknown Source) com.dlsp.dao.impl.UserLoginDaoImpl.loginman(UserLoginDaoImpl.java:23) com.dlsp.controller.PaiMaicontroler.denglu(PaiMaicontroler.java:46) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838) javax.servlet.http.HttpServlet.service(HttpServlet.java:648) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
spring jdbctemplate操作clob
jdk1.6+tomcat6 oracle11g驱动ojdbc6 找了很久了,驱动包换了N个了,就是不行 插入2000个以下字符没问题,超出就会报错 java里的方法: [code="java"] String sql = "insert into test_clob(detail) values(?)"; getTemplate().execute(sql, new AbstractLobCreatingPreparedStatementCallback(lobHandler) { @Override protected void setValues(PreparedStatement pstm, LobCreator lobCreator) throws SQLException, DataAccessException { lobCreator.setClobAsString(pstm, 1, text); } }); [/code] 配置文件: [code="java"] <bean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" lazy-init="true"> </bean> [/code] 错误信息: [code="java"] org.springframework.jdbc.support.lob.DefaultLobHandler&quot;</span></i></span></div> org.springframework.jdbc.UncategorizedSQLException: (executing PreparedStatementCallback [org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator@34e6e3]): encountered SQLException [数据大小超出此类型的最大值: 71472]; nested exception is java.sql.SQLException: 数据大小超出此类型的最大值: 71472 java.sql.SQLException: 数据大小超出此类型的最大值: 71472 at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179) at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:147) at oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2461) at oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:1155) at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:1572) 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.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100) at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57) at oracle.jdbc.internal.OracleStatement$$EnhancerByProxool$$16a7118c.setString(<generated>) at org.springframework.jdbc.support.lob.DefaultLobHandler$DefaultLobCreator.setClobAsString(DefaultLobHandler.java:106) at com.blackstar.project.service.ProjectService$1.setValues(ProjectService.java:71) at org.springframework.jdbc.core.support.AbstractLobCreatingPreparedStatementCallback.doInPreparedStatement(AbstractLobCreatingPreparedStatementCallback.java:71) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:450) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:469) at com.blackstar.project.service.ProjectService.addProject(ProjectService.java:65) at com.blackstar.project.action.ProjectAction.executeTask(ProjectAction.java:77) at com.blackstar.system.ComTemplateAction.execute(ComTemplateAction.java:46) at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:105) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) at com.blackstar.system.MyActionServlet.process(MyActionServlet.java:42) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) 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.extremecomponents.table.filter.AbstractExportFilter.doFilter(AbstractExportFilter.java:49) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.blackstar.system.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:22) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 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:859) 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) [/code]
使用springjdbc中的update方法获取Oracle数据库中自增的主键报错
源码如下: /** * 获取插入时的主键值 */ public int getKey(Order o) { final String sql = "insert into tb_order (user_id,order_money,address, postalcode,phone,mobile,email,sendType,payType, postscript) values (?,?,?,?,?,?,?,?,?,?)"; final int user_id = o.getUserId(); int i = 0; final double order_money = o.getOrderMoney(); final String address = o.getAddress(); final String postalcode = o.getPostalcode(); final String phone = o.getPhone(); final String mobile = o.getMobile(); final String email = o.getEmail(); final String sendType = o.getSendType(); final String payType = o.getPayType(); final String postscript = o.getPostScript(); KeyHolder keyHolder = new GeneratedKeyHolder(); template.update(new PreparedStatementCreator() { @Override public PreparedStatement createPreparedStatement(Connection arg0) throws SQLException { PreparedStatement ps = DBUtils.getDs().getConnection() .prepareStatement(sql); ps.setInt(1, user_id); ps.setDouble(2, order_money); ps.setString(3, address); ps.setString(4, postalcode); ps.setString(5, phone); ps.setString(6, mobile); ps.setString(7, email); ps.setString(8, sendType); ps.setString(9, payType); ps.setString(10, postscript); return ps; } }, keyHolder); i = keyHolder.getKey().intValue(); return i; } public static void main(String[] args) { Order o = new Order(7, 25, "hk", "432222", "1111", "1214334", "3453435", "1", "1", "无"); IOrderDaoImpl dao = new IOrderDaoImpl(); System.out.println(dao.getKey(o)); } 错误日志: 三月 01, 2017 10:45:47 上午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml] 三月 01, 2017 10:45:47 上午 org.springframework.jdbc.support.SQLErrorCodesFactory <init> 信息: SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase] Exception in thread "main" org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL []; SQL state [null]; error code [17090]; 不允许的操作; nested exception is java.sql.SQLException: 不允许的操作 at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:607) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:824) at dao.impl.IOrderDaoImpl.getKey(IOrderDaoImpl.java:58) at dao.impl.IOrderDaoImpl.main(IOrderDaoImpl.java:85) Caused by: java.sql.SQLException: 不允许的操作 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208) at oracle.jdbc.driver.OracleStatement.getGeneratedKeys(OracleStatement.java:4559) at org.apache.commons.dbcp.DelegatingStatement.getGeneratedKeys(DelegatingStatement.java:318) at org.springframework.jdbc.core.JdbcTemplate$3.doInPreparedStatement(JdbcTemplate.java:829) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:591) ... 3 more 程序走到template.update方法时报错
SpringBootWEB项目数据库连接关闭异常
1.问题描述 项目启动后,有30分钟一次的定时任务,在过一段时间后,就会抛出连接已关闭的异常,重启后又恢复正常 2.相关代码 多数据源配置: ![图片说明](https://img-ask.csdn.net/upload/201812/11/1544457664_608067.png) ``` public class UfOau8userServiceImpl{ private final static Logger logger = LoggerFactory.getLogger(UfOau8userServiceImpl.class); @Autowired @Qualifier("OAJdbcTemplate") private JdbcTemplate oaJdbcTemplate; public Integer selectOAU8User(String cPersonCode){ String sql="select count(id) as idnum from uf_OAU8User where cPersonCode='"+cPersonCode+"'"; logger.info("查询OA数据库===="+sql); try{ Integer idnum =oaJdbcTemplate.queryForObject(sql,Integer.class); return idnum; }catch (Exception e){ logger.error(this.getClass().getName()+".selectOAU8User根据U8人员编号获取OA人员对应表数据异常="+e); logger.error(this.getClass().getName()+".selectOAU8User异常SQL="+sql); return -1; } } } ``` 3.报错信息 2018-12-06 15:00:00.178 [pool-1-thread-1] ERROR com.yt.service.oa.UfOau8userServiceImpl - com.yt.service.oa.UfOau8userServiceImpl.selectOAU8User根据U8人员编号获取OA人员对应表数据异常=org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [select count(id) as idnum from uf_OAU8User where cPersonCode='01027']; SQL state [null]; error code [0]; The connection is closed.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
保存出错异常
org.springframework.jdbc.UncategorizedSQLException: Hibernate transaction synchronization: could not update: [com.leadron.trackao.document.po.AnaesSummary#CS100006732]; uncategorized SQLException for SQL [update ANAES_SUMMARY set PRE_OPERATION=?, IN_OPERATION=?, RECOVER=?, FINISH_TIME=?, CREATE_TIME=?, OWNER_ID=?, STATE=?, VEIN_ANAES=?, ANAES_MONITOR=?, ANAESUMMARY_METHOD=?, ANAESCONTENT=? where ID=?]; SQL state [null]; error code [17070]; ?????????????: 2011; nested exception is java.sql.SQLException: ?????????????: 2011 这是怎么回事,真头痛,解决一天了,还没解决?
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私...
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小人工智障。 思路可以运用在不同地方,主要介绍的是思路。
面试官问我:什么是消息队列?什么场景需要他?用了会出现什么问题?
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图、个人联系方式和人才交流群,欢迎Star和完善 前言 消息队列在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在消息队列的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸...
8年经验面试官详解 Java 面试秘诀
作者 |胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。 Java程序员准备和投递简历的实...
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观...
MyBatis研习录(01)——MyBatis概述与入门
MyBatis 是一款优秀的持久层框架,它支持定制化 SQL、存储过程以及高级映射。MyBatis原本是apache的一个开源项目iBatis, 2010年该项目由apache software foundation 迁移到了google code并改名为MyBatis 。2013年11月MyBatis又迁移到Github。
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外...
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip installselenium -ihttps://pypi.tuna.tsinghua.edu.cn/simple/ ...
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca...
Python爬虫精简步骤1 获取数据
爬虫,从本质上来说,就是利用程序在网上拿到对我们有价值的数据。 爬虫能做很多事,能做商业分析,也能做生活助手,比如:分析北京近两年二手房成交均价是多少?广州的Python工程师平均薪资是多少?北京哪家餐厅粤菜最好吃?等等。 这是个人利用爬虫所做到的事情,而公司,同样可以利用爬虫来实现巨大的商业价值。比如你所熟悉的搜索引擎——百度和谷歌,它们的核心技术之一也是爬虫,而且是超级爬虫。 从搜索巨头到人工...
Python绘图,圣诞树,花,爱心 | Turtle篇
每周每日,分享Python实战代码,入门资料,进阶资料,基础语法,爬虫,数据分析,web网站,机器学习,深度学习等等。 公众号回复【进群】沟通交流吧,QQ扫码进群学习吧 微信群 QQ群 1.画圣诞树 import turtle screen = turtle.Screen() screen.setup(800,600) circle = turtle.Turtle()...
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东...
破14亿,Python分析我国存在哪些人口危机!
一、背景 二、爬取数据 三、数据分析 1、总人口 2、男女人口比例 3、人口城镇化 4、人口增长率 5、人口老化(抚养比) 6、各省人口 7、世界人口 四、遇到的问题 遇到的问题 1、数据分页,需要获取从1949-2018年数据,观察到有近20年参数:LAST20,由此推测获取近70年的参数可设置为:LAST70 2、2019年数据没有放上去,可以手动添加上去 3、将数据进行 行列转换 4、列名...
web前端javascript+jquery知识点总结
1.Javascript 语法.用途 javascript 在前端网页中占有非常重要的地位,可以用于验证表单,制作特效等功能,它是一种描述语言,也是一种基于对象(Object)和事件驱动并具有安全性的脚本语言 ...
Python实战:抓肺炎疫情实时数据,画2019-nCoV疫情地图
今天,群里白垩老师问如何用python画武汉肺炎疫情地图。白垩老师是研究海洋生态与地球生物的学者,国家重点实验室成员,于不惑之年学习python,实为我等学习楷模。先前我并没有关注武汉肺炎的具体数据,也没有画过类似的数据分布图。于是就拿了两个小时,专门研究了一下,遂成此文。
听说想当黑客的都玩过这个Monyer游戏(1~14攻略)
第零关 进入传送门开始第0关(游戏链接) 请点击链接进入第1关: 连接在左边→ ←连接在右边 看不到啊。。。。(只能看到一堆大佬做完的留名,也能看到菜鸡的我,在后面~~) 直接fn+f12吧 &lt;span&gt;连接在左边→&lt;/span&gt; &lt;a href="first.php"&gt;&lt;/a&gt; &lt;span&gt;←连接在右边&lt;/span&gt; o...
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ...... ...
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!...
渗透测试-灰鸽子远控木马
木马概述 灰鸽子( Huigezi),原本该软件适用于公司和家庭管理,其功能十分强大,不但能监视摄像头、键盘记录、监控桌面、文件操作等。还提供了黑客专用功能,如:伪装系统图标、随意更换启动项名称和表述、随意更换端口、运行后自删除、毫无提示安装等,并采用反弹链接这种缺陷设计,使得使用者拥有最高权限,一经破解即无法控制。最终导致被黑客恶意使用。原作者的灰鸽子被定义为是一款集多种控制方式于一体的木马程序...
Python:爬取疫情每日数据
前言 目前每天各大平台,如腾讯、今日头条都会更新疫情每日数据,他们的数据源都是一样的,主要都是通过各地的卫健委官网通报。 以全国、湖北和上海为例,分别为以下三个网站: 国家卫健委官网:http://www.nhc.gov.cn/xcs/yqtb/list_gzbd.shtml 湖北卫健委官网:http://wjw.hubei.gov.cn/bmdt/ztzl/fkxxgzbdgrfyyq/xxfb...
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。 再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。 下文是原回答,希望能对你能有所启发。 如果我说,这个世界上人真的分三六九等,...
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合...
雷火神山直播超两亿,Web播放器事件监听是怎么实现的?
Web播放器解决了在手机浏览器和PC浏览器上播放音视频数据的问题,让视音频内容可以不依赖用户安装App,就能进行播放以及在社交平台进行传播。在视频业务大数据平台中,播放数据的统计分析非常重要,所以Web播放器在使用过程中,需要对其内部的数据进行收集并上报至服务端,此时,就需要对发生在其内部的一些播放行为进行事件监听。 那么Web播放器事件监听是怎么实现的呢? 01 监听事件明细表 名...
3万字总结,Mysql优化之精髓
本文知识点较多,篇幅较长,请耐心学习 MySQL已经成为时下关系型数据库产品的中坚力量,备受互联网大厂的青睐,出门面试想进BAT,想拿高工资,不会点MySQL优化知识,拿offer的成功率会大大下降。 为什么要优化 系统的吞吐量瓶颈往往出现在数据库的访问速度上 随着应用程序的运行,数据库的中的数据会越来越多,处理时间会相应变慢 数据是存放在磁盘上的,读写速度无法和内存相比 如何优化 设计...
Python新型冠状病毒疫情数据自动爬取+统计+发送报告+数据屏幕(三)发送篇
今天介绍的项目是使用 Itchat 发送统计报告 项目功能设计: 定时爬取疫情数据存入Mysql 进行数据分析制作疫情报告 使用itchat给亲人朋友发送分析报告 基于Django做数据屏幕 使用Tableau做数据分析 来看看最终效果 目前已经完成,预计2月12日前更新 使用 itchat 发送数据统计报告 itchat 是一个基于 web微信的一个框架,但微信官方并不允许使用这...
作为程序员的我,大学四年一直自学,全靠这些实用工具和学习网站!
我本人因为高中沉迷于爱情,导致学业荒废,后来高考,毫无疑问进入了一所普普通通的大学,实在惭愧???? 我又是那么好强,现在学历不行,没办法改变的事情了,所以,进入大学开始,我就下定决心,一定要让自己掌握更多的技能,尤其选择了计算机这个行业,一定要多学习技术。 在进入大学学习不久后,我就认清了一个现实:我这个大学的整体教学质量和学习风气,真的一言难尽,懂的人自然知道怎么回事? 怎么办?我该如何更好的提升自...
粒子群算法求解物流配送路线问题(python)
1.Matlab实现粒子群算法的程序代码:https://www.cnblogs.com/kexinxin/p/9858664.html matlab代码求解函数最优值:https://blog.csdn.net/zyqblog/article/details/80829043 讲解通俗易懂,有数学实例的博文:https://blog.csdn.net/daaikuaichuan/article/...
教你如何编写第一个简单的爬虫
很多人知道爬虫,也很想利用爬虫去爬取自己想要的数据,那么爬虫到底怎么用呢?今天就教大家编写一个简单的爬虫。 下面以爬取笔者的个人博客网站为例获取第一篇文章的标题名称,教大家学会一个简单的爬虫。 第一步:获取页面 #!/usr/bin/python # coding: utf-8 import requests #引入包requests link = "http://www.santostang....
前端JS初级面试题二 (。•ˇ‸ˇ•。)老铁们!快来瞧瞧自己都会了么
1. 传统事件绑定和符合W3C标准的事件绑定有什么区别? 传统事件绑定 &lt;div onclick=""&gt;123&lt;/div&gt; div1.onclick = function(){}; &lt;button onmouseover=""&gt;&lt;/button&gt; 注意: 如果给同一个元素绑定了两次或多次相同类型的事件,那么后面的绑定会覆盖前面的绑定 (不支持DOM事...
相关热词 c# 识别回车 c#生成条形码ean13 c#子控制器调用父控制器 c# 写大文件 c# 浏览pdf c#获取桌面图标的句柄 c# list反射 c# 句柄 进程 c# 倒计时 线程 c# 窗体背景色
立即提问