org.springframework.jdbc.UncategorizedSQLException

java 专栏收录该内容
18 篇文章 0 订阅

今天在Struts+ibatis中遇到这样一个问题,老是抛出下面异常:

[2011/05/03 14:30:45][ERROR][DefaultExceptionHandler] 例外ハンドラが例外を検知しました

org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];   

--- The error occurred in sqlMap.xml. 

--- The error occurred while applying a parameter map. 

--- Check the insertTDeviationRequestInfo-InlineParameterMap. 

--- Check the parameter mapping for the 'processUserId' property. 

--- Cause: java.lang.NullPointerException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:  

--- The error occurred in sqlMap.xml. 

--- The error occurred while applying a parameter map. 

--- Check the insertTDeviationRequestInfo-InlineParameterMap. 

--- Check the parameter mapping for the 'processUserId' property. 

--- Cause: java.lang.NullPointerException

    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.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:212)

    at org.springframework.orm.ibatis.SqlMapClientTemplate.update(SqlMapClientTemplate.java:411)

    at jp.terasoluna.fw.dao.ibatis.UpdateDAOiBatisImpl.execute(UpdateDAOiBatisImpl.java:189)

    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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)

    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)

    at $Proxy1.execute(Unknown Source)

    at jp.anserkcom.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.update(SqlMapExecutorDelegate.java:457)

    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.update(SqlMapSessionImpl.java:90)

    at org.springframework.orm.ibatis.SqlMapClientTemplate$10.doInSqlMapClient(SqlMapClientTemplate.java:413)

    at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:209)

    ... 75 more

Caused by: java.lang.NullPointerException

    at com.microsoft.sqlserver.jdbc.AppDTVImpl$SetValueOp.executeDefault(Unknown Source)

    at com.microsoft.sqlserver.jdbc.DTV.executeOp(Unknown Source)

    at com.microsoft.sqlserver.jdbc.AppDTVImpl.setValue(Unknown Source)

    at com.microsoft.sqlserver.jdbc.DTV.setValue(Unknown Source)

    at com.microsoft.sqlserver.jdbc.Parameter.setValue(Unknown Source)

    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setObject(Unknown Source)

    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setNull(Unknown Source)

    at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.setNull(DelegatingPreparedStatement.java:105)

    at com.ibatis.sqlmap.engine.mapping.parameter.ParameterMap.setParameter(ParameterMap.java:172)

    at com.ibatis.sqlmap.engine.mapping.parameter.ParameterMap.setParameters(ParameterMap.java:126)

    at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:78)

    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteUpdate(MappedStatement.java:216)

    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:94)

    ... 79 more

 

请教了百度老师好久,众人说法不一。经过一番波折之后,终于找到了答案,原来是因为没有把sqljdbc.jar加到JDK当中去http://hi.baidu.com/xiaobobo_/blog/item/88178018c009914d42a9ad7d.html

 

 

  • 0
    点赞
  • 2
    评论
  • 0
    收藏
  • 打赏
    打赏
  • 扫一扫,分享海报

评论 2 您还未登录,请先 登录 后发表或查看评论
©️2022 CSDN 皮肤主题:大白 设计师:CSDN官方博客 返回首页

打赏作者

draling

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值