on 07-07-2009 6:04 PM
I am trying to lookup an EJB facade from J2EE library. I packaged the home and remote interfaces as part of this lbrary for narrowing the looked up object. But the look up is returning ObjectReferenceImpl. Any thoughts how to solve this?
Appreciate your response. This is not a path issue. This is little more complex than that. I am packaging the remote & home interfaces in library for class reference. But class loader will treat these classes different from the classes present in the ejb app and fails to load the lookedup bean and returns ObjectReferenceImpl. This happens because the library and ejb app both are in the same jvm. If client is outside it works perfectly.
"Vladimir Pavlov" from SAP server team wrote an article explaining how to look up ejbs from diff clients. He said lookup from J2ee libraries is possile but didnt explain it clearly. I am hoping he would shed some light on this.
Edited by: Venkat Vadlamannati on Jul 10, 2009 10:48 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check the JNDI name of the ejb:
For local lookup check this below help:
http://help.sap.com/saphelp_nw04/helpdata/en/38/3e5a4201301453e10000000a155106/content.htm
Try remote lookup using the below code:
http://help.sap.com/saphelp_nw04/helpdata/en/08/8f633e0084e946e10000000a114084/frameset.htm
public String lookupEjb()
{
String result="";
try {
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
env.put(Context.PROVIDER_URL, "p4://host:port ");
env.put(Context.SECURITY_PRINCIPAL, "username");
env.put(Context.SECURITY_CREDENTIALS, "password");
InitialContext context = new InitialContext(env);
String jndiName = "";
result+=context.lookup(jndiName);
} catch (Exception e) {
return "Error while lookup: "+e.getCause();
}
return result;
Regards,
Charan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
It seems you are trying the lookup with the wrong JNDI path. What is the path?
BR, Sergei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.