简单刷新 LIberty Websphere Sphere Application server 16, with enterpriseApplication

Simple refresh of LIberty Websphere Sphere Application server 16, with enterpriseApplication

我听说我可以使用 dropins 目录来热部署代码。但是假设我想使用 apps 目录和一个预配置的应用程序。例如,我下载了标准的 liberty jar 版本 16。使用 server.config 目录下的 'apps' 目录,我能够将 EAR 添加到该目录。另外,我添加了以下配置 server.xml:

基于此,我正在使用一个 class 加载目录和一个 enterpriseApplication 条目,此配置将在我启动和停止服务器时加载,但我无法弄清楚如何确保此配置用于热部署。例如。当我换耳朵的时候,我希望服务器会自动重启 and/or 重新加载 classes.

我希望 enterpriseApplication 有一个 'scan' 属性。

我使用了 'applicationMonitor' 设置但无法识别我的 enterpiseApplication 目录并且没有加载。该配置似乎只识别 dropins。

我尝试使用 dropins 但它不起作用,因为我使用的是共享库。我不能把所有的罐子都放在一个 EAR 中。

   <library id="Alexandria">
                <fileset dir="/usr/local/pfs/dist/wlp/usr/servers/rest/mylib/Alexandria" includes="*.jar" scanInterval="20s" />
        </library>

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

    <enterpriseApplication location="napolEA.ear" name="MyApp">
                <classloader privateLibraryRef="Alexandria" />
    </enterpriseApplication>

使用 Liberty 编写 "hot deploying" 代码的最简单方法是使用 WebSphere Developer Tools (WDT) eclipse 插件:https://developer.ibm.com/wasdev/downloads/liberty-profile-beta/

关于您的应用程序的 "scan" 属性:任何 <application><webApplication><enterpriseApplication> 扫描都由 <applicationMonitor> 元素控制。默认情况下,它的配置是:

<applicationMonitor updateTrigger="polled" pollingRate="500ms"/>

因此,配置应每 500 毫秒扫描一次应用更新。