Professional Documents
Culture Documents
JBoss Microkernel
Port 4444 RMI Service Service EIS
EIS
Port 3528 IIOP Service Service EIS
Ref : %JBoss_home%\server\default\conf\jboss-service.xml
© JBoss, Inc. 2003-2005 4
Professional Open Source™
Tomcat Connectors
Ref : %Jboss_home%\server\default\deploy\jbossweb-tomcat50.sar\server.xml
© JBoss, Inc. 2003-2005 6
Web Tier Connectors
Professional Open Source™
Notice a version change starting from JBoss 4.0.2 which embeds Tomcat
5.5 – the package name is ”jbossweb-tomcat55.sar”, accordingly.
jbossweb-tomcat50.sar/server.xml
Naming Service
J2EE Phone Directory
Naming Service
– Java Naming and Directory Interface (JNDI)
– Primary lookup point for J2EE applications
• ”All applications start from naming.” – location transparency
– Redundancy required for high availability
• Provided by JBoss Clustering framework (more on this later).
Remote calls
lookup
Naming Service Other Services
proxy
JBoss Microkernel
java.naming.factory.initial =
org.jnp.interfaces.NamingContextFactory
java.naming.provider.url = jnp://localhost:1099
java.naming.factory.url.pkgs = org.jboss.naming
This applies to ”stand-alone” clients. Web clients connect through HTTP port,
and generally don’t use naming services remotely from the client.
conf/jboss-service.xml
<mbean code = "org.jboss.naming.NamingService“ name =
"jboss:service=Naming"
xmbean-dd = "resource:xmdesc/NamingService-xmbean.xml">
<!-- The call by value mode. true if all lookups are unmarshalled using
the caller's TCL, false if in
VM lookups return the value by reference. -->
<attribute name="CallByValue">false</attribute>
<!-- The listening port for the bootstrap JNP service. Set this to -1 to
run the NamingService without
the JNP invoker listening port. -->
<attribute name="Port">1099</attribute>
<!-- The bootstrap JNP server bind address. This also sets the default
RMI service bind address.
Empty == all addresses -->
<attribute name="BindAddress">${jboss.bind.address}</attribute>
<!-- The port of the RMI naming service, 0 == anonymous -->
<attribute name="RmiPort">1098</attribute>
<!-- The RMI service bind address. Empty == all addresses -->
<attribute
name="RmiBindAddress">${jboss.bind.address}</attribute>
...
</mbean>
Configuration options:
– Attribute ”Port” (1099):
• Initial access point to naming services
• Can be disabled if:
1. Only have HTTP clients (no remote naming access)
2. All remote naming access is tunneled through HTTP (port 8080)
3. Running replicated naming services (TCP 1100 is used instead)
– Attribute ”BindAddress”:
• The NIC to bind the listening port to (IP address)
• Notice the use of system property jboss.bind.address
– Attributes ”RmiPort” and ”RmiBindAddress”
• The Java Remote Method Invocation access points to naming
service, and the NIC binding address
Download RMI
Stub JNP (TCP – Default naming access through two
1099)
Naming Service
ports: JNP Bootstrap and RMI
RMI (TCP protocol
Execute Naming 1098)
operations
HTTP
Communication HTTP (TCP
8080)
Servlet Container
HTTP
Invoker
– Default distribution contains a servlet Servlet
that can accept and route remote
calls to services deployed on the Naming Service
microkernel.
prop.put(Context.INITIAL_CONTEXT_FACTORY,
“org.jboss.naming.HttpNamingContextFactory”);
prop.put(Context.PROVIDER_URL,
“http://localhost:8080/invoker/JNDIFactory”);
jndi.properties
java.naming.factory.initial =
org.jboss.naming.HttpNamingContextFactory
java.naming.provider.url =
http://localhost:8080/invoker/JNDIFactory
java.naming.factory.url.pkgs = org.jboss.naming
– Encrypting the wire protocol is as easy as switching to HTTPS URL and
HTTPS port
• We will see how to enable HTTPS access in the security section
Note that if all your clients are web clients (web browser access web
applications), remote access to naming service is usually not necessary
(sans applets that may try to connect back to the application server)
<servlet-name>JNDIFactory</servlet-name>
<description>A servlet that exposes the JBoss
JNDI Naming service stub
through http. The return content is a serialized
MarshalledValue
containing the org.jnp.interfaces.Naming stub.
This configuration handles
requests for the standard JNDI naming service.
</description>
...
<servlet-mapping>
<servlet-name>JNDIFactory</servlet-name>
<url-pattern>/JNDIFactory/*</url-pattern>
</servlet-mapping>
http://localhost:8080/invoker/JNDIFactory
EJB Invokers
Socket (TCP
– EJB communication can also be tunneled 4445)
Pooled Invoker
through HTTP
• Same HTTP Invoker web application
• URL:
http://<host>:8080/invoker/EJBInvokerServlet
– Embedded inside EJB HTTP proxies
conf/jboss-service.xml
<!--
==================================================
================== -->
<!-- Invokers to the JMX node
<!--
==================================================
================== -->
Configuration options:
– RMIObjectPort
• The TCP port clients connecting directly to EJB tier will attempt open
a socket by default
– ServerAddress
• Bind address for multi-homed (multiple NICs) machine
If all clients connect via web tier (servlets and JSPs) then this
invoker is not necessary – can be removed or the port blocked.
conf/jboss-service.xml
<!--
====================================================
================ -->
<!-- Invokers to the JMX node
<!--
====================================================
================ -->
<mbean code="org.jboss.invocation.pooled.server.PooledInvoker“
name="jboss:service=invoker,type=pooled">
<attribute name="NumAcceptThreads">1</attribute>
<attribute name="MaxPoolSize">300</attribute>
<attribute name="ClientMaxPoolSize">300</attribute>
<attribute name="SocketTimeout">60000</attribute>
<attribute
name="ServerBindAddress">${jboss.bind.address}</attribute>
<attribute name="ServerBindPort">4445</attribute>
<attribute
name="ClientConnectAddress">${jboss.bind.address}</attribute>
© JBoss, Inc. 2003-2005 27
Professional Open Source™
In some older JBoss 3.0.x and 3.2.x releases you may find additional
invocation layers for messaging – RMI, UIL(1), OIL layers. These have
been deprecated in favor of UIL2, which is the recommended production
grade implementation.
deploy/jms/uil2-service.xml
<mbean code="org.jboss.mq.il.uil2.UILServerILService"
name="jboss.mq:service=InvocationLayer,type=UIL2">
<depends optional-attribute-
name="Invoker">jboss.mq:service=Invoker</depends>
<!-- JNDI binding -->
<attribute
name="ConnectionFactoryJNDIRef">ConnectionFactory</attribute>
<attribute
name="XAConnectionFactoryJNDIRef">XAConnectionFactory</attribute>
<!-- The bind address -->
<attribute name="BindAddress">${jboss.bind.address}</attribute>
<!-- The bind port -->
<attribute name="ServerBindPort">8093</attribute>
<attribute name="PingPeriod">60000</attribute>
<attribute name="EnableTcpNoDelay">true</attribute>
<!-- Used to disconnect the client if there is no activity. Ensure this is
greater than the ping period -->
<attribute name="ReadTimeout">120000</attribute>
<attribute name="BufferSize">2048</attribute>
<!-- Large messages may block the ping/pong. A pong is simulated after
each chunk (in bytes) for both
reading and writing. It must be larger than the buffer size -->
<attribute name="ChunkSize">1000000</attribute>
© JBoss, Inc. 2003-2005 31
Messaging Connectivity
Professional Open Source™
deploy/jms/uil2-service.xml
<mbean
code="org.jboss.mq.il.uil2.UILServerILServic
e"
name="jboss.mq:service=InvocationLayer,ty
pe=UIL2">
<!-- JNDI binding -->
<attribute name =
"ConnectionFactoryJNDIRef">UILConnection
deploy/jms/jbossmq-il.sar/META-INF/jboss-
Factory</attribute> service.xml
<server>
…
<mbean
</mbean>
code="org.jboss.mq.il.http.HTTPServerILService"
name="jboss.mq:service=InvocationLayer,type=HTTP"
>
<attribute
name="ConnectionFactoryJNDIRef">ConnectionFactory
</attribute>
</server>
© JBoss, Inc. 2003-2005 33
Ports Conclusion
Professional Open Source™
Defaults:
Clustering: