使用enterpriseApplication

时间:2016-12-24 05:33:53

标签: java websphere websphere-liberty

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

基于此,我使用的是类加载目录和enterpriseApplication条目,这个配置将在我启动和停止服务器时加载,但我无法弄清楚如何确保热配置的此配置。例如。当我改变耳朵时,我希望服务器能够自动重启和/或重新加载类。

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

我使用了'applicationMonitor'设置,但没有识别我的enterpiseApplication目录并且没有加载。该配置似乎只能识别丢弃。

我尝试使用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>

1 个答案:

答案 0 :(得分:1)

&#34;热部署的最简单方法&#34; Liberty的代码与WebSphere Developer Tools(WDT)eclipse插件一起使用:https://developer.ibm.com/wasdev/downloads/liberty-profile-beta/

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

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

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