JBoss7_en - terasolunaorg/terasoluna-gfw GitHub Wiki

Important points while using JBoss EAP 7

Version information of verification environment
terasoluan-gfw OS Java JBoss RDBMS Browser Mail Server Message Queue
5.5.1.RELEASE CentOS 7.4 OpenJDK 8u161 JBoss EAP 7.2.0 PostgreSQL 10.2 Firefox ESR 60 (60.3.0) Postfix 3.2.2 + Dovecot 2.3.1 ActiveMQ 5.15.3

Introduction

When TERASOLUNA Server Framework for Java (5.x) is used in JBoss EAP(JBoss Enterprise Application Platform)7 environment, the following settings are required.

  • Creation and setting of jboss-deployment-structure.xml
  • Setting of default encoding of servlet container

Creation and setting of jboss-deployment-structure.xml

When JBoss's server module conflicts with the library used in TERASOLUNA Server Framework for Java (5.x), the module on JBoss side will take precedence, so it may not work properly.
Therefore, it is necessary to create jboss-deployment-structure.xml and exclude the module on JBoss side(partial reference).
Place jboss-deployment-structure.xmlunder WEB-INF.

WEB-INF/jboss-deployment-structure.xml

<jboss-deployment-structure>
    <deployment>
        <exclusions>
            <module name="org.hibernate.validator" /><!-- (1) -->
            <module name="org.slf4j" /><!-- (2) -->
            <module name="javax.inject.api" /><!-- (3) -->
            <module name="org.jboss.logging" /><!-- (4) -->
            <module name="javax.validation.api" /><!-- (5) -->
        </exclusions>
        <dependencies>
            <module name="javax.jms.api" /><!-- (6) -->
        </dependencies>
        <exclude-subsystems>
            <subsystem name="jaxrs" /><!-- (7) -->
            <subsystem name="jpa" /><!-- (8) -->
        </exclude-subsystems>
    </deployment>
</jboss-deployment-structure>
.. tabularcolumns:: |p{0.10\linewidth}|p{0.80\linewidth}|
Sr. No. Explanation
(1)
Since Hibernate Validator does not work properly, exclude Hibernate Validator module.
(2)
Since application log is not output properly, exclude SLF4J module.
(3)
Since javax.inject.api version conflicts and an error occurs, exclude javax.inject.api module.(In 5.3.0.RELEASE, error does not occur even if it is not excluded)
(4)
Since JBoss Logging version conflicts and an error occurs, exclude JBoss Logging module.(In 5.3.0.RELEASE, error does not occur even if it is not excluded)
(5)
Since javax.validation.api version conflicts and an error occurs, excludejavax.validation.api module.(In 5.3.0.RELEASE, error does not occur even if it is not excluded, however, this setting is recommended when using Bean Validation for input check)
(6)
Since API class of JMS is required in class path, refer javax.jms.api module.(This setting is required when using JMS) [1]
(7)
Since Jackson version conflicts and an error occurs, exclude JAX-RS subsystem from operation.(This setting is required when using Jackson)
(8)
Since javax.persistence.api/Javassist version conflicts and an error occurs, exclude JPA subsystem from operation.(In 5.3.0.RELEASE, error does not occur even if it is not excluded, however, this setting is recommended when using JPA as O/R Mapper)
[1]
When specific class of Apache ActiveMQ is used in the application, the added ActiveMQ module should be referred by the method same as "javax.jms.api" module for using the mechanism of resource adapter of JBoss (Refer Resource Adaptersfor the mechanism of resource adapter of JBoss).
There is a method to include jar file of ActiveMQ in war file however, operation verification is not performed by this method.

Setting of default encoding of servlet container

In JBoss, if file upload function of Servlet 3.0 is used, the multibyte characters in file name may appear garbled.
In order to avoid this, encoding setting should be done.
Create jboss-web.xml under WEB-INF and specify character codes.

WEB-INF/jboss-web.xml

  • Setting example
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web xsi:schemaLocation="http://www.jboss.org/j2ee/schema/jboss-web_10_0.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://www.jboss.com/xml/ns/javaee" version="10.0">
    <default-encoding>UTF-8</default-encoding>
</jboss-web>

"UTF-8" is applied in the above example.

⚠️ **GitHub.com Fallback** ⚠️