我在为共享库启动v17.0.0.4 Liberty服务器时收到警告,并且没有相同的类加载规范:
[警告] CWWKL0008W:应用程序[myRESTServices#myRESTServices-1.0.0-SNAPSHOT.war]与库[myJARS]的公共类加载器不兼容,因为它们具有不一致的API可见性配置。库[myJARS]配置了[[spec,ibm-api,api,stable]],应用程序[myRESTServices#myRESTServices-1.0.0-SNAPSHOT.war]配置了[[spec,ibm-api,api,third-方]。
但是,server.xml使用相同的集合定义:
<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>
答案 0 :(得分:0)
您的应用程序未使用通过apiTypeVisibility定义的库,它使用库定义的单独副本。我想你想要这个用于应用程序配置:
<webApplication id="myRESTServices" location="myRESTServices-1.0.0-SNAPSHOT.war" name="myRESTServices">
<classloader apiTypeVisibility="spec,ibm-api,api,third-party" commonLibraryRef="myJARS"/>
</webApplication>