SpringBoot 报警告 Could not find acceptable representation
而且前台接到406的错。
后台报Could not find acceptable representation是因为返回值类型不对。
前台的406是因为前台接受到的返回值类型前台无法解析。
发生这个错误的原因是。虽然后台没报错。但是其实是有错误的。
我原来的Controller得@RequestMapping是这么写的
后来我加上了produces=MediaType.APPLICATION_JSON_VALUE,
让他强行返回json。发现。后台报错了。是个类型不匹配。
说找不到路径com.example.entity.songtest
但是我的正确的应该是com.example.entity.Songtest。
我意识到中间是因为我改过一次类名。有些地方没搞好。找到位置改好之后一切都解决好了