Prevent NPE with JBoss