[jboss-user] [JBoss and NetBeans] - Re: NameNotFoundException: DefaultDS not bound - Entity Unit
htran_888
do-not-reply at jboss.com
Mon Feb 12 21:13:03 EST 2007
Hi L,
Success at last after having upgraded JBoss to 4.0.5 (full support for EJB 3.0) which may have fixed the problem. Anyhow the main sticking point was not referencing TravelAgentBean correctly using JNDI. Below is the only slight modification needed from the original code from the Client:
Context ctx = getInitialContext();
| Object ref = (TravelAgentRemote) ctx.lookup("TravelAgentBean/remote");
| TravelAgentRemote dao = (TravelAgentRemote)
| PortableRemoteObject.narrow(ref,TravelAgentRemote.class);
or
InitialContext ctx = new InitialContext();
| TravelAgentRemote dao = (TravelAgentRemote) ctx.lookup("TravelAgentBean/remote");
No need for any JNDI bootstraping properties as in EJB 2.1 or earlier.
Likewise, I didn't need these libraries in the Client's classpath either:
/client/jboss-j2ee.jar
/client/jbossall-client.jar
/server/default/lib/jnpserver.jar
/lib/jboss-common.jar.
I also learnt a lot on creating EJB using Netbeans & JBoss to lookup JNDI that was largely my problem.
Again a Big thank you for all your suggestions,
Henry
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4015534#4015534
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4015534
More information about the jboss-user
mailing list