Problem with JMS in JBoss
843830Mar 26 2003 — edited Sep 9 2008Hi
I'm trying JMS for the first time using JBoss.
I've deployed my "MessageSender" class and the relevant servlet that calls the class to JBoss successfully, but when I try run the servlet on JBoss (localhost:8080), I get the following error on the JBoss server:javax.naming.NameNotFoundException QueueConnectionFactory not bound...
In the JMSTutorial they use the J2EE server to create a queue: j2eeadmin -addJmsDestination MyQueue queue, how would you do this in JBoss?
Please Help!
here is the code i'm using:
QueueConnection queueConnection = null;
try{
Context context = new InitialContext();
//It fails in the next line
QueueConnectionFactory queueConnectionFactory=(QueueConnectionFactory)context.lookup("QueueConnectionFactory");
String queueName="MyQueue";
Queue queue = (Queue)context.lookup(queueName);
queueConnection=queueConnectionFactory.createQueueConnection();
QueueSession queueSession=queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
QueueSender queueSender=queueSession.createSender(queue);
TextMessage message = queueSession.createTextMessage();
message.setText("This is a TextMessage");
queueSender.send(message);
request.setAttribute("jmsMessage","Message Sent");