In WebSphere when the HTTP user session expires, the Seam session listener intercepts the event and try to clean all the pending components
A call to the method annotated "@Destroy" is called on EntityManager (ie method destroy())
This methods checks if there is an active Transaction to throw an exception in case there is one. For this it performs a JNDI lookup on java:comp/env/UserTransaction
In this context, the lookup fails with a javax.naming.ConfigurationException in WebSphere because it is illegal to do such operation in such a thread (The one spawned by WebSphere to timeout the session) and the EntityManager is never closed and the whole clean process fails..
This can be corrected by intercepting the exception in the ManagedPersistenceContext.close() method and continue with the close operation on the EntityManager