Endevor Web Services Java 21 encoding issue
search cancel

Endevor Web Services Java 21 encoding issue

book

Article ID: 434685

calendar_today

Updated On:

Products

Endevor

Issue/Introduction

Endevor Web Services Tomcat output has become unreadable following a new Java 21 installation.

 

Environment

All supported Endevor Releases

Web Services

Cause

For the Java versions 21.0.8, 21.0.9, 21.0.10, IBM changed the logging behavior for the JZOS batch launcher.

Resolution

To resolve Java encoding issue It is recommended to install Java version 21.0.10.1 or higher with the following Endevor PTF:
- LU20505 for 19.0
- LU20504 for 18.1

 

After new java is installed, perform following steps to update Web Services configuration:
1. Update and point JAVA_HOME setting in WSTOMINS to Java 21.
2. Run WSTOMINS to reinstall Endevor web services using the following settings:
- ACTION=INSTALL
- CLEAN_ENDEVOR_TOMCAT_INSTANCE=Y

 

Make sure that JVM version is updated in startup procedure (WSTOMSTC): 
//WSTOMSTC PROC LEPARM=,              
// ARGS='start',                       
// JAVACLS='org.apache.catalina.startup.Bootstrap',
// VERSION='21',   

 

 

Additional Information

For older Java versions: 21.0.8, 21.0.9, 21.0.10 following workaround could be implemented to fix encoding issue:

  1. Comment out logging manager override in the STDENV file:
    • #IJO="$IJO -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"      
    • #IJO="$IJO -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties"
  2. Update $CATALINA_BASE/webapps/EndevorService/WEB-INF/classes/logback.xml. Insert following block after line 9: <charset>IBM-1047</charset>
    • The logback.xml configuration must look as follows:
      <?xml version="1.0" encoding="UTF-8"?>
      <configuration>
          <appender name="COLOR" class="ch.qos.logback.core.ConsoleAppender">
              <encoder>
                  <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS,UTC} &lt;%thread&gt; %highlight(%-5level) %cyan(\(%logger{25}\)) %msg%n</pattern>
              </encoder>
          </appender>
          <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
              <encoder>
                  <charset>IBM-1047</charset>
                  <pattern>%d{HH:mm:ss.SSS,UTC} &lt;%thread&gt; %-5level \(%logger{25}\) %msg%n</pattern>
              </encoder>
          </appender>

          <logger name="com.ca.endevor" level="${endevor.log.level:-INFO}"/>
          <logger name="com.ca.ccs.j2z" level="${endevor.log.level:-WARN}"/>

          <!-- <logger name="com.netflix.discovery" level="TRACE"/> -->

          <root level="INFO">
              <appender-ref ref="${log.format:-STDOUT}" />
          </root>
      </configuration>
  3. Recycle Tomcat

Note:

Change in Step 2 is not permanent and must be repeated after running the WSTOMINS job.

If you are performing the initial installation for Endevor Web Services, Tomcat must be started first to create EndevorService folder:

  • Run WSTOMINS to install the web services.
  • Start WSTOMSTC to deploy the EndevorService.war file and populate the $CATALINA_BASE/webapps/EndevorService directory.
  • Follow steps 2 through 4 from the above.

 

If you are running multiple web applications on the same Tomcat and experiencing same issue with other applications, you may consider making a global version of the logback.xml file for the Tomcat.

  • Create $CATALINA_BASE/conf/logback.xml with the following content:
    • <configuration>
        <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
          <encoder>
            <charset>IBM-1047</charset>
            <pattern>%d{HH:mm:ss.SSS} &lt;%thread&gt; %-5level \(%logger{10}\) %msg%n</pattern>
          </encoder>
        </appender>
        <root>
          <level value="INFO"/>
          <appender-ref ref="STDOUT"/>
        </root>
      </configuration>
  • Add following line to the STDENV file:
    • IJO="$IJO -Dlogback.configurationFile=${CATALINA_BASE}/conf/logback.xml"