question: public static org . omg . CORBA . Object remoteToCorba ( Remote remoteObj , ORB orb ) throws ClassNotFoundException , ConfigurationException { synchronized ( CorbaUtils . class ) { if ( toStubMethod == null ) { initMethodHandles ( ) ; } } java . lang . Object stub ; try { stub = toStubMethod . invoke ( null , new java . lang . Object [ ] { remoteObj } ) ; } catch ( InvocationTargetException e ) { Throwable realException = e . getTargetException ( ) ; ConfigurationException ce = new ConfigurationException ( "Problem with PortableRemoteObject.toStub(); object not exported or stub not found" ) ; ce . setRootCause ( realException ) ; throw ce ; } catch ( IllegalAccessException e ) { ConfigurationException ce = new ConfigurationException ( "Cannot invoke javax.rmi.PortableRemoteObject.toStub(java.rmi.Remote)" ) ; ce . setRootCause ( e ) ; throw ce ; } if ( ! corbaStubClass . isInstance ( stub ) ) { return null ; } try { connectMethod . invoke ( stub , new java . lang . Object [ ] { orb } ) ; } catch ( InvocationTargetException e ) { Throwable realException = e . getTargetException ( ) ; if ( ! ( realException instanceof java . rmi . RemoteException ) ) { ConfigurationException ce = new ConfigurationException ( "Problem invoking javax.rmi.CORBA.Stub.connect()" ) ; ce . setRootCause ( realException ) ; throw ce ; } } catch ( IllegalAccessException e ) { ConfigurationException ce = new ConfigurationException ( "Cannot invoke javax.rmi.CORBA.Stub.connect()" ) ; ce . setRootCause ( e ) ; throw ce ; } return ( org . omg . CORBA . Object ) stub ; }
target:  Returns the CORBA object reference associated with a Remote object by using the javax.rmi.CORBA package. <p> Use reflection to avoid hard dependencies on javax.rmi.CORBA package. This method effective does the following: <blockquote><pre> java.lang.Object stub; try { stub = PortableRemoteObject.toStub(remoteObj); } catch (Exception e) { throw new ConfigurationException("Object not exported or not found"); } if (!(stub instanceof javax.rmi.CORBA.Stub)) { return null; // JRMP impl or JRMP stub } try { ((javax.rmi.CORBA.Stub)stub).connect(orb);  // try to connect IIOP stub } catch (RemoteException e) { // ignore 'already connected' error } return (javax.rmi.CORBA.Stub)stub;