Hi
I am new to
EJB and am trying to access a session bean from a
java client. i m using websphere studio. here is the code for client, Plz help me solve this problem
------------------------------------------
public class ClientTest extends Object {
public ClientTest() {
}
public static void main(
String[] args) throws Exception{
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
h.put(Context.PROVIDER_URL,"iiop://127.0.0.1:2809");
// InitialContext ctx = new InitialContext(h);
InitialContext ctx = new InitialContext();
Object obj=ctx.lookup("test"); // this is line 30 from error
try
{
TestHome home=(TestHome)PortableRemoteObject.narrow(obj,TestHome.class);
Test test=home.create();
System.out.println("Create successfully");
String st=test.getMsg();
test.remove();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
------------------------------------------------
and the error i m getting is as follows
---------ERROR -----------
javax.naming.ConfigurationException: Malformed provider URL: corbaloc:iiop:localhost
at com.ibm.ws.naming.util.WsnInitCtxFactory.parseBootstrapURL(WsnInitCtxFactory.java:1422)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:368)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:102)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:408)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:131)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at ClientTest.main(ClientTest.java:30)
Thanks and Regards
Gul