Welcome
DefaultMessageListenerContainer troubles in Websphere
By: Michel.Schudel, 3 February 2010Using the Spring DefaultMessageListenerContainer makes it easy for you to connect to a jms resource like a Queue so you can pick up messages from that queue.
Using this container in Websphere (6.0, 6.1, 7) some problems occur when you want to do the following:
- You use a resource environment reference for your destination, specified in the web.xml, for the Destination.
- You use the property
destinationNameon theDefaultMessageListenerContainerin combination with aJndiDestinationResolverto look up your resource environment reference like this:java:comp/env/jms/(your destination)
problem
When you try to start the application, you will get an exception like this: javax.naming.NameNotFoundException: Name "comp/env/jms/(your destination)" not found in context "java:"., although you are sure that your resource environment reference is defined correctly.
cause
The cause of this problem lies in the fact that the lookup occurs in a Thread started by the DefaultMessageListenerContainer, which is unmanaged by Websphere. This thread will not have the jndi queue bindings in its InitialContext.
solution
You can either:
- Specifiy the jndi object beforehand with a
JndiObjectFactoryBean, or a, and then
<jee:jndi-lookup id="myqueue" jndi-name="java:comp/env/jms/(your destination)"/>
setting thedestinationproperty of theDefaultMessageListenerContainerto the refmyqueue, so no actual lookup occurs within the thread of the listener itself. -
Delegate the listener’s thread to Websphere with the help of the Spring class
WorkManagerTaskExecutor. You can then set the propertytaskExecutoron the message listener container to reference this class. See the IBM article here for details on how to do this.
JSF 2.0: The most simple CDI integration use cases
By: Jan-Kees van Andel, 31 January 2010If you have (just like me) been following the Web Beans and Contexts and Dependency Injection (CDI) work, you might be thinking (also just like I did): “That CDI is heavily over-engineered”. My “moment of clarity” was a year ago, at DeVoxx 2008.
It was a talk by Pete Muir of JBoss. He was showing a [...]
JSF 2.0: Maximum flexibility with System Events
By: Jan-Kees van Andel, 24 January 2010JSF 2.0 adds a lot of interesting features. Andy Schwartz provides an extensive overview on his blog.
On this blog, I’d like to elaborate a bit further on the interesting features JSF 2.0 has to offer.
JSF 2.0: System Events
JSF 2.0 comes with a useful feature, called System events. System events are predefined events that are published [...]
java.util.Calendar.getActualMaximum returns strange results
By: Peter Schuler, 20 January 2010At the end of last year I encountered something odd in the java.util.Calendar. Now is odd behavior nothing to be surprised of in the Java Calendar but this particular oddness was really hard to spot.
I will therefore share it with you.
The code
Let’s first look a some code dealing with getting the last day of the [...]
Spring 3.0: REST services with Spring MVC
By: Stephan Oudmaijer, 16 January 2010Spring 3.0 has support for REST style WebServices, the Spring MVC controllers facilitate the functionality. In this example I will show an example of how to implement a basic REST service that uses XML marshalling to sent information over HTTP. Disclamier: this is not an in depth tutorial for building REST style WebServices.
The Spring MVC [...]



