on 02-06-2009 9:57 AM
Hai All,
I want to call an ejb from a web dynpro using Reflection technique .
Actually i didnot include any jar in classpath but use only the JNDI name to resolve the jar
the code is :
Properties pros =new Properties();
props.put (Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");
props.put(Context.PROVIDER_URL,"sapsrv02:50200");
InitialContext context = new InitialContext(props);
But it shows Class Cast Exception in code :
EJBHome home = (EJBHome)PortableRemoteObject.narrow(obj,EJBHome.class);
Is it correct to give com.sap.engine.services.jndi.InitialContextFactoryImpl as parameter for Context.INITIAL_CONTEXT_FACTORY or should i give any other class parameter.
Can anyone please help me to resolve this problem.
Thanks in advance.
Regards,
Jude
Edited by: Jude Silvester on Feb 6, 2009 10:58 AM
Edited by: Jude Silvester on Feb 6, 2009 11:01 AM
Hi,
You need to add the jars from the following folder to your project class path .../usr/sap/J2E/JC00/j2ee/j2eeclient/
Ex: C:\usr\sap\CE1\ J00\j2ee\j2eeclient
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ayyapa,
I tried as you said and still the same error persists .. Is there any other way to call an ejb or
my doubt is on
Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl"
is it the correct class for naming factory or else we should use a class other than this
for eg:
CosNamingFactory...
like that is there any specific jar and Context factory class for Client.
Please help me to solve this problem.
Regards,
Jude
User | Count |
---|---|
90 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.