问题描述:"Type definition error: [simple type, class com.domain.Book]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `com.example.mall.pojo.User` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)\n at [Source: (PushbackInputStream); line: 2, column: 5]",
问题现象: 添加和修改功能报错 无法通过axios.post添加数据到数据库,点击添加按钮就报错,打开瀑布流会发现资源找不到500错误
问题解决: 根据错误提示发现是domain层的实体类,经过排查发现是写了有参构造器而没有写无参构造器导致,book对象无法创建,导致添加方法没有形参传递,验证了浏览器控制台显示的资源找不到问题。
通过修改后添加功能和修改功能可以正常使用!