- I have an MDB for consuming a message of a Queue, on Jboss EAP 7.0.6 GA, IBM MQ 9
package com.ryzorbent.demo.jms;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.ejb.TransactionAttribute;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
import org.jboss.ejb3.annotation.ResourceAdapter;
@MessageDriven(name="EFRSTestMDB", activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType",propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "false"),
@ActivationConfigProperty(propertyName = "hostName", propertyValue = "localhost"),
@ActivationConfigProperty(propertyName = "port", propertyValue = "1414"),
@ActivationConfigProperty(propertyName = "channel", propertyValue = "SYSTEM.DEF.SVRCONN"),
@ActivationConfigProperty(propertyName = "queueManager", propertyValue = "EFRS_UAT"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/queue/QUEUE"),
@ActivationConfigProperty(propertyName = "transportType", propertyValue = "CLIENT")
})
@ResourceAdapter(value = "wmq.jmsra.rar")
//@TransactionAttribute(value = "NoTransaction")
public class EFRSTestMDB implements MessageListener {
@Override
public void onMessage(Message inMessage) {
TextMessage message = (TextMessage)inMessage;
try {
System.out.println(String.format("Hello, %s", message.getText()));
} catch (JMSException e) {
e.printStackTrace();
}
}
}
- I copied the wmq.jmsra.rar into the ../standalone/deployments
- Added the resource-adapters subsystem for the queues, channels, etc into the standalone-full.xml
- But i get the below error
java.lang.NoClassDefFoundError: Failed to link com/ryzorbent/demo/jms/EFRSTestMDB (Module "deployment.TestJbossMDB.jar:main" from Service Module Loader): javax/jms/MessageListener