Fixes for IBM JDK

This contains the relevant parts of https://github.com/jbossas/jboss-eap/pull/446 for WildFly