aspose file tools*
The moose likes JBoss/WildFly and the fly likes jms test Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "jms test" Watch "jms test" New topic
Author

jms test

John Gregory
Ranch Hand

Joined: Oct 05, 2006
Posts: 118
I'm trying to run the following code:

ic = new InitialContext(env);
QueueConnectionFactory qcf = (QueueConnectionFactory)
ic.lookup("ConnectionFactory");
conn = qcf.createQueueConnection();
session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);

sQue = (Queue) ic.lookup("queue/JJGQue"); // sQue is a Queue
qSender = session.createSender(sQue); //QueueSender
rQue = (Queue) ic.lookup("queue/MSGQ"); // rQue is a Queue

I'm getting the following error:

/development/MsgTest/src/test/main/Main.java:45: createSender(javax.jms.Queue) in javax.jms.QueueSession cannot be applied to (java.util.Queue)
qSender = session.createSender(sQue);
/development/MsgTest/src/test/main/Main.java:48: cannot find symbol
symbol : method createReceiver(java.util.Queue)
location: interface javax.jms.QueueSession
qRcver = session.createReceiver(rQue);

Can anyone tell me why? I didn't think I was doing anything out of
the ordinary.

Thanks,

John
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10289
    
168

Originally posted by John Gregory:
/development/MsgTest/src/test/main/Main.java:45: createSender(javax.jms.Queue) in javax.jms.QueueSession cannot be applied to (java.util.Queue)
qSender = session.createSender(sQue);
/development/MsgTest/src/test/main/Main.java:48: cannot find symbol
symbol : method createReceiver(java.util.Queue)
location: interface javax.jms.QueueSession
qRcver = session.createReceiver(rQue);



It's just a case of importing the wrong package. For the variables rQue and sQue you probably have imported java.util.Queue instead of javax.jms.Queue.


[My Blog] [JavaRanch Journal]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jms test