I think that ClassCastException happens when the JBossMQ code pulls your IBM MQ
class from JNDI. You're still using the JBoss MDB JMS Provider.
I was in the same boat trying to use Sun's IMQ server. This is how I got it
working:
| package elm.mdb;
|
| import javax.ejb.ActivationConfigProperty;
| import javax.ejb.MessageDriven;
| import javax.ejb.Remote;
| import javax.jms.Message;
| import javax.jms.MessageListener;
| import org.jboss.annotation.ejb.ResourceAdapter;
|
| import org.apache.log4j.Logger;
|
| @MessageDriven(mappedName = "jms/LoggingEventBean", activationConfig = {
| @ActivationConfigProperty(propertyName = "acknowledgeMode",
propertyValue = "Auto-acknowledge"),
| @ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Topic"),
| @ActivationConfigProperty(propertyName = "subscriptionDurability",
propertyValue = "Durable"),
| @ActivationConfigProperty(propertyName = "clientId", propertyValue
= "LoggingEventBean"),
| //@ActivationConfigProperty(propertyName = "destination",
propertyValue = "elm_topics_LoggingEvent_default"),
| @ActivationConfigProperty(propertyName = "destination",
propertyValue = "EnterpriseLoggingTopic"),
| @ActivationConfigProperty(propertyName = "subscriptionName",
propertyValue = "LoggingEventBean")
| //@ActivationConfigProperty(propertyName = "UserName",
propertyValue = "guest"),
| //@ActivationConfigProperty(propertyName = "Password",
propertyValue = "guest")
| })
| @ResourceAdapter("imqjmsra.rar")
| public class LoggingEventBean implements MessageListener {
|
| static Logger logger = Logger.getLogger(LoggingEventBean.class);
|
| public LoggingEventBean() {
| }
|
| public void onMessage(Message message) {
| logger.info("got message");
|
| }
|
| }
|
I still don't know if this is the 'right' way to do it. Let me know if you
find anything different!
AM
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073703#4073703
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073703
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user