我有一个MDB,它需要其他无接口视图Bean(无状态会话Bean),不幸的是,我必须通过XML(ejb-jar.xml)进行注入。有人有提示在Java EE 8(EJB 3.2)中实现这一点吗?
@Interceptors(LoggingInterceptor.class)
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "jms/P76MQ$4bd3dc121fdd4ae5a0730e990a4d14c0"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "MandantenId = '4bd3dc121fdd4ae5a0730e990a4d14c0'"),
@ActivationConfigProperty(propertyName = "maxMessagesPerSessions<", propertyValue = "100"),
@ActivationConfigProperty(propertyName = "maxSessions", propertyValue = "1000") })
public class Protokollierung implements MessageListener {
@EJB
private PersonenIndexRepository personenIndexRepository;
@EJB
private BearbeitungsFehlerRepository bearbeitungsFehlerRepository;
@EJB
private PersonenIndexStandardisierung personenIndexStandardisierung;
@EJB
private ErmittlungFachdatenAenderungen ermittlungFachdatenAenderungen;
@EJB
private TransaktionsProtokollRepository transaktionsProtokollRepository;
@Resource
private String mandantenId;
public Protokollierung() {
}
@PreDestroy
public void runterfahren() {
this.schema = null;
this.mapper = null;
MDC.clear();
}
@Override
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public void onMessage(Message message) {
}
}
<message-driven>
How to reference this ejbs ?
i found something about ejb-local-ref .. how does it work ??
</message-driven>
问候安德烈
1条答案
按热度按时间ykejflvf1#
我找到解决办法了
我的错误是我没有声明一个局部标记。。我想。。嘿,我有一个没有接口的bean,为什么我必须另一次声明类型。