Topic
  • 5 replies
  • Latest Post - ‏2012-11-12T12:15:55Z by knitta
knitta
knitta
5 Posts

Pinned topic Liberty Profile cannot include nested server.xml outside WLP_USER_DIR?

‏2012-10-19T13:01:03Z |
Hi,

I'm trying to split server.xml of liberty profile into some part of xml files in the directory where my settings are stored. Following is the picture on windows machine:

  • C:\bin\wlp is the Liberty profile installed directory
  • Test1 server is created
  • C:\bin\wlp\usr\servers\Test1\server.xml is the master server.xml file
  • C:\myconfig is the directory I want to collect settings into

the master server.xml simply contains following include element.

<server>
<include location="C:\myconfig\myServer.xml" />
</server>


myServer.xml contains following <include> elements for detailed configuration, which includes other files placed in C:\myconfig.

<server>
<include location="security.xml" />
</server>


security.xml includes elements for concrete configurations.

<server>
<ldapRegistry>
......
......
</server>


Although infocenter says included files can nest other included files, Test1 server cannot be launched under these configurations.

message.log says "Unable to resolve include security.xml", so I've tried all possibilities like
  • Absolute path: <include location="C:\myconfig\security.xml" /> (Also tried / instead of backslash)
  • URL format: <include location="file:///C:/myconfig/security.xml" />
but the server still doesn't boot.

Does anyone know how should I write include tag for nested includes? Thanks in advance.
  • knitta
    knitta
    5 Posts

    Re: Liberty Profile cannot include nested server.xml outside WLP_USER_DIR?

    ‏2012-10-25T04:38:50Z  
    I discovered that if the first include element includes a file under WLP_USER_DIR, nested include works well. Following example is no problem.

    $WLP_INSTALL_ROOT/usr/servers/Test1/server.xml:
    <include location="$WLP_INSTALL_ROOT/usr/servers/Test1/myconfig/myServer.xml" />

    $WLP_INSTALL_ROOT/usr/servers/Test1/myconfig/myServer.xml:
    <include location="$WLP_INSTALL_ROOT/usr/servers/Test1/myconfig/security.xml" />

    But as I mentioned, if first include element includes a file outside of WLP_USR_DIR, it doesn't work. Is this a known problem...?
  • SystemAdmin
    SystemAdmin
    590 Posts

    Re: Liberty Profile cannot include nested server.xml outside WLP_USER_DIR?

    ‏2012-10-31T13:14:02Z  
    • knitta
    • ‏2012-10-25T04:38:50Z
    I discovered that if the first include element includes a file under WLP_USER_DIR, nested include works well. Following example is no problem.

    $WLP_INSTALL_ROOT/usr/servers/Test1/server.xml:
    <include location="$WLP_INSTALL_ROOT/usr/servers/Test1/myconfig/myServer.xml" />

    $WLP_INSTALL_ROOT/usr/servers/Test1/myconfig/myServer.xml:
    <include location="$WLP_INSTALL_ROOT/usr/servers/Test1/myconfig/security.xml" />

    But as I mentioned, if first include element includes a file outside of WLP_USR_DIR, it doesn't work. Is this a known problem...?
    Hi,

    Thanks for your posts and extra information. We have not been able to recreate this problem.. on our systems, when the file outside the install/user directories is specified using an absolute path: <include location="C:\myconfig\security.xml" /> it is found and processed, even when it is the first include element in the file. We did have a bug that meant such files were not being correctly monitored for changes but that has been fixed in the latest release driver which can be downloaded from this site (https://www.ibm.com/developerworks/mydeveloperworks/blogs/wasdev/entry/download?lang=en). It may be worth moving up to that driver and retrying. If you still see the problem please let me know as we'll need to investigate further (and will probably need to trace the configuration parsing code at that point).

    Regards, Alex Mulholland.
  • knitta
    knitta
    5 Posts

    Re: Liberty Profile cannot include nested server.xml outside WLP_USER_DIR?

    ‏2012-11-01T11:04:33Z  
    Hi,

    Thanks for your posts and extra information. We have not been able to recreate this problem.. on our systems, when the file outside the install/user directories is specified using an absolute path: <include location="C:\myconfig\security.xml" /> it is found and processed, even when it is the first include element in the file. We did have a bug that meant such files were not being correctly monitored for changes but that has been fixed in the latest release driver which can be downloaded from this site (https://www.ibm.com/developerworks/mydeveloperworks/blogs/wasdev/entry/download?lang=en). It may be worth moving up to that driver and retrying. If you still see the problem please let me know as we'll need to investigate further (and will probably need to trace the configuration parsing code at that point).

    Regards, Alex Mulholland.
    Hi,
    Thanks for your answer and the information of the latest downloads. I previously tried with version 8.5.0.0 (WebSphere Application Server wlp-1.0.0.20120428-1251(websphere-kernel_1.0.0)).

    Just now I also tried with the latest release (WebSphere Application Server wlp-1.0.1.cl0120121004-1949(websphere-kernel_1.0.1), and unfortunately I found I can recreate the same problem. The first include (from usr/servers/Test1/server.xml to C:\myconfig\myServer.xml) works, but the second include element (from C:\myconfig\myServer.xml to C:\myconfig\security.xml) causes the same error and WLP doesn't boot.

    I attached messages.log. Could you tell me if there's any other file I attached to investigate?

    I also attached the whole parts of server.xml files below.

    <!-- (C:\bin\wlp8501\usr\servers\Test1\server.xml) -->
    <server description="new server">

    <!-- Enable features -->
    <featureManager>
    <feature>jsp-2.2</feature>
    </featureManager>

    <httpEndpoint id="defaultHttpEndpoint"
    host="localhost"
    httpPort="9080"
    httpsPort="9443" />

    <include location="C:\myconfig\myServer.xml" />
    </server>

    <!-- (C:\myconfig\myServer.xml) -->
    <server>
    <include location="C:\myconfig\security.xml" />
    </server>

    <!-- (C:\myconfig\security.xml) -->
    <server>

    </server>
  • SystemAdmin
    SystemAdmin
    590 Posts

    Re: Liberty Profile cannot include nested server.xml outside WLP_USER_DIR?

    ‏2012-11-08T01:16:54Z  
    • knitta
    • ‏2012-11-01T11:04:33Z
    Hi,
    Thanks for your answer and the information of the latest downloads. I previously tried with version 8.5.0.0 (WebSphere Application Server wlp-1.0.0.20120428-1251(websphere-kernel_1.0.0)).

    Just now I also tried with the latest release (WebSphere Application Server wlp-1.0.1.cl0120121004-1949(websphere-kernel_1.0.1), and unfortunately I found I can recreate the same problem. The first include (from usr/servers/Test1/server.xml to C:\myconfig\myServer.xml) works, but the second include element (from C:\myconfig\myServer.xml to C:\myconfig\security.xml) causes the same error and WLP doesn't boot.

    I attached messages.log. Could you tell me if there's any other file I attached to investigate?

    I also attached the whole parts of server.xml files below.

    <!-- (C:\bin\wlp8501\usr\servers\Test1\server.xml) -->
    <server description="new server">

    <!-- Enable features -->
    <featureManager>
    <feature>jsp-2.2</feature>
    </featureManager>

    <httpEndpoint id="defaultHttpEndpoint"
    host="localhost"
    httpPort="9080"
    httpsPort="9443" />

    <include location="C:\myconfig\myServer.xml" />
    </server>

    <!-- (C:\myconfig\myServer.xml) -->
    <server>
    <include location="C:\myconfig\security.xml" />
    </server>

    <!-- (C:\myconfig\security.xml) -->
    <server>

    </server>
    Hi,

    I have managed to recreate the problem on the latest code so can debug now.. thanks for reporting this. I haven't been able to identify a workaround at this time other than keepign the nested files within the user dir, as you have already noted.

    Regards, Alex.
  • knitta
    knitta
    5 Posts

    Re: Liberty Profile cannot include nested server.xml outside WLP_USER_DIR?

    ‏2012-11-12T12:15:55Z  
    Hi,

    I have managed to recreate the problem on the latest code so can debug now.. thanks for reporting this. I haven't been able to identify a workaround at this time other than keepign the nested files within the user dir, as you have already noted.

    Regards, Alex.
    Hi,

    thanks for your quick reply. I marked this answered and look forward to future fixpacks.