United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6828768 RMI-IIOP EJB clients do not fail over due to defect in JDK 1.6.0_12
JDK-6828768 : RMI-IIOP EJB clients do not fail over due to defect in JDK 1.6.0_12

Details
Type:
Bug
Submit Date:
2009-04-10
Status:
Closed
Updated Date:
2014-03-12
Project Name:
JDK
Resolved Date:
2009-11-02
Component:
other-libs
OS:
windows_xp
Sub-Component:
corba:orb
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
5.0u12,6u12
Fixed Versions:
6u17-rev (b06)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Relates:

Sub Tasks

Description
the failover works fine, if client uses the thick client( WebLogic ORB). 
The bug seems to be in  com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.java 

With the exception:

org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 203  completed: No 
        at com.sun.corba.se.impl.logging.ORBUtilSystemException.writeErrorSend(ORBUtilSystemException.java:2231) 
        at 
com.sun.corba.se.impl.logging.ORBUtilSystemException.writeErrorSend(ORBUtilSystemException.java:2253) 
        at 
com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.writeLock(SocketOrChannelConnectionImpl.java:933) 
        at 
com.sun.corba.se.impl.encoding.BufferManagerWriteStream.sendFragment(BufferMan @ agerWriteStream.java:78) 
        at 
com.sun.corba.se.impl.encoding.BufferManagerWriteStream.sendMessage(BufferMana gerWriteStream.java:96) 
        at 
com.sun.corba.se.impl.encoding.CDROutputObject.finishSendingMessage(CDROutputObject.java:144) 
        at 
com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.finishSendingRequest(CorbaMessageMediatorImpl.java:247) 
        at 
com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete1(CorbaClientRequestDispatcherImpl.java:342) 
        at 
com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:323) 
        at 
com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:129) 
        at 
com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:213) 
        at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112) 
        at weblogic.corba.j2ee.naming.Utils.narrowContext(Utils.java:126) 
        at 
weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:94) 
        at 
weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:31) 
        at 
weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:41) 
        at 
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667) 
        at 
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) 
        at javax.naming.InitialContext.init(InitialContext.java:223) 
        at javax.naming.InitialContext.<init>(InitialContext.java:197) 
        at 
ServerAffinityHashtablePropsTest.main(ServerAffinityHashtablePropsTest.java:25) 

To reproduce the problem:
------------------------

Please download the attachment 

	TestCase_Sun.zip

After downloading the attachment, extract it and you will find three files

1) client.jar - This jar contains the EJB client and needs to be put in the Client Classpath

2) ejb20_basic_statefulSession.ear - This ear is the EJB application which needs to be deployed on WebLogic Server

3) ejb20_basic_statefulSession_client.jar - This client jar contains the stubs and other artifacts required for the EJB client to run.

The problem:
-------------
From customer:
On receiving ForwardRequest exception, JDK ORB threw RemarshalException which causes request to be sent to the failover target set in the ForwardRequest object. Where as in JDK 1.6.0_12-b04 on receiving ForwardRequest exception, JDK ORB is throwing   org.omg.CORBA.COMM_FAILURE instead of RemarshalException and org.omg.CORBA.COMM_FAILURE will not cause request to be sent to the failover target set in the ForwardRequest object. This seems to be a bug in the JDK.


Steps to replicate
------------------
1) Create a domain in WebLogic Server 10.3 using the the latest SUN JDK 1.6 available.
2) Start the server and deploy the ejb20_basic_statefulSession.ear application to a WebLogic Cluster of two managed server instances.
3) Start the application
4) Set the client classpath correctly

For eg:

C:\bea103\user_projects\domains\EJB_IIOP_Failoverdomain>set CLASSPATH=C:\bea103\wlserver_10.3\server\lib\wlclient.jar;C:\bea103\user_projects\domains\EJB_IIOP_Failoverdomain\EJB_IIOP\client\ejb20_basic_statefulSession_client.jar;C:\bea103\user_projects\domains\EJB_IIOP_Failoverdomain\EJB_IIOP\client\client.jar;%CLASSPATH%

5) Invoke the client

For eg:

C:\bea103\user_projects\domains\EJB_IIOP_Failoverdomain>java -Xbootclasspath/p:C:\bea103\user_projects\domains\EJB_IIOP_Failoverdomain\EJB_IIOP\client\jdkpatch.jar examples.ejb20.basic.statefulSession.Client iiop://localhost:7003,localhost:7004

6) Now, when the client is invoked, it would make a request to any of the managed servers, you can watch the stdout of the managed servers to see which one was invoked. Kill that server immediately.

7) Now, you would see an exception in the client, as it was not able to failover to the next server

You will notice a org.omg.CORBA.COMM_FAILURE exception in the client window. There is a sleep added for one minute in the EJB client code in order to give you room for shutting down the WebLogic managed instance.

                                    

Comments
EVALUATION

The exception doesn't seem to be thrown when retry is false.
fix is to throw an appropriate type of exception based on whether it is a RuntimeException or RemarshalException.

Also, since this produces a warning, Ken has suggested to modify the setting for this to FINE instead of being a WARNING.

Cus has verified the binary after these 2 changes to indicate that their problem is resolved.
                                     
2009-10-08
EVALUATION

http://hg.openjdk.java.net/jdk7/tl/corba/rev/ff0f02a67881
                                     
2010-11-30
EVALUATION

http://hg.openjdk.java.net/jdk7/build/corba/rev/ff0f02a67881
                                     
2010-12-25
EVALUATION

Recategorizing to jets/idl/orb because this is about RMI-IIOP.
                                     
2009-04-10



Hardware and Software, Engineered to Work Together