Ben Cox
Ben Cox

Reputation: 1483

Are activation specs required for message-driven beans?

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 the TheMDB message-driven bean cannot be activated because the mdb.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.

Upvotes: 2

Views: 2424

Answers (2)

daveZ
daveZ

Reputation: 11

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).

Upvotes: 0

kaczyns
kaczyns

Reputation: 216

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.

Upvotes: 2

Related Questions