Error "self-reference leading to cycle" error when returning JSON from a JAX-RS resource in EAP 6

Solution Verified - Updated -

Issue

When return a model object that should be parsed to JSON format from our JAX-RS resource we have the following exception:

org.codehaus.jackson.map.JsonMappingException: Direct self-reference leading to cycle (through reference chain: ${your model class})

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 6.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content