# HG changeset patch # User vikram # Date 1291097446 28800 # Node ID ff0f02a67881eac9d906c8aa3b8d88c076a67ff1 # Parent 34af2070439b56e1011030ded33971672ede69ed 6382377: incorrect Exception is given to interceptor 6828768: RMI-IIOP EJB clients do not fail over due to defect in JDK 1.6.0_12 Summary: Also reviewed by ken.cavanaugh@oracle.com Reviewed-by: skoppar diff -r 34af2070439b -r ff0f02a67881 src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerWriteStream.java --- a/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerWriteStream.java Thu Oct 07 01:03:51 2010 -0700 +++ b/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerWriteStream.java Mon Nov 29 22:10:46 2010 -0800 @@ -30,12 +30,14 @@ import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase; import com.sun.corba.se.impl.protocol.giopmsgheaders.FragmentMessage; +import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage; import com.sun.corba.se.impl.encoding.BufferManagerWrite; import com.sun.corba.se.impl.encoding.ByteBufferWithInfo; import com.sun.corba.se.impl.encoding.CDROutputObject; import com.sun.corba.se.spi.orb.ORB; import com.sun.corba.se.pept.transport.Connection; import com.sun.corba.se.pept.encoding.OutputObject; +import org.omg.CORBA.SystemException; /** * Streaming buffer manager. @@ -66,7 +68,13 @@ // Set the fragment's moreFragments field to true MessageBase.setFlag(bbwi.byteBuffer, Message.MORE_FRAGMENTS_BIT); - sendFragment(false); + try { + sendFragment(false); + } catch(SystemException se){ + orb.getPIHandler().invokeClientPIEndingPoint( + ReplyMessage.SYSTEM_EXCEPTION, se); + throw se; + } // Reuse the old buffer diff -r 34af2070439b -r ff0f02a67881 src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java --- a/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java Thu Oct 07 01:03:51 2010 -0700 +++ b/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java Mon Nov 29 22:10:46 2010 -0800 @@ -385,11 +385,15 @@ boolean retry = getContactInfoListIterator(orb) .reportException(messageMediator.getContactInfo(), e); + + //Bug 6382377: must not lose exception in PI + + // Must run interceptor end point before retrying. + Exception newException = + orb.getPIHandler().invokeClientPIEndingPoint( + ReplyMessage.SYSTEM_EXCEPTION, e); + if (retry) { - // Must run interceptor end point before retrying. - Exception newException = - orb.getPIHandler().invokeClientPIEndingPoint( - ReplyMessage.SYSTEM_EXCEPTION, e); if (newException == e) { continueOrThrowSystemOrRemarshal(messageMediator, new RemarshalException()); @@ -398,6 +402,14 @@ newException); } } else { + if (newException instanceof RuntimeException){ + throw (RuntimeException)newException; + } + else if (newException instanceof RemarshalException) + { + throw (RemarshalException)newException; + } + // NOTE: Interceptor ending point will run in releaseReply. throw e; }