Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Microservices in Action this week in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

JMS and Websphere 6  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.


Thanks
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"muaddib",
Please check your private messages regarding an important administrative matter.
-Ben
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!