请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

测试pay.do出现异常

测试pay.do接口获取订单列表
123行 List orderItemList = orderItemMapper.getByOrderNoUserId(orderNo,userId);
的时候出现
java.lang.NullPointerException
com.mmall.service.impl.IOrderServiceImpl.pay(IOrderServiceImpl.java:123)
com.mmall.controller.portal.OrderController.pay(OrderController.java:46)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:214)

打开断点调试第123行跑到

private Object invoke(Object... args) throws Exception {
        ReflectionUtils.makeAccessible(this.getBridgedMethod());

        try {
            return this.getBridgedMethod().invoke(this.getBean(), args);
        } catch (IllegalArgumentException var5) {
            String targetException1 = this.getInvocationErrorMessage(var5.getMessage(), args);
            throw new IllegalArgumentException(targetException1, var5);
        } catch (InvocationTargetException var6) {
            Throwable targetException = var6.getTargetException();
            if(targetException instanceof RuntimeException) {
                throw (RuntimeException)targetException;
            } else if(targetException instanceof Error) {
                throw (Error)targetException;
            } else if(targetException instanceof Exception) {
                throw (Exception)targetException;
            } else {
                String msg = this.getInvocationErrorMessage("Failed to invoke controller method", args);
                throw new IllegalStateException(msg, targetException);
            }
        }
    }

看起来像是mybatis错误,找了半天也没找到什么原因

正在回答 回答被采纳积分+3

1回答

geelylucky 2019-10-26 22:47:27

IOrderServiceImpl第123行有一个对象是null,报错是空指针异常。

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号