gpt4 book ai didi

java - : Entity Beans are no longer supported

转载 作者:行者123 更新时间:2023-12-02 12:48:15 40 4
gpt4 key购买 nike

我使用的是 Wildfly 10.0.x。我正在将 ejb2.1 迁移到 ejb3.2这是我的 ejb-jar.xml 文件

<?xml version="1.0"?>
<ejb-jar version="3.2" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd">
<description>www.cedar.com - Collaborative Planning</description>
<display-name>CP - J2EE</display-name>
<enterprise-beans>

<!-- BudgetCycleEditorSession -->
<session>
<description>no description</description>
<display-name>BudgetCycleEditorSessionSEJB</display-name>
<ejb-name>BudgetCycleEditorSessionSEJB</ejb-name>
<!--//<startUserCode BudgetCycleEditorSession-ws-endpoint-->
<!--//<endUserCode BudgetCycleEditorSession-ws-endpoint-->
<home>com.cedar.cp.ejb.api.model.BudgetCycleEditorSessionHome</home>
<remote>com.cedar.cp.ejb.api.model.BudgetCycleEditorSessionRemote</remote>
<local-home>com.cedar.cp.ejb.api.model.BudgetCycleEditorSessionLocalHome</local-home>
<local>com.cedar.cp.ejb.api.model.BudgetCycleEditorSessionLocal</local>
<ejb-class>com.cedar.cp.ejb.impl.model.BudgetCycleEditorSessionSEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>

<ejb-local-ref>
<ejb-ref-name>ejb/ModelLocalHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.cedar.cp.ejb.impl.model.ModelLocalHome</local-home>
<local>com.cedar.cp.ejb.impl.model.ModelLocal</local>
<ejb-link>ModelEEJB</ejb-link>
</ejb-local-ref>

<ejb-local-ref>
<ejb-ref-name>ejb/DimensionLocalHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.cedar.cp.ejb.impl.dimension.DimensionLocalHome</local-home>
<local>com.cedar.cp.ejb.impl.dimension.DimensionLocal</local>
<ejb-link>DimensionEEJB</ejb-link>
</ejb-local-ref>

<resource-ref>
<res-ref-name>jdbc/fc</res-ref-name><res-type>javax.sql.DataSource</res-type><res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<res-ref-name>jdbc/oa</res-ref-name><res-type>javax.sql.DataSource</res-type><res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<res-ref-name>jdbc/ad</res-ref-name><res-type>javax.sql.DataSource</res-type><res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<res-ref-name>jdbc/db2</res-ref-name><res-type>javax.sql.DataSource</res-type><res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<res-ref-name>jms/cp/TopicConnectionFactory</res-ref-name>
<res-type>javax.jms.TopicConnectionFactory</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref>
<res-ref-name>jms/cp/entityEventTopic</res-ref-name>
<res-type>javax.jms.Topic</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</session>

<entity>
<description>MODEL table entity bean</description>
<display-name>ModelEEJB</display-name>
<ejb-name>ModelEEJB</ejb-name>
<local-home>com.cedar.cp.ejb.impl.model.ModelLocalHome</local-home>
<local>com.cedar.cp.ejb.impl.model.ModelLocal</local>
<ejb-class>com.cedar.cp.ejb.impl.model.ModelEEJB</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>com.cedar.cp.dto.model.ModelPK</prim-key-class>
<reentrant>false</reentrant>
<resource-ref>
<res-ref-name>jdbc/fc</res-ref-name><res-type>javax.sql.DataSource</res-type><res-auth>Container</res-auth>
</resource-ref>
</entity>

</enterprise-beans>

<assembly-descriptor>
<method-permission>
<unchecked/>
<method>
<ejb-name>ModelEEJB</ejb-name>
<method-name>*</method-name>
</method>
</method-permission>
<container-transaction>
<method><ejb-name>ModelEEJB</ejb-name><method-name>*</method-name></method><trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>

但是我无法将此 ejb 部署到服务器。

23:05:46,635 错误 [org.jboss.msc.service.fail](MSC 服务线程 1-2)MSC000001:无法启动服务 jboss.deployment.unit。“cppro.war”。PARSE:org。服务 jboss.msc.service.StartException 服务 jboss.deployment.unit."cppro.war".PARSE: WFLYSRV0153: 无法处理部署“cppro.war”的阶段解析 在 org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154) 在 org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) 在 org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(来源未知) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(来源未知) 在 java.lang.Thread.run(来源未知)引起:org.jboss.as.server.deployment.DeploymentUnitProcessingException:WFLYEJB0450:不再支持实体Bean,无法部署Bean ModelEEJB 在 org.jboss.as.ejb3.deployment.processors.EjbJarParsingDeploymentUnitProcessor.deploy(EjbJarParsingDeploymentUnitProcessor.java:179) 在 org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147) ... 5 更多

如何修复它?

最佳答案

无法仅更改某些属性/xml 配置并将当前的 CMP 重新部署到新的 JavaEE 应用程序服务器中。您必须对代码进行一些更改并重新编译它们。

关于其复杂性,主要取决于您使用 CMP 的方式以及持久层之上的抽象级别。您可能需要对您的 bean 进行一些重构/重组。

我强烈建议您查看以下指南,以便您更好地了解将应用程序迁移到 JPA 时应进行的必需/可选更改。

http://what-when-how.com/enterprise-javabeans-3/migrating-cmp-2-entity-beans-to-the-ejb-3-jpa-part-1/

关于java - : Entity Beans are no longer supported,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44689491/

40 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com