Properly log JMS error messages, fix test, close #1849