Mon, 29 Nov 2010 22:10:46 -0800
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
1.1 --- a/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerWriteStream.java Thu Oct 07 01:03:51 2010 -0700 1.2 +++ b/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerWriteStream.java Mon Nov 29 22:10:46 2010 -0800 1.3 @@ -30,12 +30,14 @@ 1.4 import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; 1.5 import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase; 1.6 import com.sun.corba.se.impl.protocol.giopmsgheaders.FragmentMessage; 1.7 +import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage; 1.8 import com.sun.corba.se.impl.encoding.BufferManagerWrite; 1.9 import com.sun.corba.se.impl.encoding.ByteBufferWithInfo; 1.10 import com.sun.corba.se.impl.encoding.CDROutputObject; 1.11 import com.sun.corba.se.spi.orb.ORB; 1.12 import com.sun.corba.se.pept.transport.Connection; 1.13 import com.sun.corba.se.pept.encoding.OutputObject; 1.14 +import org.omg.CORBA.SystemException; 1.15 1.16 /** 1.17 * Streaming buffer manager. 1.18 @@ -66,7 +68,13 @@ 1.19 // Set the fragment's moreFragments field to true 1.20 MessageBase.setFlag(bbwi.byteBuffer, Message.MORE_FRAGMENTS_BIT); 1.21 1.22 - sendFragment(false); 1.23 + try { 1.24 + sendFragment(false); 1.25 + } catch(SystemException se){ 1.26 + orb.getPIHandler().invokeClientPIEndingPoint( 1.27 + ReplyMessage.SYSTEM_EXCEPTION, se); 1.28 + throw se; 1.29 + } 1.30 1.31 // Reuse the old buffer 1.32
2.1 --- a/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java Thu Oct 07 01:03:51 2010 -0700 2.2 +++ b/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java Mon Nov 29 22:10:46 2010 -0800 2.3 @@ -385,11 +385,15 @@ 2.4 boolean retry = 2.5 getContactInfoListIterator(orb) 2.6 .reportException(messageMediator.getContactInfo(), e); 2.7 + 2.8 + //Bug 6382377: must not lose exception in PI 2.9 + 2.10 + // Must run interceptor end point before retrying. 2.11 + Exception newException = 2.12 + orb.getPIHandler().invokeClientPIEndingPoint( 2.13 + ReplyMessage.SYSTEM_EXCEPTION, e); 2.14 + 2.15 if (retry) { 2.16 - // Must run interceptor end point before retrying. 2.17 - Exception newException = 2.18 - orb.getPIHandler().invokeClientPIEndingPoint( 2.19 - ReplyMessage.SYSTEM_EXCEPTION, e); 2.20 if (newException == e) { 2.21 continueOrThrowSystemOrRemarshal(messageMediator, 2.22 new RemarshalException()); 2.23 @@ -398,6 +402,14 @@ 2.24 newException); 2.25 } 2.26 } else { 2.27 + if (newException instanceof RuntimeException){ 2.28 + throw (RuntimeException)newException; 2.29 + } 2.30 + else if (newException instanceof RemarshalException) 2.31 + { 2.32 + throw (RemarshalException)newException; 2.33 + } 2.34 + 2.35 // NOTE: Interceptor ending point will run in releaseReply. 2.36 throw e; 2.37 }