I was getting a cyclic error in my DTO classes, so decided to implement MOXy's to get rid of it. I followed the following steps for implementing MOXy's:
Downloaded EclipseLink from [http://www.eclipse.org/eclipselink/downloads/nightly.php]
Copied all the JARs from /eclipselink/jlib folder to my /WEB-INF/lib
For Specifying EclipseLink MOXy as the JAXB provider created a jaxb.properties file in the folder where all classes are present with following entry in it -
javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
I am using @XmlElement and @XmlInverseReference annotations in my dto classes but I am getting following error while I am running my application:
javax.ws.rs.WebApplicationException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions, Class has two properties of the same name "application"
this problem is related to the following location:
at public thbs.provisioning.dto.ApplicationDTO thbs.provisioning.dto.EnvironmentDTO.getApplication()
at thbs.provisioning.dto.EnvironmentDTO
at public java.util.Set thbs.provisioning.dto.ApplicationDTO.getEnvironment()
at thbs.provisioning.dto.ApplicationDTO
this problem is related to the following location:
at private thbs.provisioning.dto.ApplicationDTO thbs.provisioning.dto.EnvironmentDTO.application
at thbs.provisioning.dto.EnvironmentDTO
at public java.util.Set thbs.provisioning.dto.ApplicationDTO.getEnvironment()
at thbs.provisioning.dto.ApplicationDTO