Multiple choice java

Before a message-driven bean (MDB) can be tested, the J2EE application server has been installed on a test machine and a connection factory and destination have been configured for the JMS provider. What other configuration task MUST be completed before t

  1. The native library directory in the classpath must be specified

  2. A message listener port must be defined

  3. The message listener service must be enabled

  4. A message passivation directory must be specified

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

A message-driven bean requires a message listener port (also called an activation spec or JMS listener) to be configured on the application server. This defines the JMS destination and connection factory the MDB will listen to. Without this configuration, the MDB cannot receive messages.

AI explanation

Even with the connection factory, destination, and application server all set up, a message-driven bean still needs a message listener port configured so the app server knows which destination and connection factory to bind the MDB to at deployment. Without that mapping, the container has no way to route incoming JMS messages to the bean, regardless of whether the classpath or listener service settings are otherwise fine.