问题
I have a non-JMS MDB that I'm installing into a Websphere Liberty server.
package mdb.test;
import javax.ejb.MessageDriven;
@MessageDriven()
public class TheMDB implements MyOwnListener {
public TheMDB() {}
@Override
public void onMyOwnMessage(MyOwnMessage message) {}
}
Without further configuration, the server gives the following message:
[WARNING ]
CNTR4015W
: The message endpoint for theTheMDB
message-driven bean cannot be activated because themdb.test/TheMDB
activation specification is not available. The message endpoint will not receive messages until the activation specification becomes available.
Do MDBs have to have an activation specification? I'd like it to just be activated, without having to add further configuration to the server.
回答1:
Essentially the server is telling you that it founds a message endpoint but there is nothing delivering messages to it. You need to add an activation specification (either JMS or JCA) to allow the bean to receive messages. Some information on defining JCA activation specs:
http://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/twlp_jca_config_actspec.html
I'm not aware of a way to activate the bean without it being tied to an activation spec. Since its function is to process messages, it is of little use without an activation spec. You might need to dummy up enough of your RA to code the activation spec to make progress, even if it is not producing messages yet.
回答2:
Java EE Message-Driven Beans that are used as message endpoints must be deployed using an ActivationSpecification that is defined within a JCA 1.5 (or later) resource adapter configuration (ra.xml).
来源:https://stackoverflow.com/questions/38830760/are-activation-specs-required-for-message-driven-beans