Apache cxf客户端调用EJB 2.0 SessionBean,BMT错误应该完成事务

时间:2013-09-09 12:02:19

标签: apache jboss ejb cxf

我们正在尝试使用EJB 2.0中的Web服务。客户端的代码是使用soapUI和Apache CXF 2.7.6创建的。 当我们尝试从de EJB内部调用服务时出现问题,收到错误: “javax.ejb.EJBException:java.rmi.RemoteException:应用程序错误:BMT无状态bean ServiceBean应该在返回之前完成事务(ejb1.1规范,11.6.1)”

ejb事务被声明为

<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>

我们还试图排除从事务

调用web服务的de方法
   <container-transaction>
  <method>
     <ejb-name>ServiceEJB</ejb-name>
      <method-name>*</method-name>
   </method>
   <trans-attribute>Required</trans-attribute>
</container-transaction>
   <container-transaction>
  <method>
     <ejb-name>ServiceEJB</ejb-name>
      <method-name>cxfServiceCall</method-name>
   </method>
   <trans-attribute>NotSupported</trans-attribute>
</container-transaction>

我正在阅读,是否有任何与EJB 2.0不兼容的CXF? 可能有什么问题?

PS:我们正在使用Jboss 4.2.3

1 个答案:

答案 0 :(得分:0)

似乎需要将EJB事务类型从Bean更改为Container。

<transaction-type>Container</transaction-type>