0 Replies Latest reply on Apr 9, 2004 5:40 AM by paragsagdeo

    Connection refused if lookup is performed behind firewall

    paragsagdeo

      I am writing an applet that is looking up for a bean deployed in jboss 3.2.1 container on remote machine, I m behind firewall, when I run the applet it throws following error
      --------------------------------------------------------------------------------------------------------------------------------
      java.rmi.ConnectException: Connection refused to host: 200.190.130.110; nested exception is:
      java.net.ConnectException: Connection refused: connect
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
      at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
      at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
      at sun.rmi.server.UnicastRef.invoke(Unknown Source)
      at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
      at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:135)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:96)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
      at $Proxy6.create(Unknown Source)

      --------------------------------------------------------------------------------------------------------------------------------
      I provide correct username and password when java ask for firewall (realm: ntlm) password.
      This is how I am performing lookup
      --------------------------------------------------------------------------------------------------------------------------------
      Properties props = new Properties();
      props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory" );
      props.put(Context.PROVIDER_URL,"http://200.190.130.110:8080/invoker/JNDIFactory" );
      props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      try {
      InitialContext ctx = new InitialContext(props);
      Object sessionRemoteRef = ctx.lookup("MySessionJNDI");
      if (sessionRemoteRef == null) {
      System.out.println("got null from ctx.lookup");
      } else {
      MySessionHome sessionHome = (MySessionHome)sessionRemoteRef;
      sessionRemote = (MySession)sessionHome.create();
      }
      } catch (NamingException e) {
      throw e;
      } catch (RemoteException e) {
      throw e;
      } catch (CreateException e) {
      throw e;
      }

      --------------------------------------------------------------------------------------------------------------------------------
      But when I disable firewall client everything works fine. Can you please tell me how to tackle the problem?
      Also when I disable the firewall and run the applet it throws NamingException with cause StreamCorruptedException,
      but this peculiar behaviour is only for the first time, second time (when I refresh the browser) it works fine.

      Thanks & Regards,

      Parag