leilei_ya 2023-02-16 10:51 采纳率: 33.3%
浏览 42
已结题

java 异步调用新增报错,如何解决?

java 异步调用新增报错 = =

直接调用就没问题

img

img

 Exception in threadThread-33"C                                  org.mybatis.Spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException
 ###Error updating database.Cause:java.lang. Nul1PointerException
 ###The error may exist in com/hemu/iot/core/mapper/deviceMapper/EquipAlarmRecordMapper.java(best guess)
 ###Theerror               may involve com.hemu.iot.core.mapper.deviceMapper.EquipAlarmRecordMapper.insert
 ### The error occurred while executing an update
 ### Cause:java.lang.Nul1PointerException
     at org. mybatis.spring. MyBatisExceptionTranslator.translateExceptionIfPossible MyBatisExceptionTranslatorjaya:92)
     at org. mybatis.spring. SqlSessionTemplatesSqlSessionInterceptor.invoke (SalSessionTemplate_iava:440)<1 internal cal1)
     at org.mybatis.spring. SqlSessionTemplate.insert (SqlSessionTemplatejava:271)
     at com.baomidou. mybatisplus.core.override. MybatisMapperMethod.execute (MybatisMapperMethod. java:60
     at com. baomidou. mybatisplus.core. override. MybatisMapperProxysPlainMethodInvoker. invoke (MybatisMapperProxy.java:148
     at com.baomidou. mybatisplus.core.override. MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)  十                                                                                                         )<1internalca11
     at com. hemu. web. controller:infoAccept. InfoAcceptController.sets (InfoAcceptController iava:65)
     at com. hemu, web. controller. inf oAccept. InfoAcceptControl ler, lambda sAcceptCompanyProtocol Infosso (InfoAccentController.iava:72
     atjava.lang.Thread.run(Thread_iava:748
 Caused by:org.apache,ibatis.exceptions. PersistenceException
 #Error updatingdatabase                                Cause:java.lang.NullPointerExcept1on
 牛##The error may exist in com/hemu/iot/core/mapper/devicelapper/EquipAlarmRecordMapper.java(best guess)
 #料件The error may involve com.hemu.iot.core.mapper.deviceMapper.EquipAlarmRecordMapper.insert
 ##件 The error occurred while executing an update
 ###Cause:java.lang.Nul1PointerException
     at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30
     at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSessionjava:199
 十      at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSalSession.iava:184)<4internal calis
     at org. mybatis. spring. SqlSessionTemplatesSqlSessi onInterceptor. invoke (SalSessionTemplate.java:4269more
 Caused by:java.lang.NulIPointerException
     at com. hemu. framework.security.handle.MyMetaObjectHandler.getTokenCompanyName (MyMetaObiectHandler.java:42
     atcom.hemu.framework.security.handle.MyMetaObjectHandler.insertFi11(MyMetaObjectHandler.java:32
     atcom.baomidou.mybatisplus.core.MybatisParameterHandler.lambda$insertFi11$O(MybatisParameterHandler.java:146
      atjava.util.Optional.ifPresent(Optional.java:159
  • 写回答

3条回答 默认 最新

  • 皮蛋不吃粥 2023-02-16 11:31
    关注

    这里是不是从请求域拿了属性,开启线程后请求上下文里面的属性会置空,导致NPE

    img

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 2月24日
  • 已采纳回答 2月16日
  • 修改了问题 2月16日
  • 修改了问题 2月16日
  • 展开全部

悬赏问题

  • ¥15 is not in the mmseg::model registry。报错,模型注册表找不到自定义模块。
  • ¥15 安装quartus II18.1时弹出此error,怎么解决?
  • ¥15 keil官网下载psn序列号在哪
  • ¥15 想用adb命令做一个通话软件,播放录音
  • ¥30 Pytorch深度学习服务器跑不通问题解决?
  • ¥15 部分客户订单定位有误的问题
  • ¥15 如何在maya程序中利用python编写领子和褶裥的模型的方法
  • ¥15 Bug traq 数据包 大概什么价
  • ¥15 在anaconda上pytorch和paddle paddle下载报错
  • ¥25 自动填写QQ腾讯文档收集表