I am having a problem using HttpNamingContextFactory to access JNDI running within a JBoss server which is sitting behind a NAT.
This is happening with JBoss 3.2.6. I have customized my server config to use HTTPS for remote JNDI and EJB method invocations. Basically, when I try to look up the Home interface of an EJB I get a Connection refused error. The flow basically runs like this: 1) I create an Initial context, specifying HttpNamingContextFactory as the "java.naming.factory.initial" and specifying an url of the form "https://<nat.ip.address>:8443/invoker/JNDIFactory" for the "java.naming.provider.url". I also specify the "java.naming.factory.url.pkgs" as "org.jboss.naming:org.jnp.interfaces". 2) HttpNamingContextFactory makes the HTTPS request to ttps://<nat.ip.address>:8443/invoker/JNDIFactory and downloads the Naming Proxy. Within the Naming proxy is a URL referring to the JMXInvokerServlet of the form: "https://<actual.ip.address>:8443/invoker/JMXInvokerServlet" 3) When I try to do a lookup(String) for the EJB home interface, HttpInvokerProxy tries to access the Naming service using the "https://<actual.ip.address>:8443/invoker/JMXInvokerServlet" URL, which is inaccessible since it has the actual address of the server rather than the address of the NAT gateway. I can see in the mbean definition of the "jboss:service=invoker,type=http,target=Naming" mbean how the JMXInvokerServlet URL is built. The code within HttpProxyFactory clearly uses the local hostname or a jboss.bind.address if specified. In non-NAT cases, the lookup works fine. We seem to get a failure because the NamingFactoryServlet returns a URL which contains an IP which is inaccessible to the client. The client knows the NAT address of the server. Is there anyway for the client to "override" the URL passed back by the NamingFactoryServlet? I have a very similar problem if the hostname of the machine running the JBoss server is not in DNS, which I worked around by setting the jboss.bind.address system property. Not an ideal solution but it works. In this case, the jboss.bind.address system property does not help as the server does not know it accessible via NAT. Any ideas? Does Jboss have support for using JNDI though a NAT? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3907116#3907116 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3907116 ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user