Fix some broken tests for Wildfly

Also simplify some of the error stuff, as it was causing problems
Merge pull request #605 from zanata/fix-the-wildfly-tests-again

Fix some broken tests for Wildfly