WFLYEJB0034:组件上的 EJB 调用失败

问题描述 投票:0回答:1

模块 1 服务器端

public interface BaseInterface{
  Customer createCustomer(Profile profile);
}

public interface InterfaceA extends BaseInterface{
}

public class ServiceProducer {  
    @EJB(lookup = "java:global/path/ClassA")
    @Produces
    private InterfaceA interfaceA;
}

@Remote(ClassA.class)
public class ClassA implements InterfaceA{
    
    BaseInterface base;

    @Inject
    public ClassA(@Named BaseInterface base){
        this.base = base;
    }
    @Override
    createCustomer implementation ...
} 

模块 2 客户端

public class Api{
    @Inject
    InterfaceA intA;
    
    @Override
    Customer createCustomer(arg){
        intA.createCustomer
    }
}

嗨,我在运行上述代码时收到以下错误

“ClassA”的无状态EJBLocator,视图是接口InterfaceA,关联性是Local

WFLYEJB0034:组件 WorkflowManager 上方法公共抽象 Customer BaseInterface.createCustomer(Profile) 的 EJB 调用失败:javax.ejb.EJBTransactionRolledbackException:WFLYEE0042:无法构造组件实例

interface jboss7.x affinity
1个回答
0
投票

你的界面上面应该有@local

© www.soinside.com 2019 - 2024. All rights reserved.