JDK-4911077 : javax.rmi.CORBA.Util.isLocal(stub) restricts custom ORB
  • Type: Bug
  • Component: other-libs
  • Sub-Component: corba:orb
  • Affected Version: 8.0pe,1.3.1,1.4.2
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS:
    generic,linux_redhat_9.0,windows_2000 generic,linux_redhat_9.0,windows_2000
  • CPU: generic,x86
  • Submitted: 2003-08-22
  • Updated: 2005-04-22
  • Resolved: 2004-12-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2 04Fixed
Related Reports
Duplicate :  
Description
Hello All,

My ISV experienced one problem related to Sun CORBA Util Implementation
I tested it under jdk1.3, it works fine
but it fails on jdk1.4.2.

For test on jdk1.3 you need some jar files from ISV(or me) and some jar files
from j2sdk1.4.2/jre/lib

For test on jdk1.4 you only need some jar files from ISV(or me)
you will see a ClassCastException. it seems customer implemented Stub class
is not accept by javax.rmi.CORBA.Util.isLocal(Stub stub) method on jdk1.4.2
although it works fine on jdk1.3.

Comments
WORK AROUND create a simple class that extends Util and overrides isLocal(Stub stub) import javax.rmi.CORBA.Util; public class NewUtil extends Util { public static boolean isLocal(Stub stub) throws RemoteException { try { org.omg.CORBA.portable.Delegate delegate = stub._get_delegate() ; return delegate.isLocal( stub ) ; } catch (SystemException e) { throw javax.rmi.CORBA.Util.mapSystemException(e); } return false; } Then add the following default setting to your java command line -Djavax.rmi.CORBA.UtilClass=NewUtil ###@###.### 2003-10-14 Since this bug is still being referenced, I'll update this even though the bug is now closed. The above workaround is wrong. The correct class to extend in the Util DELEGATE, not the Util class itself (note the static method!). The correct fix looks more like: package test ; import org.omg.CORBA.SystemException ; import com.sun.corba.ee.spi.protocol.CorbaClientDelegate ; import javax.rmi.CORBA.Util ; import java.rmi.RemoteException ; public class NewUtil extends com.sun.corba.se.internal.javax.rmi.CORBA.Util { public boolean isLocal( javax.rmi.CORBA.Stub stub ) throws RemoteException { boolean result = false ; try { org.omg.CORBA.portable.Delegate delegate = stub._get_delegate() ; if (delegate instanceof CorbaClientDelegate) { result = super.isLocal( stub ) ; } else { result = delegate.is_local( stub ) ; } } catch (SystemException exc) { throw javax.rmi.CORBA.Util.mapSystemException(exc) ; } return result ; } } Please note that this is ONLY needed for the ORB in JDK 1.4.2. ###@###.### 2005-04-22 18:28:38 GMT
2005-04-22

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.4.2_04 tiger-beta FIXED IN: 1.4.2_04 tiger-beta INTEGRATED IN: 1.4.2_04 tiger-beta
2004-06-14

EVALUATION The delegate returned by stub._get_delegate() may not always be a ClientSubcontract ( Sun's ORB delegate ) so check to see if it is an instanceof of ClientSubcontract before casting. If not is must be a org.omg.CORBA.portable.Delegate so simply call is_local. ###@###.### 2003-10-14 -----------------------------------------
2003-10-14

SUGGESTED FIX src/share/classes/com/sun/corba/se/internal/iiop/ShutdownUtilDelegate.java 39c39,42 < return ((ClientSubcontract)delegate).useLocalInvocation( stub ) ; --- > if (delegate instanceof ClientSubcontract) > return ((ClientSubcontract)delegate).useLocalInvocation( stub ) ; > else > return delegate.is_local( stub ); ###@###.### 2003-10-14
2003-10-14