hai,
  When I tried to send a RemoteObject which is to be send to an RMIServer through the session bean,
got the following exception at the client side itself.
Here Test1 is the client side RemoteObject and TestRemote is the remote interface of the bean, the stub
code fragement generated by the java2iiop utility of inprise appserver is
 
  public void testingRMI (com.tbn.ems.common.RMIRouter arg0) throws java.rmi.RemoteException {
 
    try {
      while (true) {
        if (!_is_local()) {
          org.omg.CORBA.portable.OutputStream _output = null;
          org.omg.CORBA.portable.InputStream  _input  = null;
          try {
            _output = this._request("testingRMI", true);
            file://Fix: Cannot use helper class because of potential stub downloading
            _output.write_Object((org.omg.CORBA.Object)arg0);                                ----IN THIS LINE EXCEPTION OCCURS
            _input = this._invoke(_output);
          }
          catch (org.omg.CORBA.portable.ApplicationException _exception) {
            System.out.println("an exception occured");
            _exception.printStackTrace();
            final org.omg.CORBA.portable.InputStream in = _exception.getInputStream();
            java.lang.String _exception_id = _exception.getId();
            file://FIX: Wrap original Exception here?
            throw new java.rmi.UnexpectedException("Unexpected User Exception: " + _exception_id);
          }
          catch (org.omg.CORBA.portable.RemarshalException _exception) {
            continue;
          }
          finally {
            this._releaseReply(_input);
          }
        } else {
          final org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("testingRMI", _opsClass);
          if (_so == null) {
            continue;
          }
          final TestRemoteOperations _self = (TestRemoteOperations)_so.servant;
          try {
            _self.testingRMI(arg0);
          }
          finally {
            _servant_postinvoke(_so);
          }
        }
        break;
      }
    }
    catch (org.omg.CORBA.portable.UnknownException ex) {
      if (ex.originalEx instanceof java.lang.RuntimeException) {
        throw (java.lang.RuntimeException) ex.originalEx;
      } else if (ex.originalEx instanceof Exception) {
        throw new java.rmi.ServerException(ex.getMessage(), (java.lang.Exception)ex.originalEx);
      } else {
        throw new java.rmi.ServerError(ex.getMessage(), (java.lang.Error) ex.originalEx);
      }
    }
    catch (org.omg.CORBA.SystemException ex) {
      throw javax.rmi.CORBA.Util.mapSystemException(ex);
    }
  }
 
 
 
stack trace:
    java.lang.ClassCastException: Test1
     at _TestRemote_Stub.testingRMI(_TestRemote_Stub.java:41)
     at RTest.testingRMI(RMIClient.java:76)
     at RMIClient.main(RMIClient.java:18)
What is wrong here? When I tried to send another bean's remote reference it works fine.
What is the difference between the two ? We tried using rmic with -iiop option too.
 
thanks in advance.
ramesh

Reply via email to