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
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to