[jboss-user] [JBoss Messaging] - Re: javax.jms.InvalidDestinationException: Destination is no
chaituu
do-not-reply at jboss.com
Wed Dec 13 03:16:56 EST 2006
U said for remote lookup u use testQueue but what about QueueConnectionFactory.how to lookup QueueConnectionFactory??
when i send the message to the queue i am getting below exception.
| javax.jms.InvalidDestinationException: Destination is not an instance of SpyDestination JBossQueue[testQueue]
|
|
| Properties env = new Properties();
| env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
| env.put(Context.PROVIDER_URL, "localhost:1099");
| Context remoteCtx = new InitialContext(env);
| Queue queue = (Queue)remoteCtx.lookup("queue/testQueue");
| System.out.println("queue="+queue);
|
| //I am getting queue correctly here
|
|
| QueueConnectionFactory queueFactory = (QueueConnectionFactory)remoteCtx.lookup("java:JmsXA");
|
| //How to get queueFactory here??
|
| System.out.println("queueFactory="+queueFactory);
| queueConnection = queueFactory.createQueueConnection();
| QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
| QueueSender queueSender = queueSession.createSender(queue);
| System.out.println("queueSender="+queueSender);
| TextMessage message = queueSession.createTextMessage();
|
| message.setText(Long.toString(2));
| queueSender.send(message);
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993274#3993274
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993274
More information about the jboss-user
mailing list