org.codehaus.jackson.map.JsonMappingException: Direct self-reference leading to cycle

710 views Asked by At

I am working on an AngularJS Java web app, and I am refactoring an existing parent pom to use Java 8.

Towards that end I changed all Spring references to use the Spring Bill of Materials to 4.1.2.RELEASE, and our Jetty application server to 9.2.5.v20141112, all for Java 8 compatability.

Almost everything is working fine until I call the URL to get the initial blast of data. The URL is getting called, and is delegated (via SpringMVC) to the correct code, which returns some JSON.

For debugging purposes I am calling testApp.do that is returning the simple JSON string [{"system":"test"}]"

That method is definitely getting called, and is returning the expected String.

However somewhere along the way (not sure if it is Spring, or Jetty, or Jackson, I am seeing the following exception in the stack, and the return value is never assigned.

Any advice is greatly appreciated

2014-11-19 09:57:04.371:WARN:oejs.ServletHandler:qtp1601800698-18: /MYCONTEXT/testApp.do 
    at org.codehaus.jackson.map.ser.BeanPropertyWriter._reportSelfReference(BeanPropertyWriter.java:491)
at org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:429)
...
at org.codehaus.jackson.map.ObjectMapper.writeValue(ObjectMapper.java:1604)
at org.springframework.web.servlet.view.json.MappingJacksonJsonView.writeContent(MappingJacksonJsonView.java:303)
...
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:800)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
...
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:125)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:76)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
...
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:540)
at java.lang.Thread.run(Thread.java:745)
0

There are 0 answers