Platform Framework
R24 AMR | Min(s) read

Appendix

This section provides you the additional information, such as configuration and issues pertaining to JBoss.

Known Issues with JBoss

There are known issues when you run -XX:+TieredCompilation with JBoss and these are default issues when you use Java 8. The system exhibits slow performance after a period of time. For more information, see the following:

Thread Pooling and Timeout Configuration

The standalone configuration file defines the global EJB and MDB thread pool under the following section:

<subsystem xmlns="urn:jboss:domain:ejb3:1.5">
            <session-bean>
                <stateless>
                    <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
                </stateless>
                <stateful default-access-timeout="5000" cache-ref="simple"/>
                <singleton default-access-timeout="5000"/>
            </session-bean>
            <mdb>
                <resource-adapter-ref resource-adapter-name="${ejb.resource-adapter-name:hornetq-ra}"/>
                <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
            </mdb>
            <pools>
    <bean-instance-pools>
                    <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                    <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                    <strict-max-pool name="ofs-mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                    <strict-max-pool name="browser-mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                    <strict-max-pool name="arcmob-mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                    <strict-max-pool name="tws-mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                    <strict-max-pool name="tcib-mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                    <strict-max-pool name="tcibcorp-mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                    <strict-max-pool name="tcibwealth-mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                    <strict-max-pool name="callat-mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                    <strict-max-pool name="aml-mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                    <strict-max-pool name="seat-mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                    <strict-max-pool name="phantom-mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                </bean-instance-pools>
            </pools>

You can see that there is a global pool and timeout definition for EJBs (slsb-strict-max-pool) and for MDBs (mdb-strict-max-pool).

To define a custom pool configuration, add the above mentioned <bean-instance-pools> in your custom pool definition. You can refer the %TAFJ_HOME%\appserver\jboss\jboss7\standalone-full.xml file, which provides custom pool examples for MDB and EJB.

<strict-max-pool name="customPoolToBeUsedInEJBDeploymentDescriptorOrAnnotation" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="SECONDS"/>

You will have to bind this pool to your EJBs or MDBs by adding a binding to your deployment descriptor. That is, for an EJB, edit TAFJJEE_EAR/TAJEE_T24.jar/META-INF/jboss-ejb3.xml and add the following:

<assembly-descriptor>  
        <p:pool>  
            <ejb-name>OFSProcessingBean </ejb-name>  
<p:bean-instance-pool-ref> customPoolToBeUsedInEJBDeploymentDescriptorOrAnnotation </p:bean-instance-pool-ref>  
        </p:pool>  
    </assembly-descriptor>  

This setting will apply the custom pool to the OFSProcessingBean EJB. You can also add other binding if you want to setup specific pooling for other EJBs.

You can apply a binding to all your EJBs by setting the parameter below.

<ejb-name>*</ejb-name>

For a MDB, edit TAFJJEE_EAR/TAJEE_MDB.jar/META-INF/jboss-ejb3.xml and add same kind of binding. Please note these mappings require the name space xmlns:p="urn:ejb-pool:1.0".

Few examples are provided in the TAFJEE_EAR file (in both TAFJJEE_EJB.jar and TAFJJEE_MDB.jar). You need to uncomment the related <assembly-descriptor> section inorder to use them.

Setting up Multiple Instances of JBoss on the Same Machine

You can have multiple JBoss instance running on same machine by applying a different port offset for each instance, this does not allow any port conflict.

Add the following parameter with your port offset value when starting JBoss.

-Djboss.socket.binding.port-offset=1009

Please refer to the Environment Settings section if you want to add this parameter to your JBoss startup configuration file.

HTTP Response Headers

The standalone configuration file should be defined with response headers that are used to enhance security posture of web application under the subsystem undertow as follows:

 <subsystem xmlns="urn:jboss:domain:undertow:4.0">
            <buffer-cache name="default"/>
            <server name="default-server">
                <http-listener name="default" socket-binding="http" max-parameters="10000" redirect-socket="https" enable-http2="true"/>
                <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
                <host name="default-host" alias="localhost">
                    <location name="/" handler="welcome-content"/>
                    <filter-ref name="server-header"/>
                    <filter-ref name="x-powered-by-header"/>
                    <filter-ref name="x-frame-options"/>
                    <filter-ref name="x-xss-protection"/>
                    <filter-ref name="cache-control"/>
                    <filter-ref name="x-content-type-options"/>
                    <filter-ref name="strict-transport-security"/>
                    <filter-ref name="content-security-policy"/>
                    <filter-ref name="x-permitted-cross-domain-policies"/>
                    <http-invoker security-realm="ApplicationRealm"/>
                </host>
            </server>
            <servlet-container name="default">
                <jsp-config/>
                <websockets/>
            </servlet-container>
            <handlers>
                <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
            </handlers>
            <filters>
                <response-header name="server-header" header-name="Server" header-value="JBoss-EAP/7"/>
                <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
                <response-header name="x-frame-options" header-name="X-Frame-Options" header-value="deny"/>
                <response-header name="x-xss-protection" header-name="X-XSS-Protection" header-value="1; mode=block"/>
                <response-header name="cache-control" header-name="Cache-Control" header-value="no-cache,no-store,max-age=0,must-revalidate"/>
                <response-header name="x-content-type-options" header-name="X-Content-Type-Options" header-value="nosniff"/>
                <response-header name="strict-transport-security" header-name="Strict-Transport-Security" header-value="max-age=31536000; includeSubDomains"/>
                <response-header name="content-security-policy" header-name="Content-Security-Policy" header-value="script-src 'self'"/>
                <response-header name="x-permitted-cross-domain-policies" header-name="X-Permitted-Cross-Domain-Policies" header-value="none"/>
            </filters>
        </subsystem>

Copyright © 2020- Temenos Headquarters SA

Published on :
Monday, May 27, 2024 5:10:34 PM IST