private void createNamingContext()
throws NamingException {
Hashtable contextEnv = new Hashtable();
javax.naming.Context namingContext =
new NamingContext(contextEnv, getNamingContextName());
ContextAccessController.setSecurityToken(getNamingContextName(), this);
ContextBindings.bindContext(this, namingContext, this);
ContextBindings.bindThread(this, this);
// Setting the context in read/write mode
ContextAccessController.setWritable(getNamingContextName(), this);
// Creating the comp subcontext
javax.naming.Context compCtx = namingContext.createSubcontext("comp");
javax.naming.Context envCtx = compCtx.createSubcontext("env");
// Now parsing the entries defined in the env, and adding them to the
// naming context