4 Replies Latest reply on Mar 19, 2004 2:17 AM by Marco Rouse

    Can't see remote interfase

    Marco Rouse Newbie

      Hi all,
      I have a small problem trying to conect to a remote bean im runing the remote on a debian server with apache and jboss 3.2.3 on an other server im running tomcat-5.0.19 i got it to conect but the create method returns null
      private Carrito carritoX = null;

      public void jspInit() {

      try {
      java.util.Properties p = new java.util.Properties();
      p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
      p.put(Context.PROVIDER_URL, "xxx.xxx.1.39:1099");
      Context jndiContext = new InitialContext(p);
      Object ref = jndiContext.lookup("CarritoEJB");
      servimx.CarritoHome home = (servimx.CarritoHome)PortableRemoteObject.narrow(ref, servimx.CarritoHome.class);
      Carrito carritoX = home.create();
      I GET NO EXECPTION ERROR BUT WHEN I TRY TO ACCESS carritoX it's null , need help urgently

        • 1. Re: Can't see remote interfase
          Adrian Brock Master

          Replace your lookup with a System.out.println
          of each element of the enumeration from listBindings("");
          What do you see?

          Regards,
          Adrian

          • 2. Re: Can't see remote interfase
            Marco Rouse Newbie

            I get a list [CarritoEJB: $Proxy33, jmx: org.jnp.interfaces.NamingContext, OIL2XAConnectionFactory: org.jboss.mq.SpyXAConnectionFactory, HTTPXAConnectionFactory: org.jboss.mq.SpyXAConnectionFactory, ConnectionFactory: org.jboss.mq.SpyConnectionFactory, UserTransactionSessionFactory: $Proxy10, HTTPConnectionFactory: org.jboss.mq.SpyConnectionFactory, XAConnectionFactory: org.jboss.mq.SpyXAConnectionFactory, invokers: org.jnp.interfaces.NamingContext, UserTransaction: org.jboss.tm.usertx.client.ClientUserTransaction, RMIXAConnectionFactory: org.jboss.mq.SpyXAConnectionFactory, UILXAConnectionFactory: javax.naming.LinkRef, UIL2XAConnectionFactory: org.jboss.mq.SpyXAConnectionFactory, local: org.jnp.interfaces.NamingContext, queue: org.jnp.interfaces.NamingContext, topic: org.jnp.interfaces.NamingContext, console: org.jnp.interfaces.NamingContext, UIL2ConnectionFactory: org.jboss.mq.SpyConnectionFactory, UILConnectionFactory: javax.naming.LinkRef, RMIConnectionFactory: org.jboss.mq.SpyConnectionFactory, OIL2ConnectionFactory: org.jboss.mq.SpyConnectionFactory, UUIDKeyGeneratorFactory: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory]

            • 3. Re: Can't see remote interfase
              Marco Rouse Newbie

              and as soon as i leave the init carritoX is null, but in the init my home
              CarritoEJBHome org.jboss.proxy.ClientContainer@1cb374f dos'nt throw any exception in the loaderToCache i get sun.misc.Launcher$AppClassLoader@e80a59={servimx.CarritoHome;javax.ejb.Handle;=java.lang.ref.WeakReference@12088db}

              • 4. Re: Can't see remote interfase
                Marco Rouse Newbie

                I got it, i made 2 refrences to the same bean so i have 2 instances of the same corrected my code like so :
                insted of Carrito carritoX = home.create(); i have
                carritoX = (servimx.Carrito)home.create(); and it works perfictly

                Thanks