ClassLoader loader = Thread.currentThread().getContextClassLoader();
URL resURL = loader.getResource("log4j.properties");
System.out.println("found log4j.properties: "+resURL);
PropertyConfigurator config = new PropertyConfigurator();
log = Category.getInstance(Log4jServlet.class);
config.configure(resURL);
// Try to access the java:comp/env context
InitialContext ctx = new InitialContext();
Context enc = (Context) ctx.lookup("java:comp/env");
System.out.println("Was able to lookup ENC");