7 Replies Latest reply on Dec 11, 2006 4:22 AM by cypnsv

    rmi.NoSuchObjectException

    kurdt

      Hi Guys !

      This is the situation: i always ran my application (Working Perfectly) on the same computer as my beans were deployed in this way:

      p.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      p.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
      p.put("java.naming.provider.url","localhost");



      and then

      InitialContext ctx = new InitialContext(p);


      and finally:

      ctx.lookup("AdmSolSn");



      Well, the problem is that now i have to run my app not in the same computer as JBoss, so i change "localhost" to "192.168.1.52" but this is what i get when i try to start the application:


      javax.naming.CommunicationException [Root exception is java.rmi.NoSuchObjectException: no such object in table]
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:647)[...]


      The exception references to the third piece of code i write on this post, what i am doing wrong ? do i have to set something more to connect to another JBoss Server?

      Please Help me,

      Thanks in advance :)

        • 1. Re: rmi.NoSuchObjectException
          jsloup

          This is my code, try it:

          p.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
          p.put("java.naming.provider.url","jnp://" + host + ":" + port);
          p.put("java.naming.factory.url.pkgs","org.jnp.interfaces");
          


          I think your problem is because of protocol and port is missing. Try it.

          Jiri Sloup




          • 2. Re: rmi.NoSuchObjectException
            kurdt

            Jiri:

            First, Thanks for answering me ! :)

            Second, I tried that and i get this that is Really strange!

            javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
            java.net.ConnectException: Connection refused: connect]
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:647)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)


            127.0.0.1 ? i am not connecting to my computer anymore, why i am getting this ?

            this is my code now:

            p.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
             p.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
             p.put("java.naming.provider.url","jnp://192.168.1.52:1099");


            • 3. Re: rmi.NoSuchObjectException
              kurdt

              Ok, i can't edit i want to add this:

              This is what i get when i try to telnet 192.168.1.52 1099, i see "127.0.0.1" is there something wrong with my jboss setup?
              (I have a web server running with it and is working just fine)

              ¼?sr?java.rmi.MarshalledObject|??ù?c?>??I?hashlocBytest?[BobjBytesq~?xp6<ur?[B¼?
              °T??xp?¼?thttp://web:83/q~q~uq~??¼?sr org.jnp.server.NamingServer_Stub??xrjava.r
              mi.server.RemoteStub????ïße?xr?java.rmi.server.RemoteObject?a?æ
              a3??xpw4
              UnicastRe
              f2 127.0.0.1?J??~?^æÄrÇ?x

              Connection to host lost.


              • 4. Re: rmi.NoSuchObjectException
                darranl

                Is the machine running JBoss a Linux machine?

                You need to edit /etc/hosts so that it contains the IP address of the machine instead of 127.0.0.1

                • 5. Re: rmi.NoSuchObjectException
                  kurdt

                  It's a FreeBSD Server,and YES it works now!

                  i am ashamed.. Thanks again

                  • 6. Re: rmi.NoSuchObjectException
                    gnokit

                     

                    "Kurdt" wrote:
                    It's a FreeBSD Server,and YES it works now!

                    i am ashamed.. Thanks again


                    thanks alot~!!!!!


                    • 7. Re: rmi.NoSuchObjectException
                      cypnsv

                      Hi

                      I have the same problem , But this is no windows machine, Please help me

                      I am accessing the rmi in a different way

                      String rmihost = schedulerURL + "/" + schedulerName; //"rmi://localhost:1099/Scheduler";
                       logger.debug("scheduler rmi host is : " + rmihost);
                       sch = (Scheduler) Naming.lookup(rmihost);
                       logger.debug("scheduler is : " + sch);


                      Please help...