使用Spring Data Rest继续工作。升级到2.4.0后,我得到了更多想要的行为,但现在我遇到了一个奇怪的间歇性异常。
大约有2/3的时间,当我重新加载或部署应用程序时,每个具有数据的SDR端点都会抛出500,并显示以下内容:
大约有2/3的时间,当我重新加载或部署应用程序时,每个具有数据的SDR端点都会抛出500,并显示以下内容:
GET /api/departments
--------------------
HTTP Status 500 - Could not write content: org.springframework.data.rest.webmvc.json.PersistentEntityJackson2Module$ProjectionResourceContentSerializer
cannot be cast to com.fasterxml.jackson.databind.ser.impl.UnwrappingBeanSerializer
(through reference chain:
org.springframework.hateoas.PagedResources["_embedded"]
->java.util.UnmodifiableMap["departments"]
->java.util.ArrayList[0]
->org.springframework.data.rest.webmvc.json.ProjectionResource["content"]);
nested exception is com.fasterxml.jackson.databind.JsonMappingException:
org.springframework.data.rest.webmvc.json.PersistentEntityJackson2Module$ProjectionResourceContentSerializer
cannot be cast to com.fasterxml.jackson.databind.ser.impl.UnwrappingBeanSerializer
(through reference chain:
org.springframework.hateoas.PagedResources["_embedded"]
->java.util.UnmodifiableMap["departments"]
->java.util.ArrayList[0]
->org.springframework.data.rest.webmvc.json.ProjectionResource["content"])
完整的错误报告可以在此处查看:http://pastebin.com/xzzXkFiR
就像我说的那样,每次重新加载/部署应用程序时并不会出现此问题,但如果出现了,它就会完全卡住,重新加载是唯一的解决方法。非常奇怪的行为,想知道是否有人有任何见解。
如果回滚到Spring Data Rest 2.3.2,则不会出现此问题。
感谢您的帮助,请让我知道我可以提供哪些其他相关信息。
- SDR:2.4.1
- SFW:4.2.1
- SDJPA:1.9.0
最新版本(2.5.0 SNAPSHOT)也存在此问题。