attempt to create delete event with null entity

Posted 孙泽阳的博客

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了attempt to create delete event with null entity相关的知识,希望对你有一定的参考价值。

SSH框架删除单条数据不会报错,一条以上数据回报:

java.lang.IllegalArgumentException: attempt to create delete event with null entity

 

在网上查到到不少解决方法,但是都解决不了。自己调试把struts2封装的ids打印出来了,结果是——ID前面多了一个空格!!!   

Request URL:
http://localhost:8080/manager/sysadmin/userAction_delete
Form DATE:
  1. id:
    6e170c1e-16b2-4030-9bcb-2bfadd9c422f
  2. id:
    96aa1fa6-879f-4de9-9283-952bddaa0818

一般多个同名string类型的参数struts2模型驱动封装的时候会以逗号分割,莫名多个空格这个真是奇葩了!浏览器提交的时候参数都是正常的,目测是旧项目 struts2框架的BUG。

System.out.println("id没有切分前"+model.getId());//逗号后面有多出个空格
String ids[] = model.getId().split(",");
System.err.println("ids"+ Arrays.toString(ids));

 

 

 

 

 

以上是关于attempt to create delete event with null entity的主要内容,如果未能解决你的问题,请参考以下文章

java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempt

java.lang.IllegalArgumentException: attempt to create saveOrUpdate event with null entity

Idea连接MySQL异常[Could not create connection to database server. Attempted reconnect 3 times.]

Idea连接MySQL异常[Could not create connection to database server. Attempted reconnect 3 times.]

Idea连接MySQL异常[Could not create connection to database server. Attempted reconnect 3 times.]

mysqlspringboot启动报错Could not create connection to database server. Attempted reconnect 3 times. (代码片