adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

XML edit modifies when it shouldn't

I have an XML edit which changes the following:

Code: Select all

Server
  Service
    Engine
      Host
        Context > docBase
 
It sets the docBase to [MY_PUBLIC_PROPERTY] (which is set by a Registry Search). I've tried with and without marking the attribute as an identifier.

That works perfectly, however as a side effect the following is modified:

Code: Select all

Server
  Service
    Connector
    Connector
    Connector
The first connector has some attributes removed and others overwritten by the third connector.

From server.xml after the installation:

Code: Select all

        <!-- A "Connector" using the shared thread pool-->
        <Connector executor="tomcatThreadPool" port="8009" protocol="AJP/1.3" connectionTimeout="20000" redirectPort="8443"/>
        <!-- Define a SSL HTTP/1.1 Connector on port 8443
             This connector uses the JSSE configuration, when using APR, the
             connector should be using the OpenSSL style configuration
             described in the APR documentation -->
        <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
                   maxThreads="150" scheme="https" secure="true"
                   keystoreFile="vrm.keystore" keystorePass="********"
                   clientAuth="false" sslProtocol="TLS"/>

        <!-- Define an AJP 1.3 Connector on port 8009 -->
        <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>

From server.xml.back after the installation:

Code: Select all

        <!-- A "Connector" using the shared thread pool-->
        <Connector executor="tomcatThreadPool"
                   port="8080" protocol="HTTP/1.1"
                   connectionTimeout="20000"
                   redirectPort="8443"/>
        <!-- Define a SSL HTTP/1.1 Connector on port 8443
             This connector uses the JSSE configuration, when using APR, the
             connector should be using the OpenSSL style configuration
             described in the APR documentation -->
        <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
                   maxThreads="150" scheme="https" secure="true"
                   keystoreFile="vrm.keystore" keystorePass="********"
                   clientAuth="false" sslProtocol="TLS"/>

        <!-- Define an AJP 1.3 Connector on port 8009 -->
        <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>

I upgraded from 11.7.1 to 12.0 build 63246 in the hopes that this would have been corrected, but no luck. If I remove the XML transform, the file is copied correctly. No other backups are created.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: XML edit modifies when it shouldn't

Hi,

In order to avoid this problem, you need to set the "Is identifier attribute" option for at least one attribute of each "Connector" element. These elements have the same paths and names and those identifiers will make a difference between them.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

Re: XML edit modifies when it shouldn't

I'm not attempting to modify Connectors, so no change should take place with them, with or without identifier attributes. The Context node I'm trying to modify is unique and therefore does not require an identifier attribute either.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: XML edit modifies when it shouldn't

Hi,

Even if you do not try to modify those elements, the "XML Edit" operation will not create them correctly during the upgrade because it will not be able to make a difference between elements with the same names and the same paths.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

Re: XML edit modifies when it shouldn't

I see. That actually makes sense since it doesn't leave untouched elements in-place. Thank you for the clarification!
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: XML edit modifies when it shouldn't

You're welcome. I'm glad I could help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”