> Hello!
   Hello to you too.

> I have a problem accessing JNDI from standalone application. I run Jboss.
> And on the same machine I am trying to run my application. In the
> application:
> Hashtable props = new Hashtable();
> props.put("Context.INITIAL_CONTEXT_FACTORY",
"org.jnp.interfaces.NamingContextFactory");
> props.put("Context.PROVIDER_URL", "tech2:1099");
> props.put("java.naming.rmi.security.manager", "yes");
> props.put("Context.URL_PKG_PREFIXES", "org.jboss.naming");


  Pay attention that :

props.put(
  Context.INITIAL_CONTEXT_FACTORY,    <<<<---- NO QUOTES!!!!!
  "org.jnp.interfaces.NamingContextFactory");


   OR

props.put(
  "java.naming.factory.initial",      <<<<---- WITH QUOTES!!!!!
  "org.jnp.interfaces.NamingContextFactory");

> try
> {
>   jndiContext = new InitialContext(props);
> }
> catch(NamingException e)
> {
>   System.out.println("Could not create JNDI context: " + e.toString());
>   System.exit(1);
> }
>
> I don't get an exception here. But when I try to
> jndiContext.getEnvironment() I get an exception:
> javax.naming.NoInitialContextException: Need to specify class name in
> environment or system property, or as an applet parameter, or in an
> application resource file:  java.naming.factory.initial
>
> What am I doing wrong?
>
> jalex


   Lachezar.



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to