首页 新闻 会员 周边

Mybatis莫名奇妙的NullException

0
悬赏园豆:30 [已关闭问题] 关闭于 2019-06-08 14:19

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: java.lang.NullPointerException

The error may exist in mapper/OmInvokePricingMapper.xml

The error may involve com.aspire.ability.common.dao.OmInvokePricingMapper.groupByAppInstCapInstAll

The error occurred while executing a query

Cause: java.lang.NullPointerException

at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77) ~[mybatis-spring-1.3.1.jar:1.3.1]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) ~[mybatis-spring-1.3.1.jar:1.3.1]
at com.sun.proxy.$Proxy94.selectList(Unknown Source) ~[?:?]
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230) ~[mybatis-spring-1.3.1.jar:1.3.1]
at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:128) ~[mybatis-3.4.0.jar:3.4.0]
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:68) ~[mybatis-3.4.0.jar:3.4.0]
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53) ~[mybatis-3.4.0.jar:3.4.0]
at com.sun.proxy.$Proxy146.groupByAppInstCapInstAll(Unknown Source) ~[?:?]
at com.aspire.ability.fee.service.FeeDeductService.groupByAppInstCapInstAll(FeeDeductService.java:108) ~[classes/:?]
at com.aspire.ability.fee.service.FeeDeductService$$FastClassBySpringCGLIB$$c4171a54.invoke(<generated>) ~[classes/:?]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:652) ~[spring-aop-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at com.aspire.ability.fee.service.FeeDeductService$$EnhancerBySpringCGLIB$$35235d40.groupByAppInstCapInstAll(<generated>) ~[classes/:?]
at com.aspire.ability.fee.job.FeeDeductJob.doCalculateFee(FeeDeductJob.java:169) ~[classes/:?]
at com.aspire.ability.fee.job.FeeDeductJob.calculateFee(FeeDeductJob.java:153) ~[classes/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_211]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_211]
at java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:308) ~[?:1.8.0_211]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java) ~[?:1.8.0_211]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_211]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[?:1.8.0_211]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_211]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_211]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_211]

我查看了 OmInvokePricingMapper 对象,并不是Null。
连接的数据库地址,应该也是正常的。

用的是oracle数据库;查询SQL如下:
<select id="groupByAppInstCapInstAll" parameterType="java.lang.Integer" resultType="com.aspire.ability.common.vo.DeductPricingVo">
select a.userid, a.appinstanceid,a.capinstanceid,a.productinstanceid,max(to_char(a.requesttime,'yyyy-mm-dd')) datestr
from OM_INVOKE_PRICING a
where 1=1 and a.pricingstatus in('success','noPricing','fail')
and rownum<=#{size} group by a.userid,a.appinstanceid,a.capinstanceid,a.productinstanceid,to_char(a.requesttime,'yyyy-MM-dd')
</select>

明日小路的主页 明日小路 | 菜鸟二级 | 园豆:466
提问于:2019-06-08 11:38
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册