1 Reply Latest reply on Jul 27, 2007 12:14 PM by Taj

    Remote EJB

    kalyan chowdary Newbie

      Hi all,

      I want connect remote ejb which is deployed in jboss4.0.5 from swing application.

      It works fine in both(jboss+swing app) are in same system and also works fine both r in external ips like (123.*.*.*) but not working external ips like 123*.*.* & 61.*.*.*.

      my remote ejb connection in swing app is

      Properties p = new Properties();
      
       p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.HttpNamingContextFactory");
       p.put(Context.PROVIDER_URL, "http://"+remoteSystemIP+":9999/invoker/JNDIFactory");
      
      i got an exception like this
      
      javax.naming.CommunicationException: Operation failed [Root exception is java.rm
      i.ServerException: IOE; nested exception is:
       java.net.UnknownHostException: chambers]
       at org.jboss.naming.interceptors.ExceptionInterceptor.invoke(ExceptionIn
      terceptor.java:65)
       at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:7
      0)
       at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodIntercepto
      r.java:74)
       at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
       at $Proxy0.lookup(Unknown Source)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
       at javax.naming.InitialContext.lookup(InitialContext.java:351)
       at com.ehms.database.RemoteObjectInvocation.getRemoteObject(RemoteObject
      Invocation.java:43)
       at com.ehms.sales.AdminMainFrame$24.actionPerformed(AdminMainFrame.java:
      991)
       at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:18
      49)
       at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
      a:2169)
       at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
      .java:420)
       at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258
      )
       at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
       at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1
      000)
       at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMen
      uItemUI.java:1041)
       at java.awt.Component.processMouseEvent(Component.java:5488)
       at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
       at java.awt.Component.processEvent(Component.java:5253)
       at java.awt.Container.processEvent(Container.java:1966)
       at java.awt.Component.dispatchEventImpl(Component.java:3955)
       at java.awt.Container.dispatchEventImpl(Container.java:2024)
       at java.awt.Component.dispatchEvent(Component.java:3803)
       at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212
      )
       at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
      
       at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
       at java.awt.Container.dispatchEventImpl(Container.java:2010)
       at java.awt.Window.dispatchEventImpl(Window.java:1766)
       at java.awt.Component.dispatchEvent(Component.java:3803)
       at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
      
      
      Pls help me
      
      Thanks&Regards,
      kalyan
      


        • 1. Re: Remote EJB
          Taj Newbie

          Unknown Host exception is the problem. You have to make an entry in the IP host table

          Depending upon your platform

          Solaris:- add an entry in the /etc/hosts file

          # Internet host table
          #
          127.0.0.1 localhost
          <ipaddress> chambers


          since chambers is the unknown host.

          Windows:- add an entry to the C:\WINDOWS\system32\drivers\etc\hosts

          again same as the above.

          You will need to reboot the system for the change to take effect.

          Regards,
          Taj