2011-02-24 13:17:06,217 INFO [STDOUT] 13:17:06,216 ERROR TransactionInterceptor:414 - Application exception overridden by rollback exception
org.springframework.dao.TransientDataAccessResourceException: SqlSession operation; SQL []; JZ006: Caught IOException: java.io.IOException: JZ0SL:
Unsupported SQL type 1111.; nested exception is java.sql.SQLException: JZ006: Caught IOException: java.io.IOException: JZ0SL: Unsupported SQL type 1111.
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:107)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.mybatis.spring.SqlSessionTemplate.wrapException(SqlSessionTemplate.java:243)
at org.mybatis.spring.SqlSessionTemplate$7$1.doInSqlSession(SqlSessionTemplate.java:230)
at org.mybatis.spring.SqlSessionTemplate.execute(SqlSessionTemplate.java:135)
at org.mybatis.spring.SqlSessionTemplate.execute(SqlSessionTemplate.java:117)
at org.mybatis.spring.SqlSessionTemplate$7.invoke(SqlSessionTemplate.java:225)
at $Proxy145.create(Unknown Source)
at com.wonders.hs.registration.healthevent.service.impl.DiagServiceServiceImpl.register(DiagServiceServiceImpl.java:26)
at sun.reflect.GeneratedMethodAccessor384.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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 org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy147.register(Unknown Source)
at com.wonders.hs.registration.healthevent.ws.register.ServiceRegistrationPortTypeImpl.batchRegisterService(ServiceRegistrationPortTypeImpl.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:60)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:247)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)
at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:97)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:458)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:185)
at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:148)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
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.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
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:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: JZ006: Caught IOException: java.io.IOException: JZ0SL: Unsupported SQL type 1111.
at com.sybase.jdbc3.jdbc.ErrorMessage.raiseError(Unknown Source)
at com.sybase.jdbc3.jdbc.ErrorMessage.raiseErrorCheckDead(Unknown Source)
at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
at com.sybase.jdbc3.tds.Tds.language(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.sendQuery(Unknown Source)
at com.sybase.jdbc3.jdbc.SybPreparedStatement.sendQuery(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.execute(Unknown Source)
at com.sybase.jdbc3.jdbc.SybPreparedStatement.execute(Unknown Source)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:209)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:22)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:51)
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:29)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:73)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:43)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:102)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:91)
at org.apache.ibati
2011-02-24 13:17:06,218 INFO [STDOUT] s.binding.MapperMethod.execute(MapperMethod.java:54)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:35)
at $Proxy145.create(Unknown Source)
at sun.reflect.GeneratedMethodAccessor385.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.mybatis.spring.SqlSessionTemplate$7$1.doInSqlSession(SqlSessionTemplate.java:228)
... 64 more
2011-02-24 13:17:06,218 ERROR [STDERR] org.springframework.transaction.TransactionSystemException: Could not roll back JDBC transaction; nested exception is
com.sybase.jdbc3.jdbc.SybSQLException: A wrong datastream has been sent to the server. The server was expecting token 32 but got the token 33. This is an
internal error.
2011-02-24 13:17:06,218 ERROR [STDERR] at org.springframework.jdbc.datasource.DataSourceTransactionManager.doRollback(DataSourceTransactionManager.java:285)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback
(AbstractPlatformTransactionManager.java:845)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback
(AbstractPlatformTransactionManager.java:822)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing
(TransactionAspectSupport.java:411)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:114)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
2011-02-24 13:17:06,218 ERROR [STDERR] at $Proxy147.register(Unknown Source)
2011-02-24 13:17:06,218 ERROR [STDERR] at com.wonders.hs.registration.healthevent.ws.register.ServiceRegistrationPortTypeImpl.batchRegisterService
(ServiceRegistrationPortTypeImpl.java:40)
2011-02-24 13:17:06,218 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2011-02-24 13:17:06,218 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
2011-02-24 13:17:06,218 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2011-02-24 13:17:06,218 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:60)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
2011-02-24 13:17:06,218 ERROR [STDERR] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
2011-02-24 13:17:06,218 ERROR [STDERR] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
2011-02-24 13:17:06,218 ERROR [STDERR] at java.util.concurrent.FutureTask.run(FutureTask.java:138)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:247)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:97)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:458)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:185)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:148)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
2011-02-24 13:17:06,218 ERROR [STDERR] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
2011-02-24 13:17:06,219 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
2011-02-24 13:17:06,219 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
2011-02-24 13:17:06,219 ERROR [STDERR] Caused by: com.sybase.jdbc3.jdbc.SybSQLException: A wrong datastream has been sent to the server. The server was
expecting token 32 but got the token 33. This is an internal error.
2011-02-24 13:17:06,219 ERROR [STDERR] at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
2011-02-24 13:17:06,219 ERROR [STDERR] at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
2011-02-24 13:17:06,219 ERROR [STDERR] at com.sybase.jdbc3.tds.Tds.new(Unknown Source)
2011-02-24 13:17:06,219 ERROR [STDERR] at com.sybase.jdbc3.tds.Tds.doCommand(Unknown Source)
2011-02-24 13:17:06,219 ERROR [STDERR] at com.sybase.jdbc3.tds.Tds.endTransaction(Unknown Source)
2011-02-24 13:17:06,219 ERROR [STDERR] at com.sybase.jdbc3.jdbc.SybConnection.rollback(Unknown Source)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcRollback(BaseWrapperManagedConnection.java:581)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrappedConnection.rollback(WrappedConnection.java:340)
2011-02-24 13:17:06,219 ERROR [STDERR] at org.springframework.jdbc.datasource.DataSourceTransactionManager.doRollback(DataSourceTransactionManager.java:282)
2011-02-24 13:17:06,219 ERROR [STDERR] ... 56 more
=================================================================
解决方法:
是用Mybaties的。错误原因是sql里的字段忘记写属性类型了。。
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.wonders.hs.registration.healthevent.dao.DiagServiceDAO">
<insert id="create" parameterType="com.wonders.hs.registration.healthevent.bo.DiagService">
insert into diag_service
(event_id, diag_time, type_code, code, code_type, note, hospital_name, hospital_code, hospital_code_type,
dpt_code, dpt_type, dpt_name, dpt_code_type, doc_name, doc_id)
values
(#{event.id, jdbcType=VARCHAR}, #{diagnosisTime}, #{diagnosisType}, #{diagnosisCode}, #{diagnosisCodeType},
#{diagnosisNote, jdbcType=VARCHAR}, #{hospital.name, jdbcType=VARCHAR}, #{hospital.code, jdbcType=VARCHAR},
#{hospital.codeType, jdbcType=VARCHAR}, #{departmentCode, jdbcType=VARCHAR}, #{departmentType, jdbcType=VARCHAR},
#{departmentName, jdbcType=VARCHAR}, #{departmentCodeType, jdbcType=VARCHAR}, #{docName}, #{docId} )
</insert>
<delete id="deleteById" parameterType="int">
delete from diag_service where did = #{did}
</delete>
</mapper>
修改:
#{docName}, #{docId}
这两个属性是可以为空的字段,要加属性,改为
#{docName, jdbcType=VARCHAR}, #{docId, jdbcType=VARCHAR}