Java 具有相同名称的多个EJB bean

Java 具有相同名称的多个EJB bean,java,ejb,apache-tomee,Java,Ejb,Apache Tomee,我们有两个EJB bean,它们具有相同的名称(比如MyBean),但位于不同的包(不同的子模块)中,比如com.example.module1和com.example.module2,它们实现了完全不同的接口。 ApacheTomee+1.7.2在每次部署中只随机识别其中一个,完全忽略另一个,甚至没有警告 尝试将conf/system.properties中的openejb.deploymentId.format属性更改为以下两个,但没有帮助 openejb.deploymentId.form

我们有两个EJB bean,它们具有相同的名称(比如MyBean),但位于不同的包(不同的子模块)中,比如com.example.module1和com.example.module2,它们实现了完全不同的接口。 ApacheTomee+1.7.2在每次部署中只随机识别其中一个,完全忽略另一个,甚至没有警告

尝试将conf/system.properties中的openejb.deploymentId.format属性更改为以下两个,但没有帮助

openejb.deploymentId.format = {appId}/{ejbJarId}/{ejbName}

openejb.deploymentId.format = {appId}/{ejbJarId}/{ejbClass}

有人知道如何解决这个问题吗?非常感谢

您试过为每个设置一个名称吗

@Stateless(name="MyBean1")
public class MyBean implements MyBeanLocal
或注释

@Documented
@Qualifier
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE})
public @interface TypeOne {

}

@Documented
@Qualifier
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE})
public @interface TypeTwo {

}


@TypeOne
@Stateless
public class MyBean implements MyBeanLocal

@TypeTwo
@Stateless
public class MyBean implements MyBeanLocal