fixes #5591

tested on both MacOS X and W7 using Tomcat and JBoss