Results 1 to 4 of 4

Thread: CXF plugin - JAXB error

  1. #1
    Join Date
    Sep 2010
    Posts
    4

    Default 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. #2
    Join Date
    Jun 2010
    Location
    London
    Posts
    304

    Default

    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

  3. #3
    Join Date
    Sep 2010
    Posts
    4

    Default

    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.

  4. #4
    Join Date
    Jun 2010
    Location
    London
    Posts
    304

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •