JBoss Community

Re: JNDI Lookup fails in JBoss AS 7 [java.naming.CommunicationException]

created by abiya in JNDI and Naming - View the full discussion

I am facing similar issue. Did u get a solution for this?

 

My datasource config in standalone.xml is as follows,

<datasource jndi-name="java:jboss/env/myds" enabled="true" use-java-context="true" pool-name="OracleDS">

And when I try to connect from client within same instance

 

      private static Hashtable _env;
            _env.put(Context.INITIAL_CONTEXT_FACTORY,
                    System.getProperty("org.jnp.interfaces.NamingContextFactory"));   
            _env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
            _env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
            _env.put(Context.SECURITY_PRINCIPAL, "");
            _env.put(Context.SECURITY_CREDENTIALS, "");
     ctx = new InitialContext(_env);

 

DataSource ds =

ctx.lookup("java:jboss/env/myds"); throws following exception,

    javax.naming.NameNotFoundException: java:jboss/env/myds

Please help me resolve this.

 



Reply to this message by going to Community

Start a new discussion in JNDI and Naming at Community