Announcement Announcement Module
Collapse
No announcement yet.
CXF plugin - JAXB error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • CXF plugin - JAXB error

    Hi all, I am fairly new to Grails and CXF. I have a simple parent-child relationship and I want to expose some methods through SOAP-CXF using the Grails-CXF plugin.

    I have the following 2 simple domain classes.

    @XmlAccessorType(XmlAccessType.FIELD)
    class Dealership {

    static hasMany = [technicians:Technician]

    String description

    static constraints = {
    description(blank: false , maxSize:100)
    }
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    class Technician {

    Dealership dealership
    String firstName
    String lastName

    static constraints = {
    firstName(blank: false , maxSize:100)
    lastName(blank: false , maxSize:100)
    }
    }

    and the following service class :

    class DealershipManagementService {

    static expose=[ 'cxf' ]

    Dealership retrieveDealership(Integer id) {
    return Dealership.get( id )
    }
    }

    When I call the generated WebService retrieveDealership(1), I get the error :
    Marshalling Error: A cycle is detected in the object graph. This will cause infinitely deep XML

    Any help on how to fix this ?

    Regards,

    Martin

  • #2
    I suggest you do a web search for "CXF bidirectional relationship" or the same without "relationship". I found this link, which may help:

    http://www.mail-archive.com/cxf-user.../msg06947.html

    Comment


    • #3
      There is little documentation regarding Grails and CXF, what is the best and most used web services framework for contract last with Grails ? Metro, Axis2, just plain Jaxb annotations ? Thinking about switching to Metro and using the Grails plugin with JAX-WS annotations.

      Any insight is appreciated.

      Comment


      • #4
        You might want to ask on the Grails user mailing list. You'll have access to more people that use Grails and I know some use Grails with web services. I'm afraid I don't know which is the most used or best of the integrations, but I think the CXF plugin has been around for a while.

        Comment

        Working...
        X