-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Projection type must be an interface" #85
Comments
can you show me your test case code? |
I have created a repo https://github.com/kopax/spring-data-mybatis-testing You need to checkout the "projection" branch $ git clone git@github.com:kopax/spring-data-mybatis-testing.git
$ git checkout projection
$ ./gradlew build --info && java -jar build/libs/spring-data-mybatis-testing-0.1.0.war
$ curl http://localhost:8080/siteContents
{"timestamp":1486030282864,"status":500,"error":"Internal Server Error","exception":"org.springframework.http.converter.HttpMessageNotWritableException","message":"Could not write content: Projection type must be an interface! (through reference chain: org.springframework.hateoas.Resources[\"_embedded\"]->java.util.Collections$UnmodifiableMap[\"siteContents\"]->java.util.ArrayList[0]->org.springframework.data.rest.webmvc.json.PersistentEntityJackson2Module$ProjectionResource[\"content\"]->com.sun.proxy.$Proxy118[\"siteFunction\"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Projection type must be an interface! (through reference chain: org.springframework.hateoas.Resources[\"_embedded\"]->java.util.Collections$UnmodifiableMap[\"siteContents\"]->java.util.ArrayList[0]->org.springframework.data.rest.webmvc.json.PersistentEntityJackson2Module$ProjectionResource[\"content\"]->com.sun.proxy.$Proxy118[\"siteFunction\"])","path":"/siteContents"} I was not able to load the context to query my endpoints this is why I wasn't able to provide a sscce.org |
I have tested in my project where I have a more complex object structure, The error is still the same : I have updated the test case on branch extendxml $ git clone git@github.com:kopax/spring-data-mybatis-testing.git
$ git checkout projection
$ ./gradlew build --info && java -jar build/libs/spring-data-mybatis-testing-0.1.0.war
$ curl http://localhost:8080/siteServices ExpectHTTP 200 Result2017-02-02 23:41:46.665 WARN 10352 --- [nio-8080-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Failed to write HTTP message: org.springframework.http.converter.HttpMessageNotWritableException: Could not write content: Projection type must be an interface! (through reference chain: org.springframework.hateoas.Resources["_embedded"]->java.util.Collections$UnmodifiableMap["siteServices"]->java.util.ArrayList[0]->org.springframework.data.rest.webmvc.json.PersistentEntityJackson2Module$ProjectionResource["content"]->com.sun.proxy.$Proxy102["translateMessage"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Projection type must be an interface! (through reference chain: org.springframework.hateoas.Resources["_embedded"]->java.util.Collections$UnmodifiableMap["siteServices"]->java.util.ArrayList[0]->org.springframework.data.rest.webmvc.json.PersistentEntityJackson2Module$ProjectionResource["content"]->com.sun.proxy.$Proxy102["translateMessage"]) I am using an interface It appeart that this line is an issue for the projection |
I have tried to create Projection and exclude some field but I have the following error :
Could this be related to spring-data-mybatis ?
The text was updated successfully, but these errors were encountered: