You should close them in the opposite order of creation.
JBoss JMS shouldn't be hanging, however. If your program hangs, you can get a stack trace under UNIX (kill -3 pid) or Windows (ctrl-break) and please post a bug with the version information and a test case or some code snippet for reproducing the problem.
You were right in the order because now session can be closed without hanging. The problem is other: I can see that messages are in a queue and after redeliver a number of times (while doing session.recover()), a message is no longer redeliver but it stays in the queue (when close receiver and session).