All,

I am trying to use the excalibur.naming package, but I am having severe
problems with the in-memory naming system.

    DefaultConfiguration config = new DefaultConfiguration("roles", "");
    DefaultConfiguration timeComponent = new DefaultConfiguration("role",
"roles");
    timeComponent.addAttribute("role", Time.ROLE);
    timeComponent.addAttribute("class", TimeComponent.class.getName());
    config.addChild(timeComponent);

    Hashtable environment = new Hashtable();
    environment.put(Context.INITIAL_CONTEXT_FACTORY,
                          MemoryInitialContextFactory.class.getName());

    Context initialContext = new InitialContext(environment);
    Context ctx = initialContext.createSubcontext("org");
    ctx = ctx.createSubcontext("apache");
    ctx = ctx.createSubcontext("cocoon");
    ctx = ctx.createSubcontext("samples");
    ctx = ctx.createSubcontext("parentcm");
    ctx.rebind("ParentCMConfiguration", config);

    initialContext = new InitialContext(environment);

initialContext.lookup("org/apache/cocoon/samples/parentcm/ParentCMConfigurat
ion");

The last line results in a name not bound exception: org.

I looked at the code, and the statement new InitialContext(environment)
really does create two different namespaces. The contexts obtained via the
MemoryInitialContextFactory are thus not persistent - they are more like a
hierarchical HashMap.

So, how does one use this package? I need to store one object from one class
and pick it up in another, without passing the InitialContext across.

/LS


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to