hi,
I have registered a servlet in a local machine,which install a weblogic 5.1 server. And in this servlet ,I will call a session bean in another machine(I know it's Ip Address.).I have tried.but fails.
Just can not find the session Bean.
the code is:
try{
Context ctx=getInitialContext();
out.println("context is "+ctx);
Object object=ctx.lookup("UserAuthentication");
UserAuthenticationHome home=(UserAuthenticationHome)javax.rmi.PortableRemoteObject.narrow(object,UserAuthenticationHome.class);
...
static public Context getInitialContext() throws Exception {
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
p.put(Context.PROVIDER_URL, url);//
if (user != null) {
p.put(Context.SECURITY_PRINCIPAL, user);
if (password == null)
password = "";
p.put(Context.SECURITY_CREDENTIALS, password);
}
return new InitialContext(p);
}
static String url = "t3://102.226.180.108:7001";//another machine
static String user = null;
static String password = null;
Please give me help!
thanks
zhousr
Discussions
Web tier: servlets, JSP, Web frameworks: hi,about using a sesion bean in another weblogic server?
-
hi,about using a sesion bean in another weblogic server? (2 messages)
- Posted by: John hs
- Posted on: April 23 2001 02:23 EDT
Threaded Messages (2)
- hi,about using a sesion bean in another weblogic server? by Kapil Israni on April 24 2001 16:43 EDT
- hi,about using a sesion bean in another weblogic server? by Tony Brookes on April 24 2001 18:17 EDT
-
hi,about using a sesion bean in another weblogic server?[ Go to top ]
- Posted by: Kapil Israni
- Posted on: April 24 2001 16:43 EDT
- in response to John hs
make sure that stubs(of the ejb object) generated by ejbc are present in the classpath of the client. -
hi,about using a sesion bean in another weblogic server?[ Go to top ]
- Posted by: Tony Brookes
- Posted on: April 24 2001 18:17 EDT
- in response to Kapil Israni
You should _not_ need to have the stubs on the client. They should be sent over the wire from the server in exactly the same way as they are to any other EJB client.
Note: The above is not true with WebLogic 5.1.0 IF the two servers are in a cluster, it's a known bug, due to be fixed in SP9.
Try skipping the authentication lines in the inital context set up. Not sure how it reacts to nulls as opposed to not provided.
Chz
Tony