8.1 Cycles in object graph using readExternal/writeExternal causes stack overflow - Weblogic

This is a discussion on 8.1 Cycles in object graph using readExternal/writeExternal causes stack overflow - Weblogic ; We have ported our JDK 1.3 WLS5.1 application ot JDK 1.4 WLS8.1SP2. (1M lines in the repository , web, swing and command line batches) We solved a previous marshalling problem with our JWS client by using the weblogic.jar instead of ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: 8.1 Cycles in object graph using readExternal/writeExternal causes stack overflow

  1. 8.1 Cycles in object graph using readExternal/writeExternal causes stack overflow


    We have ported our JDK 1.3 WLS5.1 application ot JDK 1.4 WLS8.1SP2. (1M lines
    in the repository , web, swing and command line batches) We solved a previous
    marshalling problem with our JWS client by using the weblogic.jar instead of the
    wlclient.jar.

    We now have a problem where the weblogic server throws a stack overflow exception
    when serializing some of our object graphs to send back to the swing client.
    The object graphs that have problems all have cylcles in them. ACase-->(property)-->AProperty-->(parent)-->ACase.
    Object graphs without cycles all work fine. We use custom readExternal and writeExternal
    methods for all our data objects. The serialization using readExternal/writeExternal
    methods work fine for JDK1.3 stand alone, JDK1.3 WLS 5.1 and JDK 1.4 stand alone.
    They serialization fails under JDK1.4 WLS8.1SP2 and when JDK1.4 standalone using
    the output stream in the WLS8.1SP2 weblogic.jar file. It looks like the output
    stream is not recognizing the fact that ACase has already been serialized so it
    continually loops between the case and property untl the stack overflow. Case
    has a line that reads stream.writeObject(aProperty); and property has a line that
    reasds stream.writeObject(parentCase); We have written a test case using our
    data object that shows the failure but have not created a standalone test file.


    Has anyone else seen this?

    The JDK test passes and the weblogic test fails with a stack overflow

    /**
    * verify a case can be serialized
    *
    */
    public void testJDKSerialization(){
    TZCaseDO sourceObject = this.getBigGraphOfTestData();
    ObjectOutputStream outStream = null;
    try
    {
    ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
    outStream = new ObjectOutputStream(byteOut);
    outStream.writeObject(sourceObject);
    outStream.flush();
    cat.info("byte stream length is "+byteOut.size());
    }
    catch(Exception e)
    {
    cat.info("deep copy threw",e);
    fail("caught exception"+ e);
    }
    finally
    {
    // close the stream in a finally clause
    // this would work even if an exception had been caught and rethrown
    // or if we had a return statement in teh try block.
    try {
    if (outStream != null) {
    outStream.close();
    }
    } catch (java.io.IOException ioe){
    // what do we do here?
    cat.info("got exception closing input stream.. what the heck?",ioe);
    }
    }
    return;
    }

    /**
    * verify a case can be serialized
    *
    */
    public void testWebLogicSerialization(){
    TZCaseDO sourceObject = this.getBigGraphOfTestData();
    weblogic.common.internal.ChunkedObjectOutputStream outStream = null;
    try
    {
    outStream =
    new weblogic.common.internal.ChunkedObjectOutputStream ();
    outStream.writeObject(sourceObject);
    outStream.flush();

    }
    catch(Exception e)
    {
    cat.info("web logic chunk write blew",e);
    fail("caught exception"+ e);
    }
    finally
    {
    // close the stream in a finally clause
    // this would work even if an exception had been caught and rethrown
    // or if we had a return statement in teh try block.
    try {
    if (outStream != null) {
    outStream.close();
    }
    } catch (java.io.IOException ioe){
    // what do we do here?
    cat.info("got exception closing input stream.. what the heck?",ioe);
    }
    }
    return;
    }









  2. Re: 8.1 Cycles in object graph using readExternal/writeExternalcauses stack overflow

    "Joe Freeman" writes:

    > We have ported our JDK 1.3 WLS5.1 application ot JDK 1.4 WLS8.1SP2. (1M lines
    > in the repository , web, swing and command line batches) We solved a previous
    > marshalling problem with our JWS client by using the weblogic.jar instead of the
    > wlclient.jar.


    If it is possible to report this to support that would be great. Note
    that you may be running into a known fragmentation issue here which
    can be solve by specifying -Dcom.sun.CORBA.giop.ORBGIOP12BuffMgr=0 in
    the client.

    > We now have a problem where the weblogic server throws a stack overflow exception
    > when serializing some of our object graphs to send back to the swing client.
    > The object graphs that have problems all have cylcles in them. ACase-->(property)-->AProperty-->(parent)-->ACase.
    > Object graphs without cycles all work fine. We use custom readExternal and writeExternal


    I don't know what is going on here - you will need to follow up with support.

    Thanks

    andy

  3. Re: 8.1 Cycles in object graph using readExternal/writeExternal


    Andy Piper wrote:
    >"Joe Freeman" writes:
    >> We now have a problem where the weblogic server throws a stack overflow

    >exception
    >> when serializing some of our object graphs to send back to the swing

    >client.
    >> The object graphs that have problems all have cylcles in them. ACase-->(property)-->AProperty-->(parent)-->ACase.
    >> Object graphs without cycles all work fine. We use custom readExternal

    >and writeExternal
    >
    >I don't know what is going on here - you will need to follow up with
    >support.


    Support was very helpful. The following property setting on the client and server
    lets us choose a serialization model that works for our data graph.

    -Dweblogic.kernel.useJavaSerializationForExternaliz able="true"


+ Reply to Thread