Hi all,
I am trying to configure a QueueConnectionFactory with an external JMS Provider.
I getting the following error:
anonymous wrote : java.lang.ClassCastException: Object at
'WSMQXAQueueConnectionFactory' in context
{java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory,
java.naming.provider.url=file:/D:/JNDI-Directory,
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces}
is not an instance of [class=javax.jms.TopicConnectionFactory [EMAIL
PROTECTED]
url=file:/D:/jboss-4.0.1sp1/server/default/tmp/deploy/tmp33423jboss-service.xml
,addedOrder=2} interfaces={interface=javax.jms.ConnectionFactory [EMAIL
PROTECTED]
url=file:/D:/jboss-4.0.1sp1/server/default/tmp/deploy/tmp33423jboss-service.xml
,addedOrder=2}}] object class is
[class=com.ibm.mq.jms.MQXAQueueConnectionFactory [EMAIL PROTECTED]
url=file:/D:/jboss-4.0.1sp1/server/default/tmp/deploy/tmp33423jboss-service.xml
,addedOrder=2} interfaces={interface=javax.jms.XAQueueConnectionFactory [EMAIL
PROTECTED]
url=file:/D:/jboss-4.0.1sp1/server/default/tmp/deploy/tmp33423jboss-service.xml
,addedOrder=2}}]
Looking at the code (org.jboss.resource.adapter.jms.inflow.JmsActivation) I
have seen the following:
protected QueueConnection setupQueueConnection(Context ctx, String user,
String pass, String clientID)
| throws Exception
| {
| String queueFactoryRef = adapter.getQueueFactoryRef();
| log.debug("Attempting to lookup queue connection factory " +
queueFactoryRef);
| QueueConnectionFactory qcf =
(QueueConnectionFactory)Util.lookup(ctx, queueFactoryRef,
javax.jms.TopicConnectionFactory.class);
| log.debug("Got queue connection factory " + qcf + " from " +
queueFactoryRef);
| log.debug("Attempting to create queue connection with user " +
user);
| QueueConnection result;
| if(user != null)
| result = qcf.createQueueConnection(user, pass);
| else
| result = qcf.createQueueConnection();
| if(clientID != null)
| result.setClientID(clientID);
| result.setExceptionListener(this);
| log.debug("Using queue connection " + result);
| return result;
| }
I think the code should be like:
QueueConnectionFactory qcf = (QueueConnectionFactory)Util.lookup(ctx,
queueFactoryRef, javax.jms.QueueConnectionFactory.class);
Thx
Felipe
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3873378#3873378
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3873378
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user