Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Problem with JMS in JBoss

843830Mar 26 2003 — edited Sep 9 2008
Hi

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");
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 7 2008
Added on Mar 26 2003
9 comments
252 views