2 Replies Latest reply: Aug 6, 2011 1:48 PM by Flemming Harms RSS

How do I get HTTP invoker to return an proxy attached to the same port as requested

Flemming Harms Novice

I'm having hard time to get the HttpNamingContextFactory work properly.

 

My server is setup so it only allow communication through port 80 and has an Apache in front of my JBoss 5.1 server. The JBoss Web server is listen on port 8080 and AJP on 8009 and the Apache is setup to forward it's request to the JBoss server

 

I know the link between the Apache and JBoss is working, but when I create the initial context on the client with HttpNamingContextFactory it return an context with an proxy which point to the internal JBoss Web server port and not the public port 80

 

Any ideas how to solve this? Thanks!

 

Hashtable<String, String> env = new Hashtable<String, String>();

 

env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.HttpNamingContextFactory");

env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming");

env.put(Context.PROVIDER_URL, "http://"+host+"/invoker/JNDIFactory");

return new InitialContext(env);

 

return :

 

org.jboss.invocation.http.interfaces.HttpInvokerProxy@71ec068c(externalURL:http://x.x.x.x:8080/invoker/JMXInvokerServlet)

 

snip it from the server.xml

 

<!-- A HTTP/1.1 Connector on port 8080 -->

 

   <Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"

               connectionTimeout="20000" redirectPort="8443" />

<!-- A AJP 1.3 Connector on port 8009 -->

   <Connector protocol="AJP/1.3" port="8009" address="${jboss.bind.address}"

         redirectPort="8443" />