1

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?

James R. Perkins
  • 16,800
  • 44
  • 60
p91paul
  • 1,104
  • 10
  • 26
  • I think changing the configuration is the only way. The attribute does allow for expressions so you could do something like `` then you can override it with a system property. – James R. Perkins Jun 01 '21 at 19:41

1 Answers1

0

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
Dan Dragut
  • 41
  • 1
  • 5
  • 1
    Sorry, this doesn't fit the question constraints. I cannot edit the Docker image. Thanks for trying, but I think what I requested is just plain impossible. – p91paul Feb 11 '22 at 22:51
  • @p91paul The code is not for the Docker base image, it's for your own app image on top of the base (parent) image. – Dan Dragut Feb 13 '22 at 17:05
  • I don't make the app image. I just provide the war/ear file and possibly environment variables. The Dockerfile is made by others that manage the devops pipeline. – p91paul Feb 14 '22 at 19:22