People,
Looking for a little guidance. I am using Jersey 2.11 and generating JAXB definitions from XSD.
I have a periodic exception that seems to be timing based. If I change the timing of the message sent in anyway the error does not occur. The other issue is that the cycle reported in the error changes sometimes, however, the cycles reported can not occur based on the XSD definition. I have also dumped the message before sending and it definitely does not contain the cycle reported.
In this specific scenario, I am sending a message of NotificationType which contains a list of DocumentType, however, DocumentType can never contain NotificationType so the following cycle is not possible:
net.es.nsi.pce.discovery.jaxb.DocumentType@5a0eb1fc -> net.es.nsi.pce.discovery.jaxb.NotificationType@454b147c -> net.es.nsi.pce.discovery.jaxb.DocumentType@5a0eb1fc
I am wondering if there could be a different reason for receiving the following exception?
Thank you for the help.
[ERROR] [08/22/2014 13:11:45.126] [NSI-DISCOVERY-akka.actor.default-dispatcher-5] [akka://NSI-DISCOVERY/user/discovery-notificationRouter/$b] HTTP 500 Internal Server Error javax.ws.rs.ProcessingException: HTTP 500 Internal Server Error at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:255) at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:667) at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:664) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:228) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:424) at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:664) at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:424) at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:333) at net.es.nsi.pce.discovery.actors.NotificationActor.onReceive(NotificationActor.java:100) at akka.actor.UntypedActor$$anonfun$receive$1.applyOrElse(UntypedActor.scala:167) at akka.actor.Actor$class.aroundReceive(Actor.scala:465) at akka.actor.UntypedActor.aroundReceive(UntypedActor.scala:97) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) at akka.actor.ActorCell.invoke(ActorCell.scala:487) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) at akka.dispatch.Mailbox.run(Mailbox.scala:220) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) Caused by: javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error at org.glassfish.jersey.message.internal.AbstractJaxbElementProvider.writeTo(AbstractJaxbElementProvider.java:152) at org.glassfish.jersey.message.internal.AbstractJaxbElementProvider.writeTo(AbstractJaxbElementProvider.java:85) at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:265) at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250) at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) at org.glassfish.jersey.filter.LoggingFilter.aroundWriteTo(LoggingFilter.java:293) at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1154) at org.glassfish.jersey.client.ClientRequest.writeEntity(ClientRequest.java:503) at org.glassfish.jersey.client.HttpUrlConnector._apply(HttpUrlConnector.java:315) at org.glassfish.jersey.client.HttpUrlConnector.apply(HttpUrlConnector.java:227) at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:246) ... 22 more Caused by: javax.xml.bind.MarshalException - with linked exception: [Exception [EclipseLink-25003] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.XMLMarshalException Exception Description: An error occurred marshalling the object Internal Exception: Exception [EclipseLink-25037] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.XMLMarshalException Exception Description: A cycle is detected in the object graph. This will cause an infinite loop: net.es.nsi.pce.discovery.jaxb.DocumentType@5a0eb1fc -> net.es.nsi.pce.discovery.jaxb.NotificationType@454b147c -> net.es.nsi.pce.discovery.jaxb.DocumentType@5a0eb1fc] at org.eclipse.persistence.jaxb.JAXBMarshaller.marshal(JAXBMarshaller.java:403) at org.glassfish.jersey.message.internal.XmlJaxbElementProvider.writeTo(XmlJaxbElementProvider.java:139) at org.glassfish.jersey.message.internal.AbstractJaxbElementProvider.writeTo(AbstractJaxbElementProvider.java:150) ... 33 more Caused by: Exception [EclipseLink-25003] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.XMLMarshalException Exception Description: An error occurred marshalling the object Internal Exception: Exception [EclipseLink-25037] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.XMLMarshalException Exception Description: A cycle is detected in the object graph. This will cause an infinite loop: net.es.nsi.pce.discovery.jaxb.DocumentType@5a0eb1fc -> net.es.nsi.pce.discovery.jaxb.NotificationType@454b147c -> net.es.nsi.pce.discovery.jaxb.DocumentType@5a0eb1fc at org.eclipse.persistence.exceptions.XMLMarshalException.marshalException(XMLMarshalException.java:97) at org.eclipse.persistence.internal.oxm.XMLMarshaller.marshal(XMLMarshaller.java:911) at org.eclipse.persistence.internal.oxm.XMLMarshaller.marshal(XMLMarshaller.java:848) at org.eclipse.persistence.jaxb.JAXBMarshaller.marshal(JAXBMarshaller.java:401) ... 35 more Caused by: Exception [EclipseLink-25037] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.XMLMarshalException Exception Description: A cycle is detected in the object graph. This will cause an infinite loop: net.es.nsi.pce.discovery.jaxb.DocumentType@5a0eb1fc -> net.es.nsi.pce.discovery.jaxb.NotificationType@454b147c -> net.es.nsi.pce.discovery.jaxb.DocumentType@5a0eb1fc at org.eclipse.persistence.exceptions.XMLMarshalException.objectCycleDetected(XMLMarshalException.java:400) at org.eclipse.persistence.internal.oxm.XPathObjectBuilder.buildRow(XPathObjectBuilder.java:207) at org.eclipse.persistence.internal.oxm.TreeObjectBuilder.buildRow(TreeObjectBuilder.java:118) at org.eclipse.persistence.internal.oxm.TreeObjectBuilder.buildRow(TreeObjectBuilder.java:1) at org.eclipse.persistence.internal.oxm.XMLCompositeObjectMappingNodeValue.marshalSingleValue(XMLCompositeObjectMappingNodeValue.java:237) at org.eclipse.persistence.internal.oxm.XMLCompositeObjectMappingNodeValue.marshal(XMLCompositeObjectMappingNodeValue.java:149) at org.eclipse.persistence.internal.oxm.NodeValue.marshal(NodeValue.java:102) at org.eclipse.persistence.internal.oxm.record.ObjectMarshalContext.marshal(ObjectMarshalContext.java:59) at org.eclipse.persistence.internal.oxm.XPathNode.marshal(XPathNode.java:393) at org.eclipse.persistence.internal.oxm.XPathObjectBuilder.buildRow(XPathObjectBuilder.java:238) at org.eclipse.persistence.internal.oxm.TreeObjectBuilder.buildRow(TreeObjectBuilder.java:118) at org.eclipse.persistence.internal.oxm.TreeObjectBuilder.buildRow(TreeObjectBuilder.java:1) at org.eclipse.persistence.internal.oxm.XMLCompositeCollectionMappingNodeValue.marshalSingleValue(XMLCompositeCollectionMappingNodeValue.java:321) at org.eclipse.persistence.internal.oxm.XMLCompositeCollectionMappingNodeValue.marshal(XMLCompositeCollectionMappingNodeValue.java:104) at org.eclipse.persistence.internal.oxm.NodeValue.marshal(NodeValue.java:149) at org.eclipse.persistence.internal.oxm.NodeValue.marshal(NodeValue.java:102) at org.eclipse.persistence.internal.oxm.record.ObjectMarshalContext.marshal(ObjectMarshalContext.java:59) at org.eclipse.persistence.internal.oxm.XPathNode.marshal(XPathNode.java:393) at org.eclipse.persistence.internal.oxm.XPathObjectBuilder.buildRow(XPathObjectBuilder.java:238) at org.eclipse.persistence.internal.oxm.TreeObjectBuilder.buildRow(TreeObjectBuilder.java:118) at org.eclipse.persistence.internal.oxm.TreeObjectBuilder.buildRow(TreeObjectBuilder.java:1) at org.eclipse.persistence.internal.oxm.XMLMarshaller.marshal(XMLMarshaller.java:743) at org.eclipse.persistence.internal.oxm.XMLMarshaller.marshal(XMLMarshaller.java:901) ... 37 more
Notification.java
package net.es.nsi.pce.discovery.jaxb;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
import org.w3c.dom.Element;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "NotificationType", namespace = "http://schemas.ogf.org/nsi/2014/02/discovery/types", propOrder = {
"discovered",
"event",
"document",
"any"
})
public class NotificationType {
@XmlElement(required = true)
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar discovered;
@XmlElement(required = true)
protected DocumentEventType event;
@XmlElement(required = true)
protected DocumentType document;
@XmlAnyElement(lax = true)
protected List<Object> any;
@XmlAnyAttribute
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
public XMLGregorianCalendar getDiscovered() {
return discovered;
}
public void setDiscovered(XMLGregorianCalendar value) {
this.discovered = value;
}
public DocumentEventType getEvent() {
return event;
}
public void setEvent(DocumentEventType value) {
this.event = value;
}
public DocumentType getDocument() {
return document;
}
public void setDocument(DocumentType value) {
this.document = value;
}
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
public Map<QName, String> getOtherAttributes() {
return otherAttributes;
}
}
DocumentType.java
package net.es.nsi.pce.discovery.jaxb;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
import org.w3c.dom.Element;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DocumentType", namespace = "http://schemas.ogf.org/nsi/2014/02/discovery/types", propOrder = {
"nsa",
"type",
"signature",
"content",
"any"
})
public class DocumentType {
@XmlElement(required = true)
@XmlSchemaType(name = "anyURI")
protected String nsa;
@XmlElement(required = true)
protected String type;
protected AnyType signature;
protected AnyType content;
@XmlAnyElement(lax = true)
protected List<Object> any;
@XmlAttribute(name = "id", required = true)
protected String id;
@XmlAttribute(name = "href")
@XmlSchemaType(name = "anyURI")
protected String href;
@XmlAttribute(name = "version", required = true)
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar version;
@XmlAttribute(name = "expires", required = true)
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar expires;
@XmlAnyAttribute
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
public String getNsa() {
return nsa;
}
public void setNsa(String value) {
this.nsa = value;
}
public String getType() {
return type;
}
public void setType(String value) {
this.type = value;
}
public AnyType getSignature() {
return signature;
}
public void setSignature(AnyType value) {
this.signature = value;
}
public AnyType getContent() {
return content;
}
public void setContent(AnyType value) {
this.content = value;
}
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
public String getId() {
return id;
}
public void setId(String value) {
this.id = value;
}
public String getHref() {
return href;
}
public void setHref(String value) {
this.href = value;
}
public XMLGregorianCalendar getVersion() {
return version;
}
public void setVersion(XMLGregorianCalendar value) {
this.version = value;
}
public XMLGregorianCalendar getExpires() {
return expires;
}
public void setExpires(XMLGregorianCalendar value) {
this.expires = value;
}
public Map<QName, String> getOtherAttributes() {
return otherAttributes;
}
}