:不再支持实体Bean

时间:2017-06-22 03:10:12

标签: java jboss ejb wildfly ejb-3.1

我正在使用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 ERROR [org.jboss.msc.service.fail](MSC服务线程1-2)MSC000001:无法启动服务jboss.deployment.unit。&#34; cppro.war&#34; .PARSE:服务jboss.deployment.unit中的org.jboss.msc.service.StartException。&#34; cppro.war&#34; .PARSE:WFLYSRV0153:无法处理部署的阶段PARSE&#34; cppro.war&# 34;     在org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)     at org.jboss.msc.service.ServiceControllerImpl $ StartTask.startService(ServiceControllerImpl.java:1948)     at org.jboss.msc.service.ServiceControllerImpl $ StartTask.run(ServiceControllerImpl.java:1881)     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)     at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)     在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个

我该如何解决?

1 个答案:

答案 0 :(得分:1)

无法仅更改某些属性/ 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/