Slimming JBoss EAP 4.3

Solution Verified - Updated

Environment

  • JBossEnterprise Application Platform (EAP)
    • 4.3

Issue

  • How do I slim JBoss EAP 4.3?

Resolution

The following is a walkthrough of removing various services in JBoss, you may remove some or all of them.

  • If you do not want your JBoss instances form a cluster, please refer to How do I disable clustering in JBoss EAP 4.x's "production" configuration?

  • Remove Web Services, if not in use. Approximate heap savings: 8% (3513 kbytes)

    • Remove <JBOSS_HOME>/server/<profile>/deploy/jbossws.sar
    • Remove <JBOSS_HOME>/server/<profile>/deploy/juddi-service.sar
  • Remove Quartz, if not in Use. Approximate heap savings: 2% (734 kbytes)

    • Remove <JBOSS_HOME>/server/<profile>/deploy/quartz-ra.rar
    • (optional) Remove <JBOSS_HOME>/server/<profile>/lib/quartz-all.jar
  • Remove JBoss Messaging, if not in Use. 

    • Remove <JBOSS_HOME>/server/<profile>/deploy/jboss-messaging.sar

    • Remove the following "XAResourceRecovery.JBMESSAGING1" definition if it exists in <JBOSS_HOME>/server/<profile>/conf/jbossjta-properties.xml

                 <property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.JBMESSAGING1"
                           value="org.jboss.jms.server.recovery.MessagingXAResourceRecovery;java:/DefaultJMSProvider"/>
      
    • (optional) Remove <JBOSS_HOME>/server/<profile>/lib/jboss-messaging-client.jar
  • Remove the EJB 2.1 timer functionality, if not in use.

    • Remove the following mbean blocks in the <JBOSS_HOME>/server/<profile>/deploy/EJBDeployer.xml

          <!-- An EJB Timer Service that is Tx aware -->
          <mbean code="org.jboss.ejb.txtimer.EJBTimerServiceImpl"
            name="jboss.ejb:service=EJBTimerService">
            <attribute name="RetryPolicy">jboss.ejb:service=EJBTimerService,retryPolicy=fixedDelay</attribute>
            <attribute name="PersistencePolicy">jboss.ejb:service=EJBTimerService,persistencePolicy=database</attribute>
            <attribute name="TimerIdGeneratorClassName">org.jboss.ejb.txtimer.BigIntegerTimerIdGenerator</attribute>
            <attribute name="TimedObjectInvokerClassName">org.jboss.ejb.txtimer.TimedObjectInvokerImpl</attribute>
            <depends optional-attribute-name="TransactionManagerFactory" proxy-type="org.jboss.tm.TransactionManagerFactory">
              jboss:service=TransactionManager
            </depends>
          </mbean>
        
          <!-- A retry policy that uses a fixed interval in milli seconds -->
          <mbean code="org.jboss.ejb.txtimer.FixedDelayRetryPolicy" name="jboss.ejb:service=EJBTimerService,retryPolicy=fixedDelay">
            <attribute name="Delay">100</attribute>
          </mbean>
        
          <!-- A persistence policy that does not persist the timers
          <mbean code="org.jboss.ejb.txtimer.NoopPersistencePolicy" name="jboss.ejb:service=EJBTimerService,persistencePolicy=noop"></mbean>
          -->
        
          <!--
            A persistence policy that persists timers to a database.
        
            The 2 supported db persistence plugins are:
              org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin
              org.jboss.ejb.txtimer.OracleDatabasePersistencePlugin
        
            The table name defaults to "TIMERS". It can be overriden using the
            'TimersTable' attribute if the persistence plugin supports it.
            When overriding the timers table, an optional schema can be specified
            using the syntax [schema.]table
          -->
          <mbean code="org.jboss.ejb.txtimer.DatabasePersistencePolicy" name="jboss.ejb:service=EJBTimerService,persistencePolicy=database">
            <!-- DataSourceBinding ObjectName -->
            <depends optional-attribute-name="DataSource">jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
            <!-- The plugin that handles database persistence -->
            <attribute name="DatabasePersistencePlugin">org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin</attribute>
            <!-- The timers table name -->
            <attribute name="TimersTable">TIMERS</attribute>
          </mbean>
      
  • Remove EJB3, if not in Use.

    • Remove <JBOSS_HOME>/server/<profile>/deploy/ejb3.deployer directory.
    • Remove  <JBOSS_HOME>/server/<profile>/deploy/ejb3-entity-cache-service.xml if exists.
    • Remove <JBOSS_HOME>/server/<profile>/deploy/ejb3-interceptors-aop.xml if exists.
  • Remove the HTTPInvoker, which enables tunneling RMI over HTTP, if not in use.

    • Remove <JBOSS_HOME>/server/<profile>/deploy/http-invoker.sar or the httpha-invoker.sar if exists.
  • Remove JBossSX if you don't need the security component

    • Remove the following from <JBOSS_HOME>/server/<profile>/conf/jboss-service.xml

           <mbean code="org.jboss.security.plugins.SecurityConfig"
              name="jboss.security:service=SecurityConfig">
              <attribute name="LoginConfig">jboss.security:service=XMLLoginConfig</attribute>
           </mbean>
           <mbean code="org.jboss.security.auth.login.XMLLoginConfig"
              name="jboss.security:service=XMLLoginConfig">
              <attribute name="ConfigResource">login-config.xml</attribute>
           </mbean> 
        
           <mbean code="org.jboss.security.plugins.JaasSecurityManagerService"
              name="jboss.security:service=JaasSecurityManager">
              <!-- A flag which indicates whether the SecurityAssociation server mode
              is set on service creation. This is true by default since the
              SecurityAssociation should be thread local for multi-threaded server
              operation.
              -->
              <attribute name="ServerMode">true</attribute>
              <attribute name="SecurityManagerClassName">org.jboss.security.plugins.JaasSecurityManager</attribute>
              <attribute name="DefaultUnauthenticatedPrincipal">anonymous</attribute>
              <!-- DefaultCacheTimeout: Specifies the default timed cache policy timeout
              in seconds.
              If you want to disable caching of security credentials, set this to 0 to
              force authentication to occur every time. This has no affect if the
              AuthenticationCacheJndiName has been changed from the default value.
              -->
              <attribute name="DefaultCacheTimeout">1800</attribute>
              <!-- DefaultCacheResolution: Specifies the default timed cache policy
              resolution in seconds. This controls the interval at which the cache
              current timestamp is updated and should be less than the DefaultCacheTimeout
              in order for the timeout to be meaningful. This has no affect if the
              AuthenticationCacheJndiName has been changed from the default value.
              -->
              <attribute name="DefaultCacheResolution">60</attribute>
              <!-- DeepCopySubjectMode: This set the copy mode of subjects done by the
              security managers to be deep copies that makes copies of the subject
              principals and credentials if they are cloneable. It should be set to
              true if subject include mutable content that can be corrupted when
              multiple threads have the same identity and cache flushes/logout clearing
              the subject in one thread results in subject references affecting other
              threads.
              -->
              <attribute name="DeepCopySubjectMode">false</attribute>
           </mbean>
      
  • Remove the following from <JBOSS_HOME>/server/<profile>/deploy/jboss-web.deployer/META-INF

      <!-- The JAAS security domain to use in the absense of an explicit 
      security-domain specification in the war WEB-INF/jboss-web.xml 
      --> 
      <!-- <attribute name="DefaultSecurityDomain">java:/jaas/other</attribute>--> 
      
      <!-- A mapping to the server security manager service which must be 
      operation compatible with type 
      org.jboss.security.plugins.JaasSecurityManagerServiceMBean. This is only 
      needed if web applications are allowed to flush the security manager 
      authentication cache when the web sessions invalidate. 
      --> 
      <!-- <depends optional-attribute-name="SecurityManagerService" 
      proxy-type="attribute">jboss.security:service=JaasSecurityManager 
      </depends>-->
    
  • Remove the BeanShell script deployer:
    remove <JBOSS_HOME>/server/<profile>/deploy/bsh-deployer.xml

  • Remove the JMX SNMP adapter:
    remove <JBOSS_HOME>/server/<profile>/deploy/snmp-adaptor.sar

Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.