【发布时间】:2016-03-23 00:01:17
【问题描述】:
我正在使用 SDR 2.4.1
当我执行时
http -v --auth admin:admin --json PATCH http://localhost:8080/api/messages/61?projection=withAccount readTimestamp="2015-12-15T11:32:06.380+0000"
我得到以下异常:
java.lang.IllegalArgumentException: Target bean is not of type of the persistent entity!
at org.springframework.util.Assert.isTrue(Assert.java:68) ~[spring-core-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.data.mapping.model.BasicPersistentEntity.getPropertyAccessor(BasicPersistentEntity.java:394) ~[spring-data-commons-1.11.1.RELEASE.jar:na]
at org.springframework.data.rest.webmvc.support.ETag.getVersionInformation(ETag.java:191) ~[spring-data-rest-webmvc-2.4.1.RELEASE.jar:na]
at org.springframework.data.rest.webmvc.support.ETag.from(ETag.java:76) ~[spring-data-rest-webmvc-2.4.1.RELEASE.jar:na]
at org.springframework.data.rest.webmvc.AbstractRepositoryRestController.prepareHeaders(AbstractRepositoryRestController.java:171) ~[spring-data-rest-webmvc-2.4.1.RELEASE.jar:na]
at org.springframework.data.rest.webmvc.AbstractRepositoryRestController.prepareHeaders(AbstractRepositoryRestController.java:157) ~[spring-data-rest-webmvc-2.4.1.RELEASE.jar:na]
at org.springframework.data.rest.webmvc.RepositoryEntityController.saveAndReturn(RepositoryEntityController.java:495) ~[spring-data-rest-webmvc-2.4.1.RELEASE.jar:na]
at org.springframework.data.rest.webmvc.RepositoryEntityController.patchItemResource(RepositoryEntityController.java:442) ~[spring-data-rest-webmvc-2.4.1.RELEASE.jar:na]
但是当我执行时:
http -v --auth admin:admin --json PATCH http://localhost:8080/api/messages/61?foo=bar readTimestamp="2015-12-15T11:32:06.380+0000"
一切都很好。
所以似乎是投影参数导致了异常。
这是一个错误吗?
谢谢
【问题讨论】:
-
我已经为这个问题开了一个ticket(不久前)。
标签: projection spring-data-rest