Traverse on object graph

Hey,
I want to implement a diff engin that compare two graph of objects.
I mean that it get an object and run on its references and compare them to the other object graph.
The objects are not from the same type , so i have a problem to know how to run on this graph.
Does any one know refrences for article or utility that implement a diff engine or can give me some advice on how to implement this?
Thank you

Interesting problem, look in the reflection APIs, you'll use these to determine the type and number of fields for each class. It's probably going to be recursive for the current object, so you'll have to detect if you've got something like a.b.a.b....
Displaying it graphically might be most useful to humans, toString() could probably help with that for a way to display any object so long as classes override it with something useful.

Similar Messages

  • A cycle is detected in the object graph.  This will cause an infinite loop.

    People,
    Looking for a little guidance.  Please point me in the correct direction if I am mistaken.  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 some times, 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@24d793f3 -> net.es.nsi.pce.discovery.jaxb.NotificationType@7f06bc07 -> net.es.nsi.pce.discovery.jaxb.DocumentType@24d793f3]
    I am wondering if there could be a different reason for receiving the following exception?
    Thank you for the help,
    John
    [code]
    [ERROR] [08/22/2014 11:16:22.307] [NSI-DISCOVERY-akka.actor.default-dispatcher-4] [akka://NSI-DISCOVERY/user/discovery-notificationRouter/$c] 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@24d793f3 -> net.es.nsi.pce.discovery.jaxb.NotificationType@7f06bc07 -> net.es.nsi.pce.discovery.jaxb.DocumentType@24d793f3]
            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@24d793f3 -> net.es.nsi.pce.discovery.jaxb.NotificationType@7f06bc07 -> net.es.nsi.pce.discovery.jaxb.DocumentType@24d793f3
            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@24d793f3 -> net.es.nsi.pce.discovery.jaxb.NotificationType@7f06bc07 -> net.es.nsi.pce.discovery.jaxb.DocumentType@24d793f3
            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
    [/code]

    Unfortunately, even this thread is unanswered, i am closing the thread.as it it creating problems for further posting

  • Domain design causing full object graph serialization

    Hello,
    I work on a project, based on 3-layer-architecture. We have rich client developed on swing, application server and we persist our domain objects in the database.
    We map the domain objects using hibernate, send the same objects (means, we use POJOs and don't use DTO) via spring from application server to the server and visa versa in case the objects are to be saved, deleted etc.
    We use an object identity store on the client side, in which all already loaded objects are stored.
    My challenge is as follows:
    - Since an object is stored in the object store, the same certain object is used in every GUI module. Imagine, we have customer, account and a list of transactions per account. In practice, let's say:
    1 customer
    2 accounts
    1000 transactions per account which ever exist
    - In one of the modules, the used loaded all list of transactions. So, at that moment, 1 customer object, 2 accounts and 2000 transaction objects are bound to each other via java references (object graph).
    - On another module, the user wants to edit a very small attribute of customer object, say he corrects his birthday date and saves it.
    - Saving operation sends the customer object to the server. But the problem is, a very big object graph hangs on this one little customer object and are serialized to the server, although the
    service.save(customer);is called, and this costs extremely much time for our application.
    boldSOLUTION:*bold* We solved the problem with a hack, as we used the serialization over XStream framework from Thoughtworks in xml-format. We could set a cut in the serialization and have serialized only the customer object for that use case.
    So the problem for the save-use case was solved. This has a disadventage: the loading time (server-client (de-)serialization) using xml is longer than the java standard, especially remarkable if you load a big number of objects.
    I've read many articles about the enterprise architectures which are related to domain objects, dto, serialization. It is not uncommon to avoid DTOs and use POJOs on the server and client as well, if the domain objects don't contain business logic. So, I just wonder, how the problem above should be solved smartly, if the non-DTO, say POJO alternative is chosen.
    I appreciate your opinions.
    I hope my question is not too long. Thanks in advance,
    A sample code:
    (The concrete case in our application requires the navigability from customer to account)
    public class Customer implements Serializable {
         private Set<Account> acounts = new HashSet<Account>();
         // Getters, setters
    public class Account implements Serializable {
         private Set<AccTransaction> acounts = new HashSet<AccTransaction>();
         // Getters, setters
    public class AccTransaction implements Serializable {
         private String operation;
         private Timestamp timestamp;
         // Getters, setters
    }Alper

    acelik wrote:
    Thanks for the quick answer.
    The numbers are just wildly guesses, in order to keep the sample simple.
    Actually we develop a system for automobile industry. So, instead of customer, you may think of a company, like Ford. Account would be then Fiesta. Instead of AccTransaction we may think a huge number of car pieces (clima, motor, radio, etc.).
    So hierarchically we have
    Company (Ford, Opel, etc)
    Model (Fiesta, Astra, etc.)
    Piece (1000 pieces per model, so Fiesta, Opel have 1000 different pieces each)
    The problem is, if I loaded the Ford->Fiesta->1000x pieces for one view and then switch to another view. In the second view, I rename Fiesta to Fiesta II, and want to save this renaming operation using:
    What exactly does that represent?
    If you want to rename an existing car then you need logic to do exactly that. You do not copy the entire tree.
    If however you do want to copy the entire tree then that is in fact what you must do. Although I seriously doubt that there is a valid business requirement for that. In terms of efficiency though you could write a proc that did that rather than propogating the tree.
    Although further if you do in fact have two cars which use the same inventory item(s) then, again, you do not copy the entire tree because you are not creating a brand new inventory item. Instead you should only be pointing to an existing item.
    I wonder how this problem is solved smartly, if you guys share domain objects between the client and server, and avoid DTO.The first step is to start with actual business requirements.

  • EJB3 Entities + Web Services: A cycle is detected in the object graph

    I have a Java EE 5 application, using Glassfish v2. My ejb project consists of a handful of entity beans, session beans, and this problem arose when I added a new web service.
    Here is a simple scenario borrowed from another forum post with a similar problem:
    Let's say I have a web service called getVehicle(int vehicleId) that returns a Vehicle object.
    Vehicle has a java.util.Set of Wheel objects.
    The Wheel object has a reference to its owner (Vehicle).
    The issue is this bi-directional relationship causes a cycle that the JAX system doesn�t like.
    Caused by: javax.xml.bind.MarshalException
    - with linked exception:
    [com.sun.istack.SAXException2: A cycle is detected in the object graph. This will cause infinitely deep XML: org.test.Vehicle at 13c6308 -> org.test.Wheel at 15880be -> org.test.Vehicle at 13c6308
                  at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:282)
                  at com.sun.xml.bind.v2.runtime.BridgeImpl.marshal(BridgeImpl.java:110)
                  at com.sun.xml.bind.api.Bridge.marshal(Bridge.java:178)
                  at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:299)
                  ... 54 more
    The one bit of information that I found that might fix this doesn't do much for me:
    https://jaxb.dev.java.net/guide/Mapping_cyclic_references_to_XML.html
    What options do I have to make my soap method work?
    Thanks,
    Hugh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    i have got the same issue�C
    how did you implement onCycleDetected method�H
    can you send your full code to my mail [email protected]
    thanks !

  • Saving object graph containing transient-new and attached objects

    Problem
    We have simple FK relationship A->B relationship and create inside the transaction (service façade method) a new instance of A:
    A a = new A().
    Later in the same transaction we read independent instance of B from DB and put it in the ralationship with A:
    a.setB(b);
    Afterthat (in the same transaction) we want to save the object graphstarting with instance ‘a’. We do it with
    pm.attachCopy(a);
    We get an Exception:
    <4|false|4.0.0EA5> kodo.util.UserException:
    The instance "mypackage.A-pypackage.A-14638" is already managed.
    FailedObject: mypackage.A - mypackage.A -14638 at kodo.jdo.PersistenceManagerImpl.processArgument(PersistenceManagerImpl.java:1259)
    Known solution
    Detach the instance ‘b’ before calling pm.attachCopy(a);
    We could achieve this for example using Autodetach=commit and puting read and save operations in separate transactional methods (façade calls).
    This solution is unsatifying, because we want to be able to manipulate object graph inside the transaction without caring explicitly about attach/detach semantic.
    Question
    We habe an heterogeneous object graph consisting of attached, detached and transient-new objects. How can we make the graph persistent with one API call on the roor object ?
    Which mapping settings have to be done ? How KODO decides which object is ‘new’ and shhould be inserted and which obejct has to be updated ?

    Denis,
    Even the makePersistent (...) call is redundant but not harmful as long
    as the instance is managed (and not detached).
    Denis Sukhoroslov wrote:
    Hi Andre,
    Not clear, why do you call pm.attachCopy(a) at all. I haven't worked with
    kodo 4.0 yet, but in 3.4.0 you just need to call pm.makePersistent(a). In
    the same way you can persist whole object graph, AFAIK.
    Denis.
    "Andre Teshler" <[email protected]> wrote in message
    news:[email protected]..
    Problem
    We have simple FK relationship A->B relationship and create inside the
    transaction (service fa??ade method) a new instance of A:
    A a = new A().
    Later in the same transaction we read independent instance of B from DB
    and put it in the ralationship with A:
    a.setB(b);
    Afterthat (in the same transaction) we want to save the object
    graphstarting with instance ???a???. We do it with
    pm.attachCopy(a);
    We get an Exception:
    <4|false|4.0.0EA5> kodo.util.UserException:
    The instance "mypackage.A-pypackage.A-14638" is already managed.
    FailedObject: mypackage.A - mypackage.A -14638 at
    kodo.jdo.PersistenceManagerImpl.processArgument(PersistenceManagerImpl.java:1259)
    Known solution
    Detach the instance ???b??? before calling pm.attachCopy(a);
    We could achieve this for example using Autodetach=commit and puting read
    and save operations in separate transactional methods (fa??ade calls).
    This solution is unsatifying, because we want to be able to manipulate
    object graph inside the transaction without caring explicitly about
    attach/detach semantic.
    Question
    We habe an heterogeneous object graph consisting of attached, detached and
    transient-new objects. How can we make the graph persistent with one API
    call on the roor object ?
    Which mapping settings have to be done ? How KODO decides which object is
    ???new??? and shhould be inserted and which obejct has to be updated ?

  • JPA:A cycle is detected in the object graph

    HI Friends,
    I am facing bit too many errors while working with JPA.unfortunately we dont have proper examples which can provided  clarity.
    Here in my case : I have Two Entities
    One to One bidirectional.
      EMPLOYEE
      CUBICLE.
    Employee.java
    @Entity
    @Table(name = "CS1_EMPLOYEE")
    public class Employee {
         @Id
         private int id;
         private String name;
        @OneToOne(cascade=CascadeType.ALL)
        private Cubicle cubicle;
         public int getId() {
              return id;
         public void setId(int id) {
              this.id = id;
         public String getName() {
              return name;
         public void setName(String name) {
              this.name = name;
         public Cubicle getCubicle() {
              return cubicle;
         public void setCubicle(Cubicle assignedCubicle) {
              this.cubicle = assignedCubicle;
    Cubicle.java
    @Entity
    @Table(name = "CS1_CUBICLE")
    public class Cubicle {
         @Id
         private int id;
         private String cubeName;
         // Bidirectional
         @OneToOne(mappedBy="cubicle",cascade=CascadeType.ALL)
         private Employee employee;
         public int getId() {
              return id;
         public void setId(int id) {
              this.id = id;
         public String getCubeName() {
              return cubeName;
         public void setCubeName(String cubeName) {
              this.cubeName = cubeName;
         public Employee getEmployee() {
              return employee;
         public void setEmployee(Employee residentEmployee) {
              this.employee = residentEmployee;
    *sql file*
    CREATE TABLE "CS1_EMPLOYEE"
        "ID"           Integer    NOT NULL,
        "NAME"         Varchar (12) UNICODE,
        "CUBICLE_ID"   Integer,
        PRIMARY KEY ("ID")
    CREATE TABLE "CS1_CUBICLE"
    "ID"          Integer    NOT NULL,
        "CUBENAME"      Varchar (12) UNICODE,
        PRIMARY KEY ("ID")
    Session Bean(EJB)
    when i test this method i am gettig the error(Method In Bean)
    public Cubicle findCubicleById(int id)
         String jpql = "select c from Cubicle c where c.id = " +id;
             Query q = em.createQuery(jpql);
             Cubicle c = (Cubicle)q.getSingleResult();
             return c;
    error
    [com.sun.istack.SAXException2: A cycle is detected in the object graph. This will cause infinitely deep XML: com.sap.com.jpacasestudy1.model.Employee@1ae5bf7 -> com.sap.com.jpacasestudy1.model.Cubicle@75e38d -> com.sap.com.jpacasestudy1.model.Employee@1ae5bf7])->com.sap.engine.services.webservices.espbase.server.additions.exceptions.ProcessException: Connection IO Exception. Check nested exception for details. (Exception; nested exception is:  javax.xml.bind.MarshalException
    I am unable to trace what the error is.Any help from SDN Experts?
    Regards
    Chandra Dasari
    Edited by: chandra shekar dasari on Jul 16, 2009 1:48 PM:ver1te
    Edited by: chandra shekar dasari on Jul 16, 2009 1:49 PM:code re

    Unfortunately, even this thread is unanswered, i am closing the thread.as it it creating problems for further posting

  • Windows Azure Active Directory MA - Maximum number of items that can be serialized or deserialized in an object graph is '500000'. Change the object graph or increase the MaxItemsInObjectGraph quota.

    Trying to use WAAD with FIM 2010 R2 SP1 (4.1.3496.0) and during export several objects cause a warning/info with:
    Maximum number of items that can be serialized or deserialized in an object graph is '500000'. Change the object graph or increase the MaxItemsInObjectGraph quota.
    I looked, this appears hard coded into the MA, anyone know what causes this? My best guess is something like a large group membership? Does anyone know what the limits around the WAAD MA are?
    Here is the indepth error logged during the failure:
    ProvisioningServiceAdapter::ExecuteWithRetry: Action: Export, Attempt: 0, Exception: Microsoft.Online.Coexistence.ProvisionRetryException: Unable to communicate with the Windows Azure Active Directory service. Tracking ID: e94e6020-8434-4aa7-9a29-b2edf7fe6b2e
    See the event log for more details. ---> System.ServiceModel.CommunicationException: There was an error while trying to serialize parameter http://schemas.microsoft.com/online/aws/change/2010/01:syncObjects. The InnerException message was 'Maximum number
    of items that can be serialized or deserialized in an object graph is '500000'. Change the object graph or increase the MaxItemsInObjectGraph quota. '.  Please see InnerException for more details. ---> System.Runtime.Serialization.SerializationException:
    Maximum number of items that can be serialized or deserialized in an object graph is '500000'. Change the object graph or increase the MaxItemsInObjectGraph quota.
       at System.Runtime.Serialization.XmlObjectSerializerContext.IncrementItemCount(Int32 count)
       at WriteArrayOfstringToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , CollectionDataContract )
       at System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type
    declaredType)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerializeReference(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
       at WriteSyncObjectGroupToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )
       at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type
    declaredType)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerializeReference(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
       at WriteArrayOfSyncObjectToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , CollectionDataContract )
       at System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
       at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
       at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
       at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
       at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameterPart(XmlDictionaryWriter writer, PartInfo part, Object graph)
       --- End of inner exception stack trace ---
    Server stack trace:
       at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameterPart(XmlDictionaryWriter writer, PartInfo part, Object graph)
       at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameter(XmlDictionaryWriter writer, PartInfo part, Object graph)
       at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameters(XmlDictionaryWriter writer, PartInfo[] parts, Object[] parameters)
       at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeBody(XmlDictionaryWriter writer, MessageVersion version, String action, MessageDescription messageDescription, Object returnValue, Object[] parameters, Boolean
    isRequest)
       at System.ServiceModel.Dispatcher.OperationFormatter.OperationFormatterMessage.OperationFormatterBodyWriter.OnWriteBodyContents(XmlDictionaryWriter writer)
       at System.ServiceModel.Channels.Message.OnWriteMessage(XmlDictionaryWriter writer)
       at System.ServiceModel.Channels.BufferedMessageWriter.WriteMessage(Message message, BufferManager bufferManager, Int32 initialOffset, Int32 maxSizeQuota)
       at System.ServiceModel.Channels.BinaryMessageEncoderFactory.BinaryMessageEncoder.WriteMessage(Message message, Int32 maxMessageSize, BufferManager bufferManager, Int32 messageOffset)
       at System.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(Message message)
       at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
       at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.Online.Coexistence.Schema.IProvisioningWebService.Provision(SyncObject[] syncObjects)
       at Microsoft.Online.Coexistence.ProvisionHelper.InvokeAwsAPI[T](Func`1 awsOperation, String opsLabel)
       --- End of inner exception stack trace ---
       at Microsoft.Online.Coexistence.ProvisionHelper.CommunicationExceptionHandler(CommunicationException ex)
       at Microsoft.Online.Coexistence.ProvisionHelper.InvokeAwsAPI[T](Func`1 awsOperation, String opsLabel)
       at Microsoft.Azure.ActiveDirectory.Connector.ProvisioningServiceAdapter.<>c__DisplayClass1.<Export>b__0()
       at Microsoft.Azure.ActiveDirectory.Connector.ProvisioningServiceAdapter.ExecuteWithRetry(String actionName, Action action).

    Hi gdedshg,
    >>Maximum number of items that can be serialized or deserialized in an object graph is '65536'. Change the object graph or increase the MaxItemsInObjectGraph quota
    When meet the above exception, please try to do the following configuration:
    On the server side:
    Add the following to the server's config file:
    <behaviors>
    <serviceBehaviors>
    <behavior name="MyServiceBehavior">
    <dataContractSerializer
    maxItemsInObjectGraph="2147483647" />
    </behavior>
    </serviceBehaviors>
    </behaviors>
    And reference it in the service using the following code:
    <services>
    <service
    behaviorConfiguration="MyServiceBehavior"
    name="serviceName">……
    On the client side:
    Add the following: 
    <behaviors>
    <endpointBehaviors>
    <behavior name="MyClientbehavior">
    <dataContractSerializer
    maxItemsInObjectGraph="2147483647"/>
    </behavior>
    </endpointBehaviors>
    </behaviors>
     And reference it in the endpoint using the following code:
    <endpoint address="serviceAddress"
    behaviorConfiguration="MyClientbehavior"
    For more information, please try to refer to the following article:
    http://blog.aggregatedintelligence.com/2011/01/wcf-maxitemsinobjectgraph-error.html .
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Maximum number of items that can be serialized or deserialized in an object graph is '65536'.

    I meet the this error:
    Maximum number of items that can be serialized or deserialized in an object graph is '65536'. Change the object graph or increase the MaxItemsInObjectGraph quota.
    How to solve the above error?

    Hi gdedshg,
    >>Maximum number of items that can be serialized or deserialized in an object graph is '65536'. Change the object graph or increase the MaxItemsInObjectGraph quota
    When meet the above exception, please try to do the following configuration:
    On the server side:
    Add the following to the server's config file:
    <behaviors>
    <serviceBehaviors>
    <behavior name="MyServiceBehavior">
    <dataContractSerializer
    maxItemsInObjectGraph="2147483647" />
    </behavior>
    </serviceBehaviors>
    </behaviors>
    And reference it in the service using the following code:
    <services>
    <service
    behaviorConfiguration="MyServiceBehavior"
    name="serviceName">……
    On the client side:
    Add the following: 
    <behaviors>
    <endpointBehaviors>
    <behavior name="MyClientbehavior">
    <dataContractSerializer
    maxItemsInObjectGraph="2147483647"/>
    </behavior>
    </endpointBehaviors>
    </behaviors>
     And reference it in the endpoint using the following code:
    <endpoint address="serviceAddress"
    behaviorConfiguration="MyClientbehavior"
    For more information, please try to refer to the following article:
    http://blog.aggregatedintelligence.com/2011/01/wcf-maxitemsinobjectgraph-error.html .
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Breadth-first traversal on a graph.. need help

    I need to make a graph, then run a breadth-first traversal on it. Do I simply make an undirected graph first, then implement the traversal?
    the graph should be like this:
    A - D - G
    B - E - H
    C - F - I
    Message was edited by:
    LuckY07
    Message was edited by:
    LuckY07
    null

    I just would like to print something to the screen showing it ran, such as the letters. What would be an easy way to do this using the DirectedGraph implementation? tks.
    here is my code:
    import ADTPackage.*;     //packages needed to make graph.
    import GraphPackage.*;
    public class graphTraversal
         public static void main(String[] args)
              GraphInterface<String> graph = new DirectedGraph<String>();     //creates graph.
              //adds vertices.
              graph.addVertex("A");
              graph.addVertex("B");
              graph.addVertex("C");
              graph.addVertex("D");
              graph.addVertex("E");
              graph.addVertex("F");
              graph.addVertex("G");
              graph.addVertex("H");
              graph.addVertex("I");
              //adds edges.
              graph.addEdge("A", "B");
              graph.addEdge("A", "D");
              graph.addEdge("A", "E");
              graph.addEdge("D", "G");
              graph.addEdge("D", "G");
              graph.addEdge("G", "H");
              graph.addEdge("H", "I");
              graph.addEdge("I", "F");
              graph.addEdge("F", "C");
              graph.addEdge("C", "B");
              graph.addEdge("B", "E");
              graph.addEdge("E", "H");
              graph.addEdge("E", "F");
              graph.addEdge("F", "H");
              System.out.println("total number of vertices: " + graph.getNumberOfVertices());
              System.out.println("total number of edges: " + graph.getNumberOfEdges());
              graph.getBreadthFirstTraversal("A");
         }     //end main.
    }

  • CS3 - Object; Graph; Type - Crash

    Working in InDesign and Illustrator CS3 and having 2 problems:
    - From within Illustrator I have an existing simple bar graph that has been plotted and the bar colors changed. The client wants the left axis changed from a maximum of 50% to 60%. When I select a piece and go to Object; Graph; Type the program crashes. Tried this 3 times in a row and the program crashes every time.
    Would this Graph be corrupt in someway?? Can I resave, rename??
    - The other problem is within InDesign: Select the Graph, Edit Original and Illustrator will crash.
    Peter

    I realize this is an old post, but I've had the same crashing in Illustrator when selecting Type for many versions (since they haven't significantly updated the tool since, ever?). I've recently finally figured out why it happens, at least for my situation, so I'm posting here in case it happens to help someone else.
    The default behavior for charts in Illustrator is for the plotted points/bars/etc. to be on top of other graph elements. With line graphs this is usually fine, but with bar charts it's visually stupid—the bars will appear half on the axis line and half off. So I figured out that I can rearrange the stacking order of the bars by selecting just the bars with the direct/group select tool and sending to back. Works great…
    But then I get the crash when selecting Object>Graph>Type. Every time, reproducible.
    Illustrator doesn't mind if I click twice on the axis and bring it to the front. So I'm relieved there's another way, but I haven't figured out how to fix a chart that's been "broken."

  • 'One' To 'Many' relationship, (with the 'One' shared between persistance object graphs)

    Hi,
    I'm relatively new to JDO. So I need some verification on my program design.
    When creating a new Persistence Object I'm using a 'Builder' design pattern
    to check the database for an object that equals the new objects bean
    parameters(Via a JDOQL query). If it finds a matching one it loads it
    otherwise it creates a new instance.
    This way I have common objects between Persistence Object graphs. And there
    is not repeated common objects in the database.
    Is there a better way?
    regards
    Graham Cruickshanks

    // Doesn't workWhat does not work? What error do you get?
    You need to use "join" to define a join.
    CriteriaQuery<Competence> cq = cb.createQuery(Competence.class);
    Root<Competence> competence = cq.from(Competence.class);
    Join<CompetenceName> name = competence.join(Competence_.competenceNames);
    cq.orderBy(cb.asc(name.get(CompetenceName_.name));
    The "fetch" will do a fetch join, if you also wish to load the data in the same query.
    James : http://www.eclipselink.org

  • The selected objects cannot be joined as they are invalid objects,( Compound paths, closed paths, Text Objects, Graphs, Live Paint group). You can use Join command to connect two or more paths, paths in groups; ot to close an open path.

    Hi I was trying to join two Ractangle Tool objects but getting this type of Error in illustrator cs6 :-
    The selected objects cannot be joined as they are invalid objects,( Compound paths, closed paths, Text Objects, Graphs, Live Paint group).
    You can use Join command to connect two or more paths, paths in groups; ot to close an open path.
    Please assist me asap.

    Yes, I know this is an old post, but I’m trying to clean them up. Did you solve this problem, if so what was the solution?
    This sound like a firewall issue. I would start by disabling the firewall and seeing if you can connect. If this works then you know where the problem is,
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • Transferring object graph over RMI

    Hi all,
    I'm designing a client-server thingy, and am intending it to communicate over RMI. I'm currently designing a filter mechanism to let the client see a certain subset of the state (essentially an object graph), manipulate this, and transfer updates of it back to the server, which then are propagated to the other clients and so on.
    Any tips and tricks to take into account when transfering interconnected objects over RMI? (They don't need remove references, apart from the state transfer process, all local references are sufficient.) Also, I'd like to not transfer the entire "graph", only updates to it as they happen.
    I have a couple of ideas, I'd just like to hear your input before I dwelve more into the mechanics of them..
    Thanks!
    /C

    Go for it.
    Just think clearly about where the objects exist, and what get's transferred:
    o What objects are on the clients?.
    o What is a shared remote object?
    o What objects get passed from client to server? What objects are returned to clients?

  • Constructing JTree with object[ ] vs object graph

    I have data in a resultset that represents a parent-child relationship. there are fields that identify the parent as well as the position of the item
    Now i want to display this information in a JTree.
    The field format is something like this:
    description parentid level1 level2 level3 level4... etc up to level7
    the level{#} fields determine the position in the tree
    im also looking at the examples here
    http://www.ictp.trieste.it/~manuals/programming/Java/tutorial/uiswing/components/tree.html#data
    im wondering if i need to implement my own treemodel or just create my object array and feed it to the JTree constructor
    suggestions welcome

    Hi,
    I have study JAAS with J2EE for the last two months, don't know whether my ideas can help you. I believed JAAS was designed for java programmer who wanted to have security implement in there application but do not want to write the security themself. JAAS provided a robust system so that someone else can come alone to plug in the security module and security would be implemented.
    Base on your problems, I think what you should do is to have what know as a security access level implement in your object. When you uses JAAS to verify username & password, you can get user's access level as well maybe from LDAP server attribute, store in your principal. So whenever you want to check whethere you're a editor or author.
    You have to identify what is business logic and security logic access level is a business logic, therefore you will have to implement in your application tier. There is no perfect solution, but having these module will save you lots of coding and flexibility.
    Cheers,
    ps: Please correct me if my view are wrong.

  • WebLogic WS having trouble serializing object graph with circular refs.

    I am currently working with WL8.1 and we have a webservice that wraps some Java objects to send them over the wire. The problem is that these Java objects contain references to each other (ie. circular). WL doesn't like this and throws a recursion error when it tries to serialize them for the SOAP message.
    Is there some setting to use a refID like XMLEncoder does or stop recursing after a certain point? I am using WLW 8.1.3 to create the web service.
    TIA,
    Lou

    Skipping the 'why' here's a thought:
    - Add a toXML() method to your top level domain class and do your own custom serialization to XML.
    curt

Maybe you are looking for