[jboss-user] [JNDI and Naming] - Re: JNDI Lookup fails in JBoss AS 7 [java.naming.CommunicationException]

abiya do-not-reply at jboss.com
Fri Nov 25 03:21:08 EST 2011


abiya [http://community.jboss.org/people/abiya] created the discussion

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

To view the discussion, visit: http://community.jboss.org/message/638297#638297

--------------------------------------------------------------
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
[http://community.jboss.org/message/638297#638297]

Start a new discussion in JNDI and Naming at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111125/7f6b9801/attachment.html 


More information about the jboss-user mailing list