0

I am getting a warning when starting my v17.0.0.4 Liberty server for a shared library and war not having the same class loading specifications:

[WARNING ] CWWKL0008W: Application [myRESTServices#myRESTServices-1.0.0-SNAPSHOT.war] is incompatible with the common class loader for library [myJARS] because they have inconsistent API visibility configurations. Library [myJARS] is configured with [[spec, ibm-api, api, stable]] and application [myRESTServices#myRESTServices-1.0.0-SNAPSHOT.war] is configured with [[spec, ibm-api, api, third-party]].

However, the server.xml defines both with the same set:

<library apiTypeVisibility="spec,ibm-api,api,third-party" description="My Shared Libraries from the myJARS directory" id="myJARS" name="myJARS">
   <fileset dir="/csnext/myJARS" id="myJARS" includes="*.jar" scanInterval="30s"/>
</library>

<!-- Automatically expand WAR files and EAR files -->
<applicationManager autoExpand="true"/>

<webApplication id="myRESTServices" location="myRESTServices-1.0.0-SNAPSHOT.war" name="myRESTServices">
    <classloader apiTypeVisibility="spec,ibm-api,api,third-party">
        <commonLibrary id="myJARS" name="myJARS" >
            <fileset id="myJARS" dir="/csnext/myJARS" includes="*.jar"></fileset>
        </commonLibrary>
    </classloader>
</webApplication>
wnm3
  • 381
  • 3
  • 17

1 Answers1

0

Your application is not using the library that is defined with apiTypeVisibility, it is using a separate copy of the library definition. I think you want this for the application configuration:

<webApplication id="myRESTServices" location="myRESTServices-1.0.0-SNAPSHOT.war" name="myRESTServices">
    <classloader apiTypeVisibility="spec,ibm-api,api,third-party" commonLibraryRef="myJARS"/>
</webApplication>
Alasdair
  • 3,071
  • 15
  • 20
  • Thanks -- worked perfectly, no more warnings. I'd thought since the apiTypeVisibilities were the same, there wouldn't be any problem. Your way is more concise and clear so I'll use that moving forward. – wnm3 Jan 24 '18 at 15:24