[jboss-user] [Messaging, JMS & JBossMQ] - Re: How to setup context when accessing SLSB from MDB?

alllle do-not-reply at jboss.com
Wed Oct 31 02:01:02 EDT 2007


Problem solved after trace into JBoss code.

The reason is that I created the InitialContext at the time when the MDB is created and try to reuse it when the onMessage() is invoked. What happens behind the scene is that JBoss saves the username / password into a ThreadLocal variable in server environment when the InitialContext is created. This ThreadLocal variable is not there anymore when the onMessage() is invoked because it is a different thread. Hence, the security information is lost and causes the authentication exception.

I now create a new InitialContext object when processing the onMessage() method. Seems working fine.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4100503#4100503

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4100503



More information about the jboss-user mailing list