The Tomcat Service


Tomcat 5, the latest release of the Apache Java servlet container, supports the Servlet 2.4 and JSP 2.0 specifications. Tomcat is distributed as a deployable service in jbossweb-tomcat-5.0.sar in the deploy directory. It is shipped in exploded directory form, so it's easy to inspect and update the configuration of an embedded Tomcat instance.

The main service file is META-INF/jboss-service.xml. It configures the org.jboss.web.tomcat.tc5.Tomcat5 MBean, which controls Tomcat. Its configurable attributes include the following:

  • DefaultSecurityDomain This specifies the JAAS security domain to use in the absence of an explicit security-domain specification in the jboss-web.xml of a WAR file.

  • Java2ClassLoadingCompliance This enables the standard Java 2 parent delegation class-loading model rather than the servlet model, which loads from the WAR first. It is TRue by default because loading from WARs that include client JARs with classes used by EJBs causes class-loading conflicts. If you enable the servlet class-loading model by setting this flag to false, you need to organize your deployment package to avoid having duplicate classes in the deployment.

  • UseJBossWebLoader This flag indicates that Tomcat should use a JBoss unified class loader as the web application class loader. The default is TRue, which means that the classes inside the WEB-INF/classes and WEBINF/lib directories of the WAR file are incorporated into the default shared class loader repository described in Chapter 2, "The JBoss JMX Microkernel." This may not be what you want because it is contrary to the default servlet class-loading model and can result in sharing of classes/resources between web applications. You can disable this by setting this attribute to false.

  • LenientEjbLink This flag indicates that ejb-link errors should be ignored in favor of trying the jndi-name in the jboss-web.xml. The default is TRue.

  • ManagerClass This is the class to use as the session manager for replicating the state of web applications marked as distributable. The only provided implementation session manager is org.jboss.web.tomcat.tc5.session.JBossCacheManager, which uses JBossCache to track the distributed state.

  • SubjectAttributeName If set, this represents the request attribute name under which the JAAS subject will be stored. There is no default value, meaning that the subject is not set in the request.

  • SessionIdAlphabet This is the set of characters used to create a session's ID. It must be made up of exactly 65 unique characters.

  • SnapshotMode This sets the snapshot mode in a clustered environment. It must be either instant or interval. In instant mode, changes to a clustered session are instantly propagated whenever a modification is made. In interval mode, all modifications are periodically propagated according to the SnapshotInterval.

  • SnapshotInterval This sets the snapshot interval, in milliseconds, for the interval snapshot mode. The default is 1000ms, which is 1 second.

  • UseLocalCache This flag indicates whether the local HTTP session value should be used if it exists. When it is true, the existing local HTTP session values are used, and updates are replicated, but updates to the same session on other nodes do not update the local session value. This mode is useful only for failover. When it is false, the session value is obtained from the distributed cache. This mode can be used with load balancing. The default is TRue.

  • UseJK This specifies that you are using MOD_JK(2) for load balancing with sticky session combined with JvmRoute. If set to true, it will insert a JvmRouteFilter to intercept every request and replace the JvmRoute if it detects a failover. This additionally requires the JvmRoute to be set inside the engine definition in the Tomcat server.xml file. The default is false.

  • Domain This is the JMX domain under which Tomcat will register additional MBeans. The default is jboss.web.

  • SecurityManagerService This is a reference to the JAAS security manager for Tomcat to use. It defaults to jboss.security:service=JaasSecurityManager.

  • CacheName This is a reference to the JBossCache to be used for HTTP session replication, if session replication is being used. The default is jboss.cache:service=TomcatClusteringCache.



JBoss 4. 0(c) The Official Guide
JBoss 4.0 - The Official Guide
ISBN: B003D7JU58
EAN: N/A
Year: 2006
Pages: 137

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net