解决异常信息,空指针SpringBoot ERROR [c.u.life.core.exception.GlobalExceptionHandler]GlobalExceptionHandler

17 篇文章 1 订阅

解决异常信息,空指针SpringBoot ERROR [c.u.life.core.exception.GlobalExceptionHandler]GlobalExceptionHandler

报空指针,spring Boot线上测试

2019-11-14 15:35:16,827 [XNIO-1 task-52] ERROR [c.u.life.core.exception.GlobalExceptionHandler] GlobalExceptionHandler.java:166 - 异常信息uri=/admin/WxProduct/updateImg,method=POST,e={}
java.lang.NullPointerException: null
at io.undertow.servlet.spec.PartImpl.write(PartImpl.java:104)
at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest$StandardMultipartFile.transferTo(StandardMultipartHttpServletRequest.java:255)
at com.ultrapower.life.admin.util.FileUtils.save(FileUtils.java:21)
at com.ultrapower.life.admin.controller.WxProductController.updateImg(WxProductController.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:364)
at io.undertow.server.HttpServerExchange 1. r u n ( H t t p S e r v e r E x c h a n g e . j a v a : 830 ) a t j a v a . u t i l . c o n c u r r e n t . T h r e a d P o o l E x e c u t o r . r u n W o r k e r ( T h r e a d P o o l E x e c u t o r . j a v a : 1149 ) a t j a v a . u t i l . c o n c u r r e n t . T h r e a d P o o l E x e c u t o r 1.run(HttpServerExchange.java:830) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor 1.run(HttpServerExchange.java:830)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)atjava.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

报错的原因在这里

在这里插入图片描述

yaml在配置文件里提交代码的时候把本地的路径给提交上去了
#imageUrl: https://bjlife.feiying.com/img
#imageFilePath: /home/bjlife
imageUrl: http://localhost:9088/
imageFilePath: E:/home/bjlife
因此只需把yaml配置更改即可
imageUrl: https://bjlife.feiying.com/img
imageFilePath: /home/bjlife

以这种方式提交到项目中就可以了
  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

皮皮攻城狮

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

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

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

打赏作者

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

抵扣说明:

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

余额充值