[jboss-user] [JNDI/Naming/Network] - Always getting not bound naming exceptions
ezanih
do-not-reply at jboss.com
Wed Jan 7 00:11:35 EST 2009
Hi there
I am using JBoss 4.2.2.GA, Eclipse Ganymede and OracleXE with JDK5.0_14. I seem to always get "XXX not bound" exceptions for my sample project when I do lookups through the JNDI initial naming context whether it is a datasource in the java namespace or an ejb in the global JNDI namespace. I have checked in jmx-console ViewJNDI routine that the JNDI names exits.
Snippets of my code initializing JNDI naming are as follows :-
For datasource naming:
| Properties p = new Properties();
| p.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
| p.put("java.naming.provider.url", "jnp://localhost:1099");
| p.put("java.naming.factory.url.pkgs", "org.jboss.naming.client");
|
| java.sql.Connection conn;
| InitialContext ic = new InitialContext(p);
| javax.sql.DataSource db = (javax.sql.DataSource) ic.lookup("java:OracleXE1_DS");
|
And for the session EJB3 lookup:
| Properties p = new Properties();
| p.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
| p.put("java.naming.provider.url", "jnp://localhost:1099");
| p.put("java.naming.factory.url.pkgs", "org.jboss.naming.client");
|
| InitialContext ctx = new InitialContext(p);
| //BiddingTestBeanRemote bidder = (BiddingTestBeanRemote) ctx.lookup("BiddingTestBean");
| BiddingTestBeanRemote bidder = (BiddingTestBeanRemote) PortableRemoteObject.narrow (ctx.lookup("BiddingTestBean"), BiddingTestBeanRemote.class);
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199962#4199962
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199962
More information about the jboss-user
mailing list