Spring boot response REST service error -
my project @ https://github.com/murillocg/springboottest
when acess uri, localhost/video, follow response:
{"_links":{"search":{ "href":"http://localhost:8080/video/search" } }, "_embedded":{ "videos":[{"id":1, "name":"jogo da imitacao", "url":"www.globo.com", "duration":123, "persistententity":{ "idproperty": {"name":"id", "rawtype":"long", "field":{ "name":"id", "type":"long", "modifiers":2, "annotations":[{},{}], "synthetic":false, "declaredannotations":[{},{}], "declaringclass":"hello.repository.video", "enumconstant":false, "generictype":"long", "accessible":true}, "association":false, "owner":{ "idproperty":{ "name":"id", "rawtype":"long", "field":{ "name":"id", "type":"long", "modifiers":2, "annotations":[{},{}], "synthetic":false, "declaredannotations":[{},{}], "declaringclass":"hello.repository.video", "enumconstant":false, "generictype":"long", "accessible":true }, "association":false, "owner":{ "idproperty":{ "name":"id", "rawtype":"long", "field":{ "name":"id", "type":"long", "modifiers":2, "annotations":[{},{}], "synthetic":false, "declaredannotations":[{},{}], "declaringclass":"hello.repository.video", "enumconstant":false, "generictype":"long", "accessible":true }, "association":false, "owner":{ "idproperty":{ "name":"id", "rawtype":"long", "field":{ "name":"id", "type":"long", "modifiers":2, "annotations":[{},{}], "synthetic":false, "declaredannotations":[{},{}], "declaringclass":"hello.repository.video", "enumconstant":false, "generictype":"long", "accessible":true }, "association":false, "owner":{ "idproperty":{ "name":"id", "rawtype":"long", "field":{ "name":"id", "type":"long", "modifiers":2, "annotations":[{},{}], "synthetic":false, "declaredannotations":[{},{}], "declaringclass":"hello.repository.video", "enumconstant":false, "generictype":"long", "accessible":true }, "association":false, "owner":{"idproperty":{ "name":"id", "rawtype":"long", "field":{ "name":"id", "type":"long", "modifiers":2, "annotations":[{},{}], "synthetic":false, "declaredannotations":[{},{}], "declaringclass":"hello.repository.video", "enumconstant":false, "generictype":"long", "accessible":true }, "association":false, "owner":{"idproperty":{ "name":"id", "rawtype":"long", "field":{"name":"id", "type":"long", "modifiers":2, "annotations":[{},{}], "synthetic":false, "declaredannotations":[{},{}], "declaringclass":"hello.repository.video", "enumconstant":false, "generictype":"long", "accessible":true }, "association":false, "owner":{"idproperty":{ "name":"id", "rawtype":"long", "field":{ "name":"id", "type":"long", "modifiers":2, "annotations":[{},{}], "synthetic":false, "declaredannotations":[{},{}], "declaringclass":"hello.repository.video", "enumconstant":false, "generictype":"long", "accessible":true }, "association":false, "owner":{"idproperty":{ "name":"id", "rawtype":"long", "field":
in eclipse, output is:
2015-08-16 20:21:32.827 warn 4696 --- [tp1794644129-17] o.s.web.servlet.pagenotfound : no mapping found http request uri [/favicon.ico] in dispatcherservlet name 'dispatcherservlet' 2015-08-16 20:24:31.773 warn 4696 --- [tp1794644129-20] org.eclipse.jetty.server.response : committed before 500 null 2015-08-16 20:24:31.783 warn 4696 --- [tp1794644129-20] .w.s.m.s.defaulthandlerexceptionresolver : handling of [org.springframework.http.converter.httpmessagenotwritableexception] resulted in exception java.lang.illegalstateexception: committed @ org.eclipse.jetty.server.response.resetbuffer(response.java:1243) @ org.eclipse.jetty.server.response.senderror(response.java:567) @ org.eclipse.jetty.server.response.senderror(response.java:544) @ org.springframework.web.servlet.mvc.support.defaulthandlerexceptionresolver.sendservererror(defaulthandlerexceptionresolver.java:313) @ org.springframework.web.servlet.mvc.support.defaulthandlerexceptionresolver.handlehttpmessagenotwritable(defaulthandlerexceptionresolver.java:370) @ org.springframework.web.servlet.mvc.support.defaulthandlerexceptionresolver.doresolveexception(defaulthandlerexceptionresolver.java:140) @ org.springframework.web.servlet.handler.abstracthandlerexceptionresolver.resolveexception(abstracthandlerexceptionresolver.java:138) @ org.springframework.web.servlet.handler.handlerexceptionresolvercomposite.resolveexception(handlerexceptionresolvercomposite.java:74) @ org.springframework.web.servlet.dispatcherservlet.processhandlerexception(dispatcherservlet.java:1183) @ org.springframework.web.servlet.dispatcherservlet.processdispatchresult(dispatcherservlet.java:1020) @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:971) @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:893) @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:967) @ org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:858) @ javax.servlet.http.httpservlet.service(httpservlet.java:687) @ org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:843) @ javax.servlet.http.httpservlet.service(httpservlet.java:790) @ org.eclipse.jetty.servlet.servletholder.handle(servletholder.java:808) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1669) @ org.eclipse.jetty.websocket.server.websocketupgradefilter.dofilter(websocketupgradefilter.java:224) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1652) @ org.springframework.boot.actuate.autoconfigure.endpointwebmvcautoconfiguration$applicationcontextheaderfilter.dofilterinternal(endpointwebmvcautoconfiguration.java:295) @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1652) @ org.springframework.boot.actuate.trace.webrequesttracefilter.dofilterinternal(webrequesttracefilter.java:102) @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1652) @ org.springframework.web.filter.characterencodingfilter.dofilterinternal(characterencodingfilter.java:85) @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1652) @ org.springframework.boot.actuate.autoconfigure.metricsfilter.dofilterinternal(metricsfilter.java:68) @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1652) @ org.eclipse.jetty.servlet.servlethandler.dohandle(servlethandler.java:585) @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:143) @ org.eclipse.jetty.security.securityhandler.handle(securityhandler.java:577) @ org.eclipse.jetty.server.session.sessionhandler.dohandle(sessionhandler.java:223) @ org.eclipse.jetty.server.handler.contexthandler.dohandle(contexthandler.java:1127) @ org.eclipse.jetty.servlet.servlethandler.doscope(servlethandler.java:515) @ org.eclipse.jetty.server.session.sessionhandler.doscope(sessionhandler.java:185) @ org.eclipse.jetty.server.handler.contexthandler.doscope(contexthandler.java:1061) @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:141) @ org.eclipse.jetty.server.handler.handlerwrapper.handle(handlerwrapper.java:97) @ org.eclipse.jetty.server.server.handle(server.java:499) @ org.eclipse.jetty.server.httpchannel.handle(httpchannel.java:310) @ org.eclipse.jetty.server.httpconnection.onfillable(httpconnection.java:257) @ org.eclipse.jetty.io.abstractconnection$2.run(abstractconnection.java:540) @ org.eclipse.jetty.util.thread.queuedthreadpool.runjob(queuedthreadpool.java:635) @ org.eclipse.jetty.util.thread.queuedthreadpool$3.run(queuedthreadpool.java:555) @ java.lang.thread.run(thread.java:722) 2015-08-16 20:24:31.807 warn 4696 --- [tp1794644129-20] o.eclipse.jetty.servlet.servlethandler : org.springframework.web.util.nestedservletexception: request processing failed; nested exception org.springframework.http.converter.httpmessagenotwritableexception: not write content: infinite recursion (stackoverflowerror) (through reference chain: org.springframework.data.jpa.mapping.jpapersistententityimpl["idproperty"]->org.springframework.data.jpa.mapping.jpapersistentpropertyimpl["owner"]->org.springframework.data.jpa.mapping.jpapersistententityimpl["idproperty"]->org.springframework.data.jpa.mapping.jpapersistentpropertyimpl["owner"]->org.springframework.data.jpa.mapping.jpapersistententityimpl["idproperty"]->org.springframework.data.jpa.mapping.jpapersistentpropertyimpl["owner"]->org.springframework.data.jpa.mapping.jpapersistententityimpl["idproperty"]->org.springframework.data.jpa.mapping.jpapersistentpropertyimpl["owner"]; nested exception com.fasterxml.jackson.databind.jsonmappingexception: infinite recursion (stackoverflowerror) (through reference chain: org.springframework.data.jpa.mapping.jpapersistententityimpl["idproperty"]->org.springframework.data.jpa.mapping.jpapersistentpropertyimpl["owner"]->org.springframework.data.jpa.mapping.jpapersistententityimpl["idproperty"]->org.springframework.data.jpa.mapping.jpapersistentpropertyimpl["owner"]->org.springframework.data.jpa.mapping.jpapersistententityimpl["idproperty"]->org.springframework.data.jpa.mapping.jpapersistentpropertyimpl["owner"]->org.springframework.data.jpa.mapping.jpapersistententityimpl["idproperty"]->org.springframework.data.jpa.mapping.jpapersistentpropertyimpl["owner"]) @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:979) @ org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:858) @ javax.servlet.http.httpservlet.service(httpservlet.java:687) @ org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:843) @ javax.servlet.http.httpservlet.service(httpservlet.java:790) @ org.eclipse.jetty.servlet.servletholder.handle(servletholder.java:808) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1669) @ org.eclipse.jetty.websocket.server.websocketupgradefilter.dofilter(websocketupgradefilter.java:224) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1652) @ org.springframework.boot.actuate.autoconfigure.endpointwebmvcautoconfiguration$applicationcontextheaderfilter.dofilterinternal(endpointwebmvcautoconfiguration.java:295) @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1652) @ org.springframework.boot.actuate.trace.webrequesttracefilter.dofilterinternal(webrequesttracefilter.java:102) @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1652) @ org.springframework.web.filter.characterencodingfilter.dofilterinternal(characterencodingfilter.java:85) @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1652) @ org.springframework.boot.actuate.autoconfigure.metricsfilter.dofilterinternal(metricsfilter.java:68) @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107) @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1652) @ org.eclipse.jetty.servlet.servlethandler.dohandle(servlethandler.java:585) @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:143) @ org.eclipse.jetty.security.securityhandler.handle(securityhandler.java:577) @ org.eclipse.jetty.server.session.sessionhandler.dohandle(sessionhandler.java:223) @ org.eclipse.jetty.server.handler.contexthandler.dohandle(contexthandler.java:1127) @ org.eclipse.jetty.servlet.servlethandler.doscope(servlethandler.java:515) @ org.eclipse.jetty.server.session.sessionhandler.doscope(sessionhandler.java:185) @ org.eclipse.jetty.server.handler.contexthandler.doscope(contexthandler.java:1061) @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:141) @ org.eclipse.jetty.server.handler.handlerwrapper.handle(handlerwrapper.java:97) @ org.eclipse.jetty.server.server.handle(server.java:499) @ org.eclipse.jetty.server.httpchannel.handle(httpchannel.java:310) @ org.eclipse.jetty.server.httpconnection.onfillable(httpconnection.java:257) @ org.eclipse.jetty.io.abstractconnection$2.run(abstractconnection.java:540) @ org.eclipse.jetty.util.thread.queuedthreadpool.runjob(queuedthreadpool.java:635) @ org.eclipse.jetty.util.thread.queuedthreadpool$3.run(queuedthreadpool.java:555) @ java.lang.thread.run(thread.java:722) caused by: org.springframework.http.converter.httpmessagenotwritableexception: not write content: infinite recursion (stackoverflowerror) (through reference chain: org.springframework.data.jpa.mapping.jpapersistententityimpl["idproperty"]->org.springframework.data.jpa.mapping.jpapersistentpropertyimpl["owner"]->org.springframework.data.jpa.mapping.jpapersistententityimpl["idproperty"]->org.springframework.data.jpa.mapping.jpapersistentpropertyimpl["owner"]->org.springframework.data.jpa.mapping.jpapersistententityimpl["idproperty"] @ org.springframework.http.converter.json.abstractjackson2httpmessageconverter.writeinternal(abstractjackson2httpmessageconverter.java:238) @ org.springframework.http.converter.abstracthttpmessageconverter.write(abstracthttpmessageconverter.java:208) @ org.springframework.web.servlet.mvc.method.annotation.abstractmessageconvertermethodprocessor.writewithmessageconverters(abstractmessageconvertermethodprocessor.java:161) @ org.springframework.web.servlet.mvc.method.annotation.abstractmessageconvertermethodprocessor.writewithmessageconverters(abstractmessageconvertermethodprocessor.java:101) @ org.springframework.web.servlet.mvc.method.annotation.requestresponsebodymethodprocessor.handlereturnvalue(requestresponsebodymethodprocessor.java:185) @ org.springframework.web.method.support.handlermethodreturnvaluehandlercomposite.handlereturnvalue(handlermethodreturnvaluehandlercomposite.java:71) @ org.springframework.data.rest.webmvc.resourceprocessorhandlermethodreturnvaluehandler.handlereturnvalue(resourceprocessorhandlermethodreturnvaluehandler.java:172) @ org.springframework.web.method.support.handlermethodreturnvaluehandlercomposite.handlereturnvalue(handlermethodreturnvaluehandlercomposite.java:71) @ org.springframework.web.servlet.mvc.method.annotation.servletinvocablehandlermethod.invokeandhandle(servletinvocablehandlermethod.java:126) @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.invokehandlemethod(requestmappinghandleradapter.java:776) @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.handleinternal(requestmappinghandleradapter.java:705) @ org.springframework.web.servlet.mvc.method.abstracthandlermethodadapter.handle(abstracthandlermethodadapter.java:85) @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:959) @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:893) @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:967) ... 37 common frames omitted caused by: com.fasterxml.jackson.databind.jsonmappingexception: infinite recursion (stackoverflowerror) (through reference chain: org.springframework.data.jpa.mapping.jpapersistententityimpl["idproperty"]->org.springframework.data.jpa.mapping.jpapersistentpropertyimpl["owner"]->org.springframework.data.jpa.mapping.jpapersistententityimpl["idproperty"]->org.springframework.data.jpa.mapping.jpapersistentpropertyimpl["owner"]->org.springframework.data.jpa.mapping.jpapersistententityimpl["idproperty"]->org.springframework.data.jpa.mapping.jpapersistentpropertyimpl["owner"] @ com.fasterxml.jackson.databind.ser.std.beanserializerbase.serializefields(beanserializerbase.java:653) @ com.fasterxml.jackson.databind.ser.beanserializer.serialize(beanserializer.java:152) @ com.fasterxml.jackson.databind.ser.beanpropertywriter.serializeasfield(beanpropertywriter.java:505) @ com.fasterxml.jackson.databind.ser.std.beanserializerbase.serializefields(beanserializerbase.java:639) @ com.fasterxml.jackson.databind.ser.beanserializer.serialize(beanserializer.java:152) @ com.fasterxml.jackson.databind.ser.beanpropertywriter.serializeasfield(beanpropertywriter.java:505) @ com.fasterxml.jackson.databind.ser.std.beanserializerbase.serializefields(beanserializerbase.java:639) @ com.fasterxml.jackson.databind.ser.beanserializer.serialize(beanserializer.java:152) @ com.fasterxml.jackson.databind.ser.beanpropertywriter.serializeasfield(beanpropertywriter.java:505) @ com.fasterxml.jackson.databind.ser.std.beanserializerbase.serializefields(beanserializerbase.java:639) @ com.fasterxml.jackson.databind.ser.beanserializer.serialize(beanserializer.java:152) @ com.fasterxml.jackson.databind.ser.beanpropertywriter.serializeasfield(beanpropertywriter.java:505) @ com.fasterxml.jackson.databind.ser.std.beanserializerbase.serializefields(beanserializerbase.java:639) @ com.fasterxml.jackson.databind.ser.beanserializer.serialize(beanserializer.java:152) @ com.fasterxml.jackson.databind.ser.beanpropertywriter.serializeasfield(beanpropertywriter.java:505) @ com.fasterxml.jackson.databind.ser.std.beanserializerbase.serializefields(beanserializerbase.java:639) @ com.fasterxml.jackson.databind.ser.beanserializer.serialize(beanserializer.java:152) @ com.fasterxml.jackson.databind.ser.beanpropertywriter.serializeasfield(beanpropertywriter.java:505) @ com.fasterxml.jackson.databind.ser.std.beanserializerbase.serializefields(beanserializerbase.java:639) @ com.fasterxml.jackson.databind.ser.beanserializer.serialize(beanserializer.java:152) @ com.fasterxml.jackson.databind.ser.beanpropertywriter.serializeasfield(beanpropertywriter.java:505) @ com.fasterxml.jackson.databind.ser.std.beanserializerbase.serializefields(beanserializerbase.java:639)
what did wrong in project?
this project based in https://github.com/juleswhite/mobilecloud-15/tree/master/examples/6-videoservicewithdatarest, works uses gradle.
i think it's saying have circular relationship somewhere in entities jsonified. had faced issue when had user
entity having lastmodifiedby
field. when user updating himself, lastmodifiedby
pointing same user object. fix issue, had annotate user class with
@jsonignoreproperties({ "createdby", "lastmodifiedby" })
Comments
Post a Comment