The context fragment template and the CATALINA_OPTS in setenv.properties are not properly handled by Tanzu tc Server 10
search cancel

The context fragment template and the CATALINA_OPTS in setenv.properties are not properly handled by Tanzu tc Server 10

book

Article ID: 382473

calendar_today

Updated On:

Products

VMware Tanzu Spring Runtime

Issue/Introduction

The following issues are reported for Tanzu tc Server 10

1. Not handling the CATALINA_OPTS properly when defined in setenv.properties. For example,

setenv.properties

catalina.opts.1=-server
catalina.opts.2=-Xmx1024M
catalina.opts.3=-Xms512M
catalina.opts.4=-Xss1M
catalina.opts.5=-verbose:gc -Xlog:gc*:/var/mware/logs/${tcs.instancename}/gc-$(date +%Y-%m-%d-%H).log:time,uptime,pid,tid,level,tags:filecount=10,filesize=10m 
catalina.opts.6=-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/mware/logs/${tcs.instancename}
catalina.opts.7=-Dlog4j.debug=true

 

However the generated setenv.sh file doesn't match the above template.

CATALINA_OPTS="-Xmx512M -Xss256K -server -Xmx1024M -Xms512M -Xss1M -verbose:gc -Xlog:gc*:/var/mware/logs/testapp1/gc-$(date +%Y-%m-%d-%H).log:time,uptime,pid,tid,level,tags:filecount=10,filesize=10m  -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/mware/logs/testapp1 -Dlog4j.debug=true"

 

2. context.xml is not generated correctly based on the context fragment template. For example,

context fragment in our custom template

<?xml version="1.0"?>
<Context add:privileged="${privileged}"
         add:sessionCookieName="${sessionCookieName}"
         add:sessionCookiePath="${sessionCookiePath}"
         add:swallowOutput="${swallowOutput}"
         add:useHttpOnly="${useHttpOnly}"
         add:xmlValidation="${xmlValidation}">
</Context>

context.xml generated by Tanzu tc Server 10 based on the above template still containing add: for the <WatchedResource> element.

<?xml version="1.0"?>
<Context privileged="${visaSOE.privileged}"
         sessionCookieName="${visaSOE.sessionCookieName}"
         sessionCookiePath="${visaSOE.sessionCookiePath}"
         swallowOutput="${visaSOE.swallowOutput}"
         useHttpOnly="${visaSOE.useHttpOnly}"
         xmlValidation="${visaSOE.xmlValidation}">
    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
            <Manager pathname="" />
            -->
    <!-- Uncomment this to enable Comet connection tacking (provides events
                 on session expiration as well as webapp lifecycle) -->
    <!--
            <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
            -->
    <add:WatchedResource>${catalina.base}/conf/web.xml</add:WatchedResource>
</Context>

Environment

  • Tanzu tc Server 10.1.31.A
  • Tanzu tc Server 10.1.33.A

Cause

The issues are caused by new defects in the aforementioned releases. 

Resolution

The issues are fixed in release Tanzu tc Server 10.1.33.C. User needs to upgrade Tanzu tc Server to at least release10.1.33.C to pick up the fixes. 

Refer to the release note  for more details.