title: java.io.ObjectStreamClass cannot be cast to java.lang.String
body: <pre><code>java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
  java.lang.ClassCastException: java.io.ObjectStreamClass cannot be cast to java.lang.String
  at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
  at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
  at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:359)
  at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
  at com.nxl.smssession.SessionRMI.&lt;init&gt;(SessionRMI.java:33)
  at com.nxl.smssession.Main.main(Main.java:33)
  Caused by: java.lang.ClassCastException: java.io.ObjectStreamClass cannot be cast to java.lang.String
  </code></pre>
  
  <p>Can someone explain why this error is happening</p>
  
  <p>This is happening when i am doing <strong>RMI Bind Operation</strong></p>
  
  <p>This problem is happening on <strong>SOLARIS</strong> System only, it is working fine in windows and Linux</p>
  
  <p>Here is the code which generates this error</p>
  
  <pre><code>public SessionRMI(String servicename) throws AlreadyBoundException {  
      SessionImpl service = new SessionImpl();   
      try {  
          logger.debug("Publishing the SMS Session endpoint " + servicename);  
          SessionIface stub = (SessionIface) UnicastRemoteObject.exportObject(service, 0);  
          Registry registry = LocateRegistry.getRegistry(); 
          registry.rebind(servicename, stub);  
          logger.debug("SMS Session endpoint published successfully "+servicename);  
      } catch (RemoteException ex) {  
          logger.error(ex.toString()); ex.printStackTrace();  
      }  
  } 
  </code></pre>
  
  <p>Thanks in advance</p>