p91paul
p91paul

Reputation: 1142

JBoss EAP 7: Disable tag pooling outside standalone.xml

I'm migrating a legacy application from Weblogic to JBoss EAP 7. The application contains custom tags which were not created with tag pooling in mind (e.g. they have internal state not properly cleaned up in doEndTag).

According to RedHat docs https://access.redhat.com/solutions/1186363, in EAP 6 there was a parameter to be set in web.xml:

<servlet>
  ...
  <init-param>
     <param-name>enablePooling</param-name>
     <param-value>false</param-value>
  </init-param>
  ...
</servlet>

Unfortunately, looks like in EAP 7 this is only doable by configuring the undertow subsystem.

<subsystem xmlns="urn:jboss:domain:undertow:4.0">
    ...
    <servlet-container name="default">
        <jsp-config tag-pooling="false"/>
        <websockets/>
    </servlet-container>

My problem is my application needs to run on a Docker image that I cannot modify nor request to modify, since it's intended to be shared among different applications which might perfectly work with tag pooling. Hence editing standalone.xml or other server-wide configuration files is not feasible. What I can do:

  1. I provide the war/ear file, so I can modify anything inside it (e.g. web.xml, jboss-web.xml, java code, ...). The EAP 6 solution would be perfect if it worked on EAP 7
  2. I can edit system properties
  3. I can edit environment variables

Is there any way to disable tag-pooling given these constraints?

Upvotes: 1

Views: 815

Answers (1)

Dan Dragut
Dan Dragut

Reputation: 41

You can modify the standandalone.xml only for the application with the problem through its own Dockerfile:

disable.jboss.tag-pooling.cli

embed-server --server-config=${JBOSS_PROFILE}
command-timeout set 60

echo #### Disable JSP tag-pooling
if (outcome == success) of /subsystem=undertow/servlet-container=default/setting=jsp:write-attribute(name=tag-pooling, value=false)
   echo tag-pooling was set to false
end-if

stop-embedded-server
quit

Dockerfile

ENV CLI_ARGS="--timeout=30000 --properties=/tmp/cli.env.properties --echo-command"
RUN echo JBOSS_PROFILE=standalone.xml > /tmp/cli.env.properties

COPY --chown=jboss:jboss "disable.jboss.tag-pooling.cli" "/tmp/"
RUN $JBOSS_HOME/bin/jboss-cli.sh --file=/tmp/disable.jboss.tag-pooling.cli $CLI_ARGS

Upvotes: 0

Related Questions