Relationship between HttpInvoker and servlet based server invoker ?
patrick1 Sep 22, 2011 6:34 AMHi,
I am using JBossAS 6.1 in order to deploy ejb services. Thoses services are remotely accessed by a swing client using HTTP.
I followed the article http://community.jboss.org/wiki/EJB3OverHTTPHTTPSInJBossAS-5 (even though it is targeted for JBossAS 5.1 it works for version 6.1)
I followed also the article http://community.jboss.org/wiki/EJBJMSAndJNDIOverHTTPViaNATFirewallWithUnifiedInvoker. The unified invoker does not seem to exist anymore on JBoss 6.1 and from what I understand is replaced by the http-invoker.sar component.
I therefore modified the jboss-service.xml file found under $JBOSS_HOME/server/default/deploy/http-invoker.sar/META-INF as follow in order to access my ejb through a firewall public address on the 80 port:
<server>
<!-- The HTTP invoker service configration
-->
<mbean code="org.jboss.invocation.http.server.HttpInvoker"
name="jboss:service=invoker,type=http">
<!-- Use a URL of the form http://<hostname>:8080/invoker/EJBInvokerServlet
where <hostname> is InetAddress.getHostname value on which the server
is running.
-->
<attribute name="InvokerURL">
<!-- To get value, ask the ServiceBindingManager to do a host and string
replacement operation using the HTTP connector port
see JBAS-8540 -->
<value-factory bean="ServiceBindingManager" method="getStringBinding">
<parameter>jboss.web:service=WebServer</parameter>
<parameter>HttpConnector</parameter>
<!--parameter>http://${hostforurl}:${port}/invoker/EJBInvokerServlet</parameter-->
<parameter>http://${jboss.public.address}:80/invoker/EJBInvokerServlet</parameter>
</value-factory>
</attribute>
</mbean>
<!-- Expose the Naming service interface via HTTP -->
<mbean code="org.jboss.invocation.http.server.HttpProxyFactory"
name="jboss:service=invoker,type=http,target=Naming">
<!-- The Naming service we are proxying -->
<attribute name="InvokerName">jboss:service=NamingBeanImpl</attribute>
<!-- Compose the invoker URL from the cluster node address -->
<attribute name="InvokerURL">
<!-- To get value, ask the ServiceBindingManager to do a string
replacement operation using the HTTP connector port -->
<value-factory bean="ServiceBindingManager" method="getStringBinding">
<parameter>jboss.web:service=WebServer</parameter>
<parameter>HttpConnector</parameter>
<!--parameter>http://${hostforurl}:${port}/invoker/JMXInvokerServlet</parameter-->
<parameter>http://${jboss.public.address}:80/invoker/JMXInvokerServlet</parameter>
</value-factory>
</attribute>
<attribute name="ExportedInterface">org.jnp.interfaces.Naming</attribute>
<attribute name="JndiName"></attribute>
<attribute name="ClientInterceptors">
<interceptors>
<interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
<interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
<interceptor>org.jboss.naming.interceptors.ExceptionInterceptor</interceptor>
<interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
</interceptors>
</attribute>
</mbean>
<!-- Expose the Naming service interface via clustered HTTP. This maps
to the ReadOnlyJNDIFactory servlet URL
-->
<mbean code="org.jboss.invocation.http.server.HttpProxyFactory"
name="jboss:service=invoker,type=http,target=Naming,readonly=true">
<attribute name="InvokerName">jboss:service=NamingBeanImpl</attribute>
<attribute name="InvokerURL">
<!-- To get value, ask the ServiceBindingManager to do a string
replacement operation using the HTTP connector port -->
<value-factory bean="ServiceBindingManager" method="getStringBinding">
<parameter>jboss.web:service=WebServer</parameter>
<parameter>HttpConnector</parameter>
<parameter>http://${hostforurl}:${port}/invoker/readonly/JMXInvokerServlet</parameter>
</value-factory>
</attribute>
<attribute name="ExportedInterface">org.jnp.interfaces.Naming</attribute>
<attribute name="JndiName"></attribute>
<attribute name="ClientInterceptors">
<interceptors>
<interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
<interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
<interceptor>org.jboss.naming.interceptors.ExceptionInterceptor</interceptor>
<interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
</interceptors>
</attribute>
</mbean>
</server>
All is working fine. I just don't understand the relationship between the HttpInvoker service configuration and the servlet based server invoker configuration. How do those 2 components communicate with each other ? The JBoss remoting guide only details the ServerInvokerServlet and ServletInvokerServer therefore where does this HttpInvoker fits in the whole picture ?
Thanks for any explanations.
- Patrick
Message was edited by: Patrick Jusseau
-
web.xml 2.4 KB
-
servlet-invoker-service.xml 1.1 KB
-
jboss-service.xml 4.2 KB