将旧应用程序部署到 Websphere Liberty 时出错

问题描述

我在尝试将一些遗留应用程序部署到 Websphere Liberty 以促进开发时遇到问题。

该应用程序在常规 Websphere Server 8.5.5 中运行良好,但无法在 Websphere Liberty 中启动。我们有另一个基于相同技术/框架的遗留应用程序,它们可以正常运行。不幸的是,我们不会很快迁移到更新的平台。

我为我的服务器配置了以下功能

<featureManager>
        <feature>localConnector-1.0</feature>
        <feature>jpa-2.0</feature>
        <feature>jsf-2.0</feature>
        <feature>jdbc-4.0</feature>
        <feature>servlet-3.0</feature>
        <feature>ejbLite-3.1</feature>
        <feature>cdi-1.0</feature>
    <feature>appSecurity-1.0</feature>
        
    </featureManager>

当我尝试启动它时,在注释处理过程中出现异常:

[VARNING ] CWNEN0047W: Resource annotations on the fields of the xxx.xxx.EditCardGroupbacking class will be ignored. The annotations Could not be obtained because of the exception : java.lang.NoClassDefFoundError: javax.resource.spi.IllegalStateException

这看起来很奇怪,因为这将成为 JRE 的一部分?

我在各种论坛/页面搜索过答案,但找不到答案。希望这里有人可以提供帮助。

如果需要,我很乐意提供有关配置和设置的更多详细信息。

解决方法

javax.resource.spi.IllegalStateException 是 JCA(Java EE 连接器架构)规范的一部分(请参阅 JavaDoc here)。您不会从 Java 自动获取它。尝试启用 jca-1.6 功能,

<feature>jca-1.6</feature>

仅供参考 - 如果其他人使用具有更新级别的 Java EE 功能的人点击这里,他们将需要:

<feature>jca-1.7</feature>