darkgoon83 / log4jdbc-remix

Automatically exported from code.google.com/p/log4jdbc-remix
0 stars 0 forks source link

An NullPointerException occurs when using mybatis query table which has blog columns #19

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.use mybatis and the table has blog columns
2.the SQL select blog columns and in XXXMapper.xml
3.execute the method in interface XXXMapper

What is the expected output? What do you see instead?
get result,but exception

What version of the product are you using? On what operating system?
log4jdbc0.2.7,mabatis 3.2.2.
Windows

Please provide any additional information below.

[newproduct]INFO  05-28 13:27:57,540| 
net.sf.log4jdbc.Slf4jSpyLogDelegator:sqlTimingOccured | select id, productid, 
categoryid, pcid, name, ename, firstchar, keyname, price, pricegeturl, 
bphoto, imgsetid, boardid, weight, comment, releaseyear, flag, status, 
createid, createtime, 
updateid, updatetime , datainfo, description from product where id = 1  
{executed in 15 msec}
org.mybatis.spring.MyBatisSystemException: nested exception is 
org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: java.lang.NullPointerException
### The error may exist in file 
[D:\workspace\eclipse3.7\newproduct\target\webapp\WEB-INF\classes\maps\ProductMa
pper.xml]
### The error may involve 
com.netease.product.mapper.ProductMapper.selectByPrimaryKey-Inline
### The error occurred while setting parameters
### SQL: select            id, productid, categoryid, pcid, name, ename, 
firstchar, keyname, price, pricegeturl,      bphoto, imgsetid, boardid, weight, 
comment, releaseyear, flag, status, createid,      createtime, updateid, 
updatetime         ,           datainfo, description         from product     
where id = ?
### Cause: java.lang.NullPointerException
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365)
    at $Proxy21.selectOne(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160)
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63)
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:43)
    at $Proxy26.selectByPrimaryKey(Unknown Source)
    at com.netease.product.service.impl.BaseServiceImpl.getById(BaseServiceImpl.java:19)
    at Test.main(Test.java:39)
Caused by: org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: java.lang.NullPointerException
### The error may exist in file 
[D:\workspace\eclipse3.7\newproduct\target\webapp\WEB-INF\classes\maps\ProductMa
pper.xml]
### The error may involve 
com.netease.product.mapper.ProductMapper.selectByPrimaryKey-Inline
### The error occurred while setting parameters
### SQL: select            id, productid, categoryid, pcid, name, ename, 
firstchar, keyname, price, pricegeturl,      bphoto, imgsetid, boardid, weight, 
comment, releaseyear, flag, status, createid,      createtime, updateid, 
updatetime         ,           datainfo, description         from product     
where id = ?
### Cause: java.lang.NullPointerException
    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107)
    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.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)
    ... 7 more
Caused by: java.lang.NullPointerException
    at net.sf.log4jdbc.DefaultResultSetCollector.methodReturned(DefaultResultSetCollector.java:129)
    at net.sf.log4jdbc.ResultSetSpy.reportAllReturns(ResultSetSpy.java:89)
    at net.sf.log4jdbc.ResultSetSpy.reportReturn(ResultSetSpy.java:159)
    at net.sf.log4jdbc.ResultSetSpy.wasNull(ResultSetSpy.java:2495)
    at com.mchange.v2.c3p0.impl.NewProxyResultSet.wasNull(NewProxyResultSet.java:259)
    at org.apache.ibatis.type.BaseTypeHandler.getResult(BaseTypeHandler.java:52)
    at org.apache.ibatis.executor.resultset.FastResultSetHandler.getPropertyMappingValue(FastResultSetHandler.java:325)
    at org.apache.ibatis.executor.resultset.FastResultSetHandler.applyPropertyMappings(FastResultSetHandler.java:301)
    at org.apache.ibatis.executor.resultset.FastResultSetHandler.getRowValue(FastResultSetHandler.java:270)
    at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleRowValues(FastResultSetHandler.java:216)
    at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSet(FastResultSetHandler.java:188)
    at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSets(FastResultSetHandler.java:154)
    at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:57)
    at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:70)
    at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:57)
    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 org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104)
    ... 14 more

Original issue reported on code.google.com by ITm...@gmail.com on 28 May 2013 at 5:30