[jboss-user] [JNDI/Naming/Network] - Re: javax.naming.NoInitialContextException: Can't find prope
kahzoo
do-not-reply at jboss.com
Sat May 17 07:52:53 EDT 2008
Sorry if my previous post was not clear enough.
I suggested to change the code as follows:
| public void connect()
| {
| try
| {
|
| System.out.println("Now looking up session bean " + jndiName + " ...");
| java.util.Hashtable properties = new java.util.Hashtable();
| properties.put(Context.PROVIDER_URL,"localhost:1099");
| properties.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
| properties.put("java.naming.rmi.security.manager", "yes");
| javax.naming.Context context = new javax.naming.InitialContext(properties);
|
| Object beanHomeRef
| = context.lookup(jndiName);
|
| System.out.println("got it");
| LoanCalculatorHome home =
| (LoanCalculatorHome)PortableRemoteObject.narrow
| (beanHomeRef, LoanCalculatorHome.class);
| loanCalculator = home.create();
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4151587#4151587
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4151587
More information about the jboss-user
mailing list