java - 使用 enterpriseApplication 简单刷新 LIberty Websphere Sphere 应用程序服务器 16

标签 java websphere websphere-liberty

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

基于此,我使用类加载目录和 enterpriseApplication 条目,此配置将在我启动和停止服务器时加载,但我不知道如何确保此配置用于热部署。例如。当我更换耳朵时,我希望服务器能够自动重新启动和/或重新加载类。

我希望 enterpriseApplication 有一个“扫描”属性。

我使用了“applicationMonitor”设置,但无法识别我的 enterprisepiseApplication 目录,因此无法加载。该配置似乎只能识别 dropins。

我尝试使用 dropins,但它不起作用,因为我使用的是共享库。我无法将所有 jar 放入一个 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 “热部署”代码的最简单方法是使用 WebSphere Developer Tools (WDT) eclipse 插件:https://developer.ibm.com/wasdev/downloads/liberty-profile-beta/

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

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

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

关于java - 使用 enterpriseApplication 简单刷新 LIberty Websphere Sphere 应用程序服务器 16,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41310638/

相关文章:

java - 当前 URL/web/guest/HTML 生成异常 : null in Liferay 6. 0.6

java - 获取方法输出参数参数

在 IBM MobileFirst Adapter 中使用内部 CA 时 WebSphere Application Server 中的 SSL 错误

java - 无法将元素添加到 JList

java - 获取 xs :timestamp instead of xs:date when client application calls our jax-ws api

web-services - 用于 jax-ws 2 web 服务部署的 websphere 与 tomcat

websphere-liberty - 使用 configDropins 覆盖应用程序绑定(bind)安全角色

http - WebSphere Liberty 中 SOAP 客户端代理的基本身份验证

java - websphere liberty - 应用程序特定的日志记录配置

java - 我无法访问对象属性