【开源中国 APP 全新上线】“动弹” 回归、集成大模型对话、畅读技术报告”
Db.update("delete from users_extra_values where user_id = ?", userId);
在我执行这样一条语句的时候会报空指针异常,userId不为空
【开源中国 APP 全新上线】“动弹” 回归、集成大模型对话、畅读技术报告”
Db.update("delete from users_extra_values where user_id = ?", userId);
在我执行这样一条语句的时候会报空指针异常,userId不为空
具体报的什么对象为空指针? 贴出异常信息,推测是你 ActiveRecordPlugin 数据源没有初始化成功
Caused by: java.lang.NullPointerException
at com.jfinal.plugin.activerecord.Db.update(Db.java:290)
at com.yiren.shiro.controller.UserController.uploadUserInfo(UserController.java:304)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:55)
at com.jfinal.plugin.activerecord.tx.Tx.intercept(Tx.java:76)
引用来自“chrishao”的评论
Caused by: java.lang.NullPointerException
at com.jfinal.plugin.activerecord.Db.update(Db.java:290)
at com.yiren.shiro.controller.UserController.uploadUserInfo(UserController.java:304)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:55)
at com.jfinal.plugin.activerecord.tx.Tx.intercept(Tx.java:76)
链接对象为空吧?
再贴多些代码出来