我在使用Spring Data Rest(2.2.6.RELEASE
)的Spring Boot应用程序(3.2.6.RELEASE
)中遇到一个奇怪的问题。有时我的存储库不会因休息而暴露。这是在使用完全相同的配置的应用程序具有完全相同的版本(相同的jar)中发生的。
有4个@RepositoryRestResource
,并且在工作时,根资源公开此内容:
{
"_links": {
"entity-a": {
"href": "http://localhost:8080/api/entity-a{?projection}",
"templated": true
},
"entity-b": {
"href": "http://localhost:8080/api/entity-b"
},
"entity-c": {
"href": "http://localhost:8080/api/entity-c{?page,size,sort,projection}",
"templated": true
},
"entity-d": {
"href": "http://localhost:8080/api/entity-d"
},
"profile": {
"href": "http://localhost:8080/api/profile"
}
}
}
并且当它不工作时返回:
{
"_links": {
"profile": {
"href": "http://localhost:8080/api/profile"
}
}
}
一些其他发现:
org.springframework.data
启用调试日志记录会产生完全相同的输出RepositoryDetectionStrategies.ANNOTATED
其他人以前遇到过这个问题吗?是什么原因造成的?或关于如何进一步分析此问题的一些建议?
听起来像是您遇到了DATAREST-1502,在3.2.7及更高版本中已修复。