首页 > 解决方案 > Spring Data Rest 存储库偶尔不会导出

问题描述

我在2.2.6.RELEASE使用 Spring Data Rest ( 3.2.6.RELEASE) 的 Spring Boot 应用程序 () 中遇到了一个奇怪的问题。有时我的存储库不会通过休息暴露。这发生在我的应用程序的完全相同的版本(相同的 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"
        }
    }
}

一些额外的发现:

以前有没有其他人遇到过这个问题?这可能是什么原因造成的?或者关于如何进一步分析这个问题的一些指示?

标签: javaspringspring-bootspring-dataspring-data-rest

解决方案


听起来您遇到了DATAREST-1502,它已在 3.2.7 及更高版本中修复。


推荐阅读