on 04-11-2005 11:54 AM - last edited on 02-04-2024 5:14 AM by postmig_api_4
Initial Context Factory
Posted: Apr 11, 2005 6:49 AM Reply E-mail this post
Hi
I am trying to develop a EJB Project and trying to call the EAR depployed on the server using JNDI.
I am writing the code using Java Client
Can i have the name of Initial Context Factory for WAS 6.40.
Its Urgent
With Wishes
Krishna kanth
com.sap.engine.services.jndi.InitialContextFactoryImpl
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I am writing the following Code
My EAR is already deployed on the J2ee
This is my client code
Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");
try{
Context ctx = new InitialContext(prop);
Object obj = ctx.lookup("MyStatelessprojectHome");
MyStatelessprojectHome home = (MyStatelessprojectHome)PortableRemoteObject.narrow(obj,com.satyam.first.MyStatelessprojectHome.class);
MyStatelessproject test = home.create();
System.out.println(test.helloworld());
}catch(Exception e)
{
}
i am getting the following Error
javax.naming.NoInitialContextException: Cannot instantiate class: com.sap.engine.services.jndi.InitialContextFactoryImpl [Root exception is java.lang.ClassNotFoundException: com.sap.engine.services.jndi.InitialContextFactoryImpl]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:652)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at satyam.sap.ClientTest.main(ClientTest.java:32)
Caused by: java.lang.ClassNotFoundException: com.sap.engine.services.jndi.InitialContextFactoryImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
... 4 more
Hashtable ht=new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");
ht.put(Context.PROVIDER_URL,"myserver:50004");
Context ctx=new InitialContext(ht);
TestEjbHome myHome = (TestEjbHome)ctx.lookup("SimpleEjb/testJndi");
TestEjb local=myHome.create();
int d=local.add(10,20);
This is how i did and it works
check if ctx is null or not.
TestEjb is the name of my ejb
This might help:
For NW04 and NW04s:
sapj2eeclient.jar
exception.jar
logging.jar
For SAP NetWeaver Application Server, Java EE 5 Edition:
sap.comtcjeclientlibimpl.jar
sap.comtcexception~impl.jar
sap.comtcloggingjavaimpl.jar
You may find these jars from your NetWeaver installation at:
\usr\sap\<sid>\<instanceid>\j2ee\j2eeclient
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This might help:
For NW04 and NW04s:
sapj2eeclient.jar
exception.jar
logging.jar
For SAP NetWeaver Application Server, Java EE 5 Edition:
sap.comtcjeclientlibimpl.jar
sap.comtcexception~impl.jar
sap.comtcloggingjavaimpl.jar
You may find these jars from your NetWeaver installation at:
\usr\sap\<sid>\<instanceid>\j2ee\j2eeclient
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.