Problem with Openfire 4.6.4

I have debugged around and found out that if the (mina) Connection object in LocalSession is somehow corrupted (network errors or other …) a
sess.getHostAddress() in session-row.jspf
will fail and results in
Invalid session/connection

A click on “Close connection” on admin console (session-summary.jsp) allways fails on detached or invalid session because the call of sess.close(); (in session-summary.jsp) fails. It should call the close method of the Session object, but if this is corrupt or null it wont call the closing event with further clean up tasks, so the session wont be deleted. The problem is that new sessions will not be correctly initialized then too but i dont now exactly why.

I found a thread on stackoverflow with a good explanation which might be a reason for this issue (the post which was marked as solution) java - Apache Mina, How to detect when you're sending messages using an invalid socket to the client side? - Stack Overflow