// Must have a real docBase - just use temp
org.apache.catalina.Context ctx =
tomcat.addContext("", System.getProperty("java.io.tmpdir"));
// Enable JNDI - it is disabled by default
tomcat.enableNaming();
ContextEnvironment environment = new ContextEnvironment();
environment.setType(JNDI_VALUE.getClass().getName());
environment.setName(JNDI_NAME);
environment.setValue(JNDI_VALUE);