change the getLoader code to support tomcat8