2017-06-22 131 views
0

我正在使用wildfly 10.0.x. 而且我遷移到EJB2.1 ejb3.2 所以這是我的ejb-jar.xml文件:Entity Beans不再受支持

<?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.deployment.unit中的.jboss.msc.service.StartException。「cppro.war」.PARSE:WFLYSRV0153:未能在org.jboss.as.server.deployment中處理部署「cppro.war」 的階段PARSE。 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.ThreadPoolEx ecutor $ Worker.run(未知源) at java.lang.Thread.run(Unknown Source) 引起:org.jboss.as.server.deployment.DeploymentUnitProcessingException:WFLYEJB0450:不再支持實體Bean,bean ModelEEJB不能在org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147) 在org.jboss.as.ejb3.deployment.processors.EjbJarParsingDeploymentUnitProcessor.deploy(EjbJarParsingDeploymentUnitProcessor.java:179) 部署 。 .. 5更多

我該如何解決?

+0

這可以幫助你:http://www.oracle.com/technetwork/articles/vohra-ejb-086603.html – Manuel

+0

非常感謝您 –

+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/

+0

謝謝主席先生。我們可以在Google Hangout [email protected]中聊天 –