It works.

Thank you.

Thomas TERMIN ha scritto:
Andrea Zoppello wrote:
Hi to all

I'm asking if there's a way to access Jndi resources (defined in
jndi.xml ) in the java code of a component/endpoint???

That should work.

 private String jndiInitialContextFactory =
"org.apache.xbean.spring.jndi.SpringInitialContextFactory";
  private String jndiProviderUrl = "classpath:jndi.xml";

Hashtable env = new Hashtable();
        env.put(Context.INITIAL_CONTEXT_FACTORY,
this.jndiInitialContextFactory);
        env.put(Context.PROVIDER_URL, jndiProviderUrl);

Context ctx = new InitialContext(env);

Cheers,
Thomas

Reply via email to