File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes JMS and Websphere 6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JMS and Websphere 6" Watch "JMS and Websphere 6" New topic

JMS and Websphere 6

T Masga

Joined: Jun 25, 2008
Posts: 6

I'm new to JMS and I'm trying to implement a JMS producer/consumer in Websphere 6.

My objective is to use standard J2EE specs, and end with a simple example, with no MDB around, just plain java objects.

So I created a a servlet that posts a message, then I have a timertask that queries the queue for any messages to process.

The process is simple, and it works fine, but I have a small issue:

I'm retrieving an instance of ConnectionFactory and Queue using the following code:

Although this works like a charm, I get the following warning on the console:

That also happened with datasources when I used the jndi name "jdbc/my-dbcon". I then started using "java:comp/env/jdbc/my-dbcon" and those datasource warnings vanished, but if I use "java:comp/env/jms/my-connection" I receive an error and it stops working. Something like "Error 500: Name comp/env/jdbc not found in context "java:".".

In my web.xml, I have the following data:

If I remove the resource-ref of "jms/my-connection", the JMS still works, as long as I don't prefix the jndi with "java:comp/env/". So it raises another question: do I really need the resource-ref definition there, if it still works without it?

(JMS works without ""java:comp/env/" prefixing, so I assume the JMS is configured properly on Websphere server.)

Any help on successfull JMS referencing using jndi "java:comp/env/" prefix would be great.

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Please check your private messages regarding an important administrative matter.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: JMS and Websphere 6
It's not a secret anymore!