public void createQueue() throws Exception{ InitialContext ctx = new InitialContext(); System.out.println("\n\nFactory is : " + ctx.lookup("ConnectionFactory") + "\n\n"); SpyConnectionFactory factory = (SpyConnectionFactory) ctx.lookup("ConnectionFactory"); qCon = factory.createQueueConnection(); ctx = new InitialContext(); System.out.println("\n\nQueue is : " + (Object)ctx.lookup("queue/echnQueue") + "\n\n"); queue = (Queue) ctx.lookup("queue/echnQueue"); qSess = qCon.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE); qCon.start(); } public void sendMessageToQueue(String message) throws Exception{ qSender = qSess.createSender(queue); TextMessage tm = qSess.createTextMessage(message); qSender.send(tm); qSender.close(); System.out.println("\n\n\n\n*****************\n\nMessage Send to Queue And QSender is Closed\n\n************\n\n\n"); pw.println("***************** Message Send to Queue And QSender is Closed ************"); }
I am getting ClassCastException in the red marked line. I am trying to type cast to javax.jms.Queue.Please let me know what to to solve this and also please let me know what changes should I need to do in jbossmq-destination-service.xml and jms-ds.xml All the reqd libraries are set in the classpath. Regards, Dharma View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3955494#3955494 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3955494 Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user