Why constructor of rmi server throws remote exception

why is it that the constructor of the class extending UnicastRemoteObject i.e rmi server has to throw RemoteException?

Writing an RMI server is a matter of defining a class, exporting it when constructed and implementing one or more remote interfaces. How to export?
auto export happens when u call super() in the constructor. It is then registered with the rmi system and made to listen to a TCP port. The various constructors for UnicatRemoteObject allow the derived classes to export at the default port.
Because this automatic export step occurs at construction the constructors throw this exception.

Similar Messages

  • Office 365 Sandbox Solution EventReceiver throwing Remote Exception in ItemAdding

    Hi,
    I created a sandbox webpart for O365 with EventReceivers with ItemAdding for Document Library and while i upload a document to library in O365  sharepoint site application throws below exception:-
    System.Runtime.Remoting.RemotingException: Server encountered an internal error. For more information, turn off customErrors in the server's .config file.
    Server stack trace: 
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.SharePoint.Administration.ISPUserCodeExecutionHostProxy.Execute(Type us
    Same code works perfectly on my Development machine, Please help. Below is the Code
    base.EventFiringEnabled = false;
    bool isFile = (properties.AfterProperties["vti_filesize"] != null);
    if (isFile == true)                   
    SPWeb currentWeb = properties.OpenWeb();
    // Get foldername from url like Document/EC10001/filename.txt                       
    string folderName = properties.AfterUrl.Split(new char[] { '/' })[1];
    SPList spList = currentWeb.Lists[properties.List.ID];                       
    SPQuery spQuery = new SPQuery();                       
    spQuery.Query = "<OrderBy><FieldRef Name='Modified' Ascending='FALSE'/></OrderBy>";
    //Getting the folder object from the list                       
    SPFolder folder = spList.RootFolder.SubFolders[folderName];
    //Set the Folder property                       
    spQuery.Folder = folder;
    int fileSequenceId = 0;                      
    SPListItemCollection items = spList.GetItems(spQuery);
    if (items.Count > 0)                       
    string documentID = items[0]["DocumentID"] != null ? items[0]["DocumentID"].ToString() : string.Empty;
    if (!string.IsNullOrEmpty(documentID))                           
    string splitNumber = documentID.Split(new char[] { '-' })[1];                               
    fileSequenceId = Convert.ToInt32(splitNumber) + 1;                           
    else                           
    properties.ErrorMessage = "Unable to generate Document Id";                               
    properties.Cancel = true;                           
    else                       
    fileSequenceId = 1;                       
    // Set DocumentID like EC10001-001                       
    properties.AfterProperties["DocumentID"] = folderName + "-" + fileSequenceId.ToString(ConstantsList(currentWeb, "DocumentID"));      
    // Retrive "EEC000" string from Constant List               
    properties.AfterProperties["vti_title"] = folderName + "-" + fileSequenceId.ToString(ConstantsList(currentWeb, "DocumentID"));   
    // Retrive "EEC000" string from Constant List                
    base.EventFiringEnabled = true;
    Thanks,
    Pranay Chandra Sapa

    Hi,
    According to your description, my understanding is that when you upload document in Office 365 site, the event receiver in sandbox solution throws error.
    Per my knowledge, if you want to use event receiver in Office 365 environment, you need to use remote event receiver instead the normal event receiver in an app.
    Here are some detailed articles for your reference:
    Create a remote event receiver in apps for SharePoint
    Handle events in apps for SharePoint
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • DOTNET RFC-Server: Throwing ABAP-exceptions

    Dear all,
    how do I throw ABAP-exceptions in a generated RFC-server?
    When I have an RFC-function module like the attached one in an SAP system and generate a server for this function module, how can I throw the ABAP-exception WRONG_UUID (for example in the C# code attached)?
    I haven't found an rfc-server example dealing with ABAP-exceptions.
    Best regards,
       Willy
    FUNCTION ZZZ.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(UUID) TYPE  SYSUUID_C DEFAULT SPACE
    *"  EXCEPTIONS
    *"      WRONG_UUID
        // Implementation of remote function module ZZZ
        protected override void Zzz (
               string Uuid)
          // TODO: add your server code here

    Hi Willy
    If I am not mistaken, it should be ...
    RfcAbapException ns = new RfcAbapException("WRONG_UUID", " Wrong user Id");
    throw ns;
    Not a C# guru but it should be something like that.

  • RMI-server communicates oracle: Exception

    Hallo everybody,
    My task is:
    - to implement in oracle Java stored procedure,
    - to implement RMI server
    - to load in oracle wrapper for Connection-object (ConnectionImpl), that has a reference at Connection (default oracle Connection), this ConnectionImpl-object will be passed to RMI-server, the RMI-server will call a method on this object.
    - Stub and Skeleton of ConnectionImpl are on both sides available (inside of oracle (as .jar) and on RMI-server side).
    First I start RMI-server. Then I call the stored procedure. It finds RMI-server, calls the method on RMI-server side, then RMI-server tries to call the method of ConnectionImpl with the following result:
    Fehler: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
         java.net.SocketException: Connection reset
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
         java.net.SocketException: Connection reset
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
         java.net.SocketException: Connection reset
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
         at sun.rmi.transport.Transport$1.run(Transport.java:148)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
         at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
         at java.lang.Thread.run(Thread.java:534)
         at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
         at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
         at server.NativeDllServer_Stub.init(Unknown Source)
         at storedprocedure.OracleTest.verbinde(OracleTest:26)
    Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
         java.net.SocketException: Connection reset
         at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:274)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)
         at elena.ConnectionImpl_Stub.returnString(Unknown Source)
         at server.NativeDllServer.init(NativeDllServer.java:18)
    I will be thankful for every tip, how I can resolve it.

    Its clear you have the java permission set to allow db Java to write to a socket, since the call to the RMI server works, but maybe you are missing the permission to allow db java to listen and/or read from a socket?
    See:
    http://download-west.oracle.com/docs/cd/B14117_01/java.101/b12021/security.htm#sthref714
    for java.net.SocketPermission
    Chris

  • Why Overridden method do not throw Broder exception

    Why Overridden method of derived class do not throw Broder exception than the method that is in base class

    Why Overridden method of derived class do not throw
    Broder exception than the method that is in base classWhat is a Broder Exception?
    I don't understand your question?
    You are asking something about overriding a method:
    http://java.sun.com/docs/books/tutorial/java/IandI/override.html

  • Restart an rmi server after an exception

    I am making a client server application in java /rmi
    I have four clients forming a group on theserver and all of them have some state . Now if one of the mlogs off
    I will get a remoteexception on the server . I would like to allow another user to log in in place of the this chap who logged off and continue from the last state of the object.
    any clues?
    even if I save the state of the object(some datastructures) when I first get an remoteexception ,
    howwill I allow a new client to take the old one's place?

    any ideas anyone>?

  • J2EE server throws exception as it starts up

    I just installed j2eesdkv1.4 on Windows 2000 and tried to start the server with command j2ee -verbose. THe server throws an exception:
    org.omg.CORBA.INTERNAL: vmcid: SUN minor code: 209 completed: No
    at com.sun.corba.se.internal.iiop.GIOPImpl.createListener(GIOPImpl.java:
    253)
    at com.sun.corba.se.internal.iiop.GIOPImpl.getEndpoint(GIOPImpl.java:202
    at com.sun.corba.se.internal.POA.POAORB.setPersistentServerPort(POAORB.j
    ava:445)
    at com.sun.enterprise.iiop.POAEJBORB.setPersistentServerPort(POAEJBORB.j
    ava:418)
    at com.sun.enterprise.iiop.POAProtocolMgr.setPersistentServerPort(POAPro
    tocolMgr.java:147)
    at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:201)
    at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:720)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.commons.launcher.ChildMain.run(ChildMain.java:280)
    J2EE server fatal error
    java.lang.RuntimeException:
    at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:334)
    at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:720)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.commons.launcher.ChildMain.run(ChildMain.java:280)
    Caused by: org.omg.CORBA.INTERNAL: vmcid: SUN minor code: 209 completed: No
    at com.sun.corba.se.internal.iiop.GIOPImpl.createListener(GIOPImpl.java:
    253)
    at com.sun.corba.se.internal.iiop.GIOPImpl.getEndpoint(GIOPImpl.java:202
    at com.sun.corba.se.internal.POA.POAORB.setPersistentServerPort(POAORB.j
    ava:445)
    at com.sun.enterprise.iiop.POAEJBORB.setPersistentServerPort(POAEJBORB.j
    Could somebody let me know what I need to do to get past this problem?

    hi friends
    i also have the same problem while starting j2ee1.4 server
    and Change the property value of "orb.port" in the
    %j2ee_home%\config\server-config.xml from 1050 to 1051
    but the problem still remain there
    plz help me
    naveen

  • Stateful Session deleted on Remote Exception ?

    Hi,
    Our statefull session bean gets deleted, whenever it throws Remote exception.
    Actually the internal exception is caught and the method throws' Remote Exception.
    After the exception the bean cannot be accessed from it's remote interface. All we
    get is the error saying the bean is removed or deleted. Is this a known behavior.
    All help appreciated
    Thanks,
    Venki
    Exception :
         = ===================================
         = ======= Reason ===================
         = ===================================
         java.rmi.NoSuchObjectException: Bean has been deleted.
         Start server side stack trace:
         java.rmi.NoSuchObjectException: Bean has been deleted.
         at weblogic.ejb20.swap.DiskSwap.read(DiskSwap.java:155)
         at weblogic.ejb20.manager.StatefulSessionManager.getBean(StatefulSession
         Manager.java:242)
         at weblogic.ejb20.manager.StatefulSessionManager.preInvoke(StatefulSessi
         onManager.java:313)
         at weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:11
         7)
         at weblogic.ejb20.internal.StatefulEJBObject.preInvoke(StatefulEJBObject
         .java:170)

    Thanks,
    V
    "Dimitri I. Rakitine" <[email protected]> wrote:
    Yup, this is exactly what is supposed to happen. RemoteException isA system
    exception
    and it is container's responsibility to, among other things, discard the
    bean instance.
    If you want different behaviour then throw a checked application exception
    (one which
    subclasses java.lang.Exception and not RuntimeException or RemoteException).
    Venki <[email protected]> wrote:
    Hi,
    Our statefull session bean gets deleted, whenever it throws Remoteexception.
    Actually the internal exception is caught and the method throws' RemoteException.
    After the exception the bean cannot be accessed from it's remote interface.All we
    get is the error saying the bean is removed or deleted. Is this a knownbehavior.
    All help appreciated
    Thanks,
    Venki
    Exception :
         = ===================================
         = ======= Reason ===================
         = ===================================
         java.rmi.NoSuchObjectException: Bean has been deleted.
         Start server side stack trace:
         java.rmi.NoSuchObjectException: Bean has been deleted.
         at weblogic.ejb20.swap.DiskSwap.read(DiskSwap.java:155)
         at weblogic.ejb20.manager.StatefulSessionManager.getBean(StatefulSession
         Manager.java:242)
         at weblogic.ejb20.manager.StatefulSessionManager.preInvoke(StatefulSessi
         onManager.java:313)
         at weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:11
         7)
         at weblogic.ejb20.internal.StatefulEJBObject.preInvoke(StatefulEJBObject
         .java:170)--
    Dimitri

  • RMI server double identity

    I have 2 PC in a small LAN, both with Windows XP professional.
    The machine acting as server has 2 IP adresses: the first one, static, from a permanent ADSL connection (213.155...), the second one from the LAN ethernet connection (192.168.0.1).
    The machine acting as client is a notebook, which sometimes is linked to the LAN with an ethernet connection, and sometimes is directly connected to the WAN by modem connection.
    Well, in the first case (LAN) RMI dialog works fine.
    But in the second case (direct modem connection to WAN), things don't work.
    RMI client tries to contatct the server using it's WAN IP addess (213.155..), and after a while it gets a time-out exception for connection to node 192.168.0.1 (i.e. the LAN server IP address, currently unused).
    Why does the RMI server, receiving a connection request on it's WAN address, try to assume the alternate LAN identity ?

    I've found the solution.
    The problem can be avoided inserting in the server application a statement like this:
    System.setProperty("java.rmi.server.hostname", <WAN IP address>);
    before binding the Implementation class in registry.
    Hope this will help somebody.
    Luigi Fonti

  • What is the point of having all RMI server classes be Serializable?

    I've confirmed that the serialVersionUID of the class is not the serialVersionUID of the generated stub. The class itself is never serialized and its fields don't need to be Serializable or transient. It is annoying me that Netbeans is giving me warnings about not defining serialVersionUID when there is clearly no point in doing so. So why does java.rmi.server.RemoteObject implement Serializable?

    I've confirmed that the serialVersionUID of the class is not the serialVersionUID of the generated stub.No reason why it should be.
    The class itself is never serializedSee below.
    So why does java.rmi.server.RemoteObject implement Serializable?RemoteObject is the base class for RemoteStub which certainly is serialized: that's the entire basis for RMI's operation.
    A remote object is also passed by serialization rather than by remote reference when it isn't exported.
    As for NetBeans ...

  • Why does MScomctl.o​cx throw a server exception in my LabVIEW executable when trying to set the ImageList?

    I am using the Microsoft Toolbar Control 6.0 (SP4) toolbar to display 32x32 pixel buttons.
    In development, this toolbar works flawlessly. Once the program is compiled, however, the function iToolbar: ImageList(putRef) sometimes gives the error "Error -2147417851 occurred at The server threw an exception. "
    This error does not alway happen, and when it doesn't happen, everything works normally.
    Anyone have an idea why this error is being generated?

    I managed to strip away my entire application and limit the problem to just the toolbar and images. Please see file included.
    If you want to play with it, you will have to make a build script. Your system will need to have activex components installed.
    Mscomctl.ocx is required.
    As I said above, this code fragment works ok in LabVIEW development mode, but occasionally fails when built into an executable. When it fails, it seems to fail many times in a row. It doesn't seem to be a timing problem because there is only one thread.
    Has anyone else out there had this problem and found a solution?
    Message Edited by terminalman90 on 08-10-2005 11:34 AM
    Attachments:
    terminalman90.zip ‏37 KB

  • RMI server and client in one application - Exceptions during some calls

    I wrote an application, which is an RMI-Server (Server1), and another separate application, which is an RMI-Client (Client1). Because I wont use dynamic class loading, I gave the client beside the interface.java also an interface_implementation.java, which is only a dummy of the original interface_implementation of the server. This dummy contains only declarations of the methods (parameters and return values) and no functional code. From this dummy the _stub.class is generated, and it works fine - no problem.
    Now I want to modify Client1 to become also an RMI-Server (Server2) for a second, separate Client (Client2), the methods used are different from the first RMI connection. This Client2 uses a dummy of the implementation of Server2 in the same way as described above. The application Client1+Server2 only has to "translate" the calls from Client2 to Server2 into calls of Client1 to Server1 (Server1 is not changed at all). In case of primitive method parameters or return values this chain of RMI-applications works fine, but in case of more complex structures (my own classes) during the call of Client1 to Server1 an "ClassNotFoundException: access denied to class loader" occurs by running through the stub. Both stub.classes are found, all of the applications know the objects needed, the call of Client1 to Server1 is exactly the same call as it was during the simple version (only Server1 and Client1).
    Does anybody know, why this exception occurs and how I can overcome this ?
    Axel

    I figured out a solution - it's a problem of policies. In detail: Server1's codebase entry (file:) refers to the class directory of Server1's project. In the simple case of only Client1, which has no codebase entry, it works fine without a file permission on the side of Server1. In the complex case of Client1+Server2, which has to have a codebase entry (file:) refering to the class directory of the Server2's project on a separate machine, for exactly the same method call from Client1 to Server1 a file permission entry on the side of Server1 is needed for Server1's class directory. But WHY ???
    It seems to be a little confusing with the codebase entries, many of the posts are contrary to others and to my personal experiences. Some comments given by Adrian Colley throw a little light upon some aspects. Is there anybody, who can explain the whole topic, when, why, and which part of RMI application deals with codebase entries, also in case of not dynamic code downloading ? May be there is also a reference into the java docs, which I didn't found up to now.
    Thanks in advance
    Axel

  • Rmi client throws Connection Refused exception

    My Rmi client throws a Connection Refused exception when i try to run it on remote machine (in this case i run it on my virtualbox macine).
    The virtualbox machine network is in NAT mode (host machine ip should be 10.0.2.2).
    When rmi client starts get registry instance and print in standar output:
    RegistryImpl_Stub[UnicastRef2 [liveRef: [endpoint:[//10.0.2.2/:1099,util,RmiInstances$1@1275d39](remote),objId:[0:0:0, 0]]]]But when rmi client trys to use any of remote methods it throws Connection Refused, but it's to strange because the Connection Refused has 127.0.1.1 as ip.
    java.rmi.ConnectException: Connection refused to host: 127.0.1.1; ....In client RmiInstances code (this class contains all remote implementations) is:
    public class RmiInstances {
        private static RmiInstances instance;
        private IUserManage userManage;
        private IAnalysis analysis;
        private IPacientManage pacientManage;
        private IInsuranceManage insuranceManage;
        private Config config;
        private RmiInstances()
                throws RemoteException, NotBoundException, IOException {
            this.config = Config.getInstance();
            Registry registry = LocateRegistry.getRegistry(config.getServerUrl()+"/",
                    1099, new RMIClientSocketFactory() {
                @Override
                public Socket createSocket(String host, int port) throws IOException {
                    try {
                        URI uri = new URI(config.getServerUrl()+
                                ":"+config.getServerPort());
                        return new Socket(uri.getHost(), uri.getPort());
                    } catch (URISyntaxException ex) {
                        ex.printStackTrace();
                        return null;
            System.out.println(registry);
            userManage = (IUserManage)registry.lookup("RUserManage");
            analysis = (IAnalysis)registry.lookup("RAnalysis");
            pacientManage = (IPacientManage)registry.lookup("RPacientManage");
            insuranceManage = (IInsuranceManage)registry.lookup("RInsuranceManage");
    ...And server code is the next:
    public static void main(String[] args) {
         System.out.println("GNULab Server " + VERSION + " starting...");
         System.setProperty("java.rmi.server.codebase",
              "file:/home/zarovich/workspace/labserver/bin");
         try {
             // Loading config
             System.out.println("Loading config...");
             Config config = Config.getInstance();
             // inicializando rmi registry
             Registry registry;
             if (config.isSsl()) {
              registry = LocateRegistry.createRegistry(
                   config.getServerPort(), new RmiSSLClient(),
                   new RmiSSLServer());
             } else
              registry = LocateRegistry
                   .createRegistry(config.getServerPort());
             // instanciando implementaciones
             RAnalysis rAnalysis = new RAnalysis();
             RInsuranceManage rInsuranceManage = new RInsuranceManage();
             RPacientManage rPacientManage = new RPacientManage();
             RUserManage rUserManage = new RUserManage();
             // registrando interfaz rmi
             registry.rebind("RAnalysis", (IAnalysis) UnicastRemoteObject.exportObject(rAnalysis, 0));
             registry.rebind("RInsuranceManage", (IInsuranceManage) UnicastRemoteObject.exportObject(rInsuranceManage, 0));
             registry.rebind("RPacientManage", (IPacientManage) UnicastRemoteObject.exportObject(rPacientManage, 0));
             registry.rebind("RUserManage", (IUserManage) UnicastRemoteObject.exportObject(rUserManage, 0));
             System.out.println("GNULab Server " + VERSION + " listening ...");
             System.out.println("Registry instance: " + registry.toString());
         } catch (RemoteException e) {
             e.printStackTrace();
            * catch (MalformedURLException e) { e.printStackTrace(); }
            */catch (IOException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
         } catch (JDOMException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
    ...

    I'm solved my problem.
    I just need run my server with -Djava.rmi.serverhost=10.0.2.2 and my client running on my virtualbox machine works!

  • JDK6 And ClassNotFound Exception during RMI server start

    Hello,
    I have been write a simple Hello World RMI, but I'm unable to start the server always get this exeception:
    Server exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: rmi.Hello
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: rmi.Hello
         at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:396)
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:250)
         at sun.rmi.transport.Transport$1.run(Transport.java:159)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
         at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
         at java.lang.Thread.run(Thread.java:619)
         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 rmi.HelloMain.main(HelloMain.java:21)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)The sources are these:
    package rmi;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface Hello extends Remote {
        public void sayHello() throws RemoteException;
    package rmi;
    import java.rmi.RemoteException;
    public class HelloServer implements Hello{
        public HelloServer() {
            super();
        public void sayHello() throws RemoteException {
            System.out.println("Ciau!");
    package rmi;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.registry.Registry;
    import java.rmi.server.UnicastRemoteObject;
    public class HelloMain {
        public static void main(String[] args) {
         try {
             Hello obj = new HelloServer();
             Hello stub = (Hello) UnicastRemoteObject.exportObject(obj, 0);
            // Bind the remote object's stub in the registry
            Registry registry = LocateRegistry.getRegistry();
            registry.bind("Hello", stub);
            System.err.println("Server ready");
        } catch (Exception e) {
            System.err.println("Server exception: " + e.toString());
            e.printStackTrace();
    }May be I'm wrong with start command, but I tried differents syntax without result.
    Can you help me?
    Thanks to all.
    PS:Sorry for my spaghetti-english :D

    I had similar issue and i got rid of it by doing the following:
    i. Start rmiregistry from the server code (so that the JVM remains the same) like this
    // Server.java
    Process pro = Runtime.getRuntime().exec("rmiregistry 1099 &");
    // ... ii. Use java.rmi.server.codebase property while starting the server
    D:\rmiEx\bin>java -Djava.rmi.server.codebase=file:/D:\rmiEx\bin example.hello.Server

  • NullPointerException with RMI-IIOP when throw a Exception

    Hi all,
    I have a ejb deployed in weblogic 5.1 sp12. I have a client in another weblogic
    5.1 sp11 that connects to the ejb using the protocol iiop.
    ctx = new javax.naming.InitialContext();
         prop = new Properties();
         prop.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
         provider="iiop://remote-machine:7001";
         prop.put(Context.PROVIDER_URL,provider);
    All works ok, but when my ejb throws and exception (UserNotFoundException),
    in the client I catch a NullPointeException (see StackTrace).
    If I use the t3 protocol, all works all right. I catch UserNotFoundException.
    My exception, UserNotFoundException extends java.lang.Exception.
    What is the problem?
    StackTrace:
    java.lang.NullPointerException
    at com.sun.corba.se.internal.io.IIOPInputStream.getOrderedDescriptions(IIOPInputStream.java:940)
    at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectUsingFVD(IIOPInputStream.java:1109)
    at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:262)
    at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:250)
    at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:212)
    at weblogic.iiop.IIOPInputStream.read_value(IIOPInputStream.java:1025)
    at weblogic.iiop.ReplyMessage.getThrowable(ReplyMessage.java:287)
    at weblogic.iiop.InboundResponseImpl.getThrowable(InboundResponseImpl.java:79)
    at weblogic.iiop.OutboundRequestImpl.sendReceive(OutboundRequestImpl.java:53)
    at netcustomer.ejb.OnlineServicesEJBHome_WLStub.create(OnlineServicesEJBHome_WLStub.java:271)
    at jsp_servlet._jsp.__testsequence._jspService(__testsequence.java:154)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:941)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:905)
    at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
    at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:391)
    at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:273)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
    Thanks a lot,
    Diego

    We have updated all weblogic to WLS5.1 SP12 with a jdk1.3.1.
    Now the problem is that the client can't conect to the server.
    If i use protocol iiop Never works. (stack trace).
    If i use t3 all works ok.
    But the best is that, if my server is a WL5.1 SP12 and the client is a WLS6.1
    SP2 using the iiop protocol all works ok.
    If i use t3, nothing works.
    <-- stack trace -->
    java.lang.ClassNotFoundException: netcustomer.ejb.OnlineServicesEJBHome_ServiceStub
    at weblogic.boot.ServerClassLoader.findLocalClass(ServerClassLoader.java:372)
    at weblogic.boot.ServerClassLoader.loadClass(ServerClassLoader.java:112)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:120)
    at weblogic.common.internal.TengahClassLoaders.loadClass(TengahClassLoaders.java:71)
    at weblogic.rmi.internal.Utilities.classForName(Utilities.java:233)
    at weblogic.rmi.internal.Utilities.classForName(Utilities.java:210)
    at weblogic.iiop.IIOPInvocationHandlerImpl.getServiceStub(IIOPInvocationHandlerImpl.java:188)
    at weblogic.iiop.IIOPInvocationHandlerImpl.getClusteredStub(IIOPInvocationHandlerImpl.java:143)
    at weblogic.iiop.IIOPInvocationHandlerImpl.resolveObject(IIOPInvocationHandlerImpl.java:114)
    at weblogic.iiop.IIOPReplacer.resolveObject(IIOPReplacer.java:375)
    at weblogic.iiop.AbstractMsgInput.readRemote(AbstractMsgInput.java:185)
    at weblogic.iiop.AbstractMsgInput.readObject(AbstractMsgInput.java:156)
    at weblogic.cos.naming.NamingContext_WLStub.resolve(NamingContext_WLStub.java:122)
    at weblogic.jndi.cosnaming.IIOPInitialContextServer.lookup(IIOPInitialContextServer.java:109)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    at jsp_servlet._jsp.__testsequence._jspService(__testsequence.java:176)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:945)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:909)
    at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
    at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:392)
    at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:274)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:130)
    javax.naming.NamingException: Unhandled error in lookup. Root exception is java.lang.NullPointerException
    at weblogic.iiop.IIOPInvocationHandlerImpl.getClusteredStub(IIOPInvocationHandlerImpl.java:162)
    at weblogic.iiop.IIOPInvocationHandlerImpl.resolveObject(IIOPInvocationHandlerImpl.java:114)
    at weblogic.iiop.IIOPReplacer.resolveObject(IIOPReplacer.java:375)
    at weblogic.iiop.AbstractMsgInput.readRemote(AbstractMsgInput.java:185)
    at weblogic.iiop.AbstractMsgInput.readObject(AbstractMsgInput.java:156)
    at weblogic.cos.naming.NamingContext_WLStub.resolve(NamingContext_WLStub.java:122)
    at weblogic.jndi.cosnaming.IIOPInitialContextServer.lookup(IIOPInitialContextServer.java:109)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    at jsp_servlet._jsp.__testsequence._jspService(__testsequence.java:176)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:945)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:909)
    at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
    at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:392)
    at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:274)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:130)
    Andy Piper <[email protected]> wrote:
    "Diego Ramírez" <[email protected]> writes:
    The NPE is because codebases are not supported in WLS 5.1 or 6.1 IIOP
    (they are in 7.0) and you are trying to serialize a class that has
    changed between the client and server. You might want to try fixing
    the SVUID on your exception in both client and server and seeing if
    that helps. Also you should really use SP12 in the client if you
    can. Also make sure you are using the same JDK version in client and
    server.
    andy
    Hi all,
    I have a ejb deployed in weblogic 5.1 sp12. I have a client in anotherweblogic
    5.1 sp11 that connects to the ejb using the protocol iiop.
    ctx = new javax.naming.InitialContext();
         prop = new Properties();
         prop.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
         provider="iiop://remote-machine:7001";
         prop.put(Context.PROVIDER_URL,provider);
    All works ok, but when my ejb throws and exception (UserNotFoundException),
    in the client I catch a NullPointeException (see StackTrace).
    If I use the t3 protocol, all works all right. I catch UserNotFoundException.
    My exception, UserNotFoundException extends java.lang.Exception.
    What is the problem?
    StackTrace:
    java.lang.NullPointerException
    at com.sun.corba.se.internal.io.IIOPInputStream.getOrderedDescriptions(IIOPInputStream.java:940)
    at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectUsingFVD(IIOPInputStream.java:1109)
    at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:262)
    at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:250)
    at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:212)
    at weblogic.iiop.IIOPInputStream.read_value(IIOPInputStream.java:1025)
    at weblogic.iiop.ReplyMessage.getThrowable(ReplyMessage.java:287)
    at weblogic.iiop.InboundResponseImpl.getThrowable(InboundResponseImpl.java:79)
    at weblogic.iiop.OutboundRequestImpl.sendReceive(OutboundRequestImpl.java:53)
    at netcustomer.ejb.OnlineServicesEJBHome_WLStub.create(OnlineServicesEJBHome_WLStub.java:271)
    at jsp_servlet._jsp.__testsequence._jspService(__testsequence.java:154)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:941)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:905)
    at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
    at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:391)
    at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:273)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
    Thanks a lot,
    Diego

Maybe you are looking for

  • Please Help with my 3G connection nightmare

    Im going to try to explain this without rambling on but i can almost write a novel with this problem. Got iphone on the 24 of july. First 3 weeks, phone, email, safari work great. One day, safari goes slow on 3g and/or doesn't connect at all. Reset,

  • Not able to use software-update but still connected to the internet

    Hi there , I am currently on 10.5.6 but did this upgrade manually. When I tried to use Software-Update it gave me : Cannot contact the update server. I am connected through Airport Extreme with my Macbook. My IMac is also on this Airport Express and

  • How to apply 11i July CPU Pathes.

    Hi How to apply Apps 11i July CPU Patches OS: Linux.. Thanks in Advance.

  • Random music with a playlist?

    Hi everyone, Just a simple question... I have been running with my Ipod and Nike+ thing for 2 weeks now, and Inwanted to know if it was possible to have random songs with a playlist I use for my jogging. I don't want random of all my songs, just from

  • Acrobat  9 standard no copy without encryption

    I just upgraded from 6 to 9. I want to prohibit copying in security but the dialog box wants to encrypt and I don't want to encrypt. I just want to disallow copying.