on 02-13-2006 11:55 PM
hi all.
I have two j2ee servers let's say S1,S2.
in server S1 i am deploying webdynpro application,
from this webdynpro applicatition i want to call
bean method which is deployed in server S2.
presently i am using below code.
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");
props.put(Context.PROVIDER_URL,"172.25.8.195:50004");
Context con = new InitialContext(props);
Object obj = con.lookup("MESSAGEJNDI");
MessageGetHome mhome = (MessageGetHome)PortableRemoteObject.narrow(obj,MessageGetHome.class);
MessageGet bean = (MessageGet)mhome.create();
String rs = bean.recievemessage(1);
BUT NOT WORKING PROPERLY.
GIVING NAMING EXCEPTION.
WAITING FOR UR VALUABLE RESPONSES.
thanks in advance.
regards
brahm,anandam ausali
Hi brahm,
1) try to specify
Context.SECURITY_PRINCIPAL with username and
Context.SECURITY_CREDENTIALS with password
2) to check JNDI name of EJB go to Visual Administrator->Services->EJB Container, choose your EJB and check "JNDI name" property.
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Maksim ,
thanks for your immediate reply .
i have provided all the details for the intial context.
like,
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");
props.put(Context.PROVIDER_URL,"172.17.51.25:50004");
props.put(Context.SECURITY_PRINCIPAL, "administrator");
props.put(Context.SECURITY_CREDENTIALS, "Hamper1*");
i am getting the following error, can you please see and
tell me what could be the reason.
Error getting the server-side naming service functionality during getInitialContext operation
regards ,
Brahmanandam Ausali
Hi Brahmanandam,
Check username/password and hostname/port for P4 service (you can check it in Visual Administrator - it appears by logging in) and check this http://help.sap.com/saphelp_nw04/helpdata/en/a2/f9d7fed2adc340ab462ae159d19509/frameset.htm . May be you have more than one instance on your server. For me, port is for example - 50204. The rest seems to be OK. Could you post the whole stacktrace of exception?
Best regards, Maksim Rashchynski.
hello Maksim ,
i am getting the following exception trace,
can u please look into it and tell me what could be the problem.
com.sap.engine.services.jndi.persistent.exceptions.NoPermissionException: Exception during getInitialContext operation. Wrong security principle/credentials. [Root exception is com.sap.engine.services.security.exceptions.BaseLoginException: User not authorized.]
please suggest solution for it.
thank you,
regards,
Brahmanandam Ausali
Hi,
I am facing the same problem, I am able to look ejb locally on same server, but remotely it is not working.
here is the sample code!
env.put(Context.PROVIDER_URL, "10.48.121.207:53004"); //p4 port
// env.put("force_remote", "true");
env.put(Context.SECURITY_PRINCIPAL, "Administrator");
env.put(Context.SECURITY_CREDENTIALS, "sapxxx");
InitialContext ctx = new InitialContext(env);
//Object obj = ctx.lookup("RiskAnalysis");
Object obj = ctx.lookup("java:comp/env/ejb/RiskAnalysisBean");
Please advise, what could be the problem, I did all possible things, adding ejb-ref and updating the .xml files with required ref attributes on both EJB and client applications, but still remote lookup is failing!
Please send me sample working ejb and client example for remote lookup, I am working on NW700 with sp12.
Thanks for your information,
Anil
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.