jdbc.exception.NestedSQLException ibatis,提示如下错误,不知道怎么回事
log4j:WARNNoappenderscouldbefoundforlogger(com.ibatis.common.jdbc.SimpleDataSource).l...
log4j:WARN No appenders could be found for logger (com.ibatis.common.jdbc.SimpleDataSource).
log4j:WARN Please initialize the log4j system properly.
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/lcc/ibatistest/Student.xml.
--- The error occurred while applying a result map.
--- Check the selectAllStudent-AutoResultMap.
--- Check the result mapping for the 'birth' property.
--- Cause: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Value can not be converted to requested type. 展开
log4j:WARN Please initialize the log4j system properly.
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/lcc/ibatistest/Student.xml.
--- The error occurred while applying a result map.
--- Check the selectAllStudent-AutoResultMap.
--- Check the result mapping for the 'birth' property.
--- Cause: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Value can not be converted to requested type. 展开
展开全部
web.xml发现在加载org.springframework.web.context.ContextLoader这个listener之后才加载org.springframework.web.util.Log4jConfigListener,把log4j的配置放到org.springframework.web.context.ContextLoader之前,就可以解决这个问题了。
<!-- 以下3项参数与log4j的配置相关 -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>
<context-param>
<param-name>log4jRefreshInterval</param-name>
<param-value>60000</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.util.Log4jConfigListener
</listener-class>
</listener>
<!-- end -->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
展开全部
估计是这里大意com/lcc/ibatistest/Student.xml写错了,改成
com.lcc.ibatistest.Student.xml
com.lcc.ibatistest.Student.xml
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
报告这种异常的原因有很多7需要提供更多的信息
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询