我目前正在使用 Open Liberty 18.0.0.4 及其对 Microprofile 的支持。当我尝试构建包含 mpHealth-1.0 功能的独立可运行 Jar 时,启动失败并显示
[ERROR ] CWWKF0033E: The singleton features com.ibm.websphere.appserver.javax.servlet-3.1 and com.ibm.websphere.appserver.javax.servlet-4.0 cannot be loaded at the same time. The configured features mpHealth-1.0 and jaxrs-2.1 include one or more features that cause the conflict. Your configuration is not supported; update server.xml to remove incompatible features.
[ERROR ] CWWKF0033E: The singleton features com.ibm.websphere.appserver.javax.annotation-1.2 and com.ibm.websphere.appserver.javax.annotation-1.3 cannot be loaded at the same time. The configured features mpHealth-1.0 and jaxrs-2.1 include one or more features that cause the conflict. Your configuration is not supported; update server.xml to remove incompatible features.
[ERROR ] CWWKF0033E: The singleton features com.ibm.websphere.appserver.javaeeCompatible-8.0 and com.ibm.websphere.appserver.javaeeCompatible-7.0 cannot be loaded at the same time. The configured features jsonb-1.0 and mpHealth-1.0 include one or more features that cause the conflict. Your configuration is not supported; update server.xml to remove incompatible features.
[ERROR ] CWWKF0033E: The singleton features com.ibm.websphere.appserver.javax.cdi-2.0 and com.ibm.websphere.appserver.javax.cdi-1.2 cannot be loaded at the same time. The configured features jsonb-1.0 and mpHealth-1.0 include one or more features that cause the conflict. Your configuration is not supported; update server.xml to remove incompatible features.
我正在使用 jaxrs-2.1 和 jsonb-1.0,一切正常。一旦我添加了 mpHealth-1.0 功能,我就会收到上述错误。这是 server.xml 的相关片段:
<featureManager>
<feature>jaxrs-2.1</feature>
<feature>jsonb-1.0</feature>
<feature>mpHealth-1.0</feature>
</featureManager>
这就是started Jar在结束时所说的(但没有服务可用):
[AUDIT ] CWWKF0012I: The server installed the following features: [jsonb-1.0, servlet-4.0, jndi-1.0, mpHealth-1.0, json-1.0, cdi-1.2, jsonp-1.1, jaxrsClient-2.1, jaxrs-2.1].