// env.setProperty("java.naming.provider.url", providerURL);
// log.info("Env = " + env);
// Context ctx = new InitialContext(env);
// ctx.bind(NAME, VALUE);
Naming namingServer = naming.getNamingInstance();
namingServer.bind(parser.parse(NAME),
new MarshalledValuePair(VALUE),
VALUE.getClass().getName());
log.info("Bound " + VALUE + " to " + namingServer + " under " + NAME);
Context sub = namingServer.createSubcontext(parser.parse(SUBCONTEXT_NAME));
sub.bind(parser.parse(NAME), VALUE);
log.info("Bound " + VALUE + " to " + sub + " under " + NAME);
// NOTE: we must bind the NonDeserializable directly, or else the
// NamingContext will wrap it in a MarshalledValuePair, which will
// defeat the test by triggering deserialization too late
namingServer.bind(parser.parse(BAD_BINDING), new NonDeserializable(),
NonDeserializable.class.getName());
log.info("Bound a NonDeserializable to " + namingServer + " under " + BAD_BINDING);
}