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
|
|
|
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
|
|
|
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
|
|
|
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
-----------------------------------------
|
|
|