【发布时间】:2016-04-04 22:30:06
【问题描述】:
我继承了一个遗留的 EJB 应用程序,该应用程序构建为带有会话 bean 和 JPA 的 EJB 3.0。我正在从应用程序正常工作的 WebSphere 8.0 迁移。我已经在 WebSphere 8.5.5 经典版上进行了测试,没有任何问题,但是,出于战略原因,我们决定使用 WebSphere Liberty。我在应用程序服务器上部署了两个 ear 文件,一个是前端 EAR 应用程序,一个是 EJB (JPA) 应用程序。两个应用程序都在同一个 JVM 中运行。我已经部署了两者,Liberty 将启动,但是,我经常(我知道我可以选择弹出窗口来保存我的选择)看到弹出窗口说我的“应用程序 XXXX 需要功能:ejb-3.1 lite。但是,我想使用 ejb3.2-lite。在 Eclipse 的项目方面(Eclipse Juno w/ WDT)我不能选择 EJB 3.2,因为该选项不存在。我可以去的最高级别是 3.1,这是目前的级别.这是我的server.xml文件的sn-p:
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>javaee-7.0</feature>
<feature>localConnector-1.0</feature>
<feature>distributedMap-1.0</feature>
<feature>adminCenter-1.0</feature>
<feature>ssl-1.0</feature>
<feature>usr:webCacheMonitor-1.0</feature>
<feature>webCache-1.0</feature>
<feature>ldapRegistry-3.0</feature>
<feature>ejbRemote-3.2</feature>
</featureManager>
<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
<httpEndpoint host="*" httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>
<!-- Automatically expand WAR files and EAR files -->
<applicationManager autoExpand="true"/>
<applicationMonitor updateTrigger="mbean"/>
<enterpriseApplication id="CHServiceEAR" location="CHServiceEAR.ear" name="CHServiceEAR"/>
<enterpriseApplication id="CHNewCHRDMEAR" location="CHNewCHRDMEAR.ear" name="CHNewCHRDMEAR">
<application-bnd>
<security-role name="AllAuthenticated">
<special-subject type="ALL_AUTHENTICATED_USERS" />
</security-role>
</application-bnd>
</enterpriseApplication>
在 Ear 文件 java 项目中,我选择了 EJB 3.1,但这只是因为我没有看到选择 3.2 作为 EJB 规范的方法。由于您可以在上面看到我正在使用完整的 java7EE 配置文件,因此我会自动获取 ejblite-3.2 但似乎我的应用程序出于某种原因不会利用它。请指教!
【问题讨论】:
-
这可能是由于 eclipse 中的项目 facet 被配置为 3.1 造成的。如果您右键单击项目并选择 Project Facets,则应该有一个 ejb facet,如果版本显示 3.1,则将其更改为 3.2,它应该可以按照您想要的方式工作。
-
是的,我应该提到(我将在原始帖子中添加更新)我将项目方面从 3.0 更新到 3.1,但我无法更新到 3.2,因为选择不存在.我还应该提到,在我的 JPA 项目中,我无法从 JPA 2.0 更新到 2.1,因为那里也不存在选择。有什么想法吗?
标签: jakarta-ee migration websphere websphere-liberty