I'll assume that you are using tomcat.
I had the same problem. Its important to understand that the JAAS authenticated credentials are associated with a thread in tomcat.
Try removing the the bean instance in the same thread that created it. It worked for me.
I'm using Jboss 3.2.3 with Tomcat. If i use the handle inside the doGet() or doPost() methods, all workds fine (i can remove the bean also). However, if i tried to access the bean inside the destroy method, it doesn't work. It seams that when destroy method is called, the Prinicipal is setted to null. Is this right?
Thanks for your reply!
destroy() is a different thread. If you call lc.login() in the destroy() method it works fine.