Skip to Content
Former Member
Dec 20, 2007 at 01:06 PM

ClassNotFoundException when using InitialContextFactoryImpl


Dear Experts,

I'm trying to access an EJB which has been deployed on SAP J2EE Engine from a J2SE client by following the guide Link: [Accessing Enterprise JavaBeans Using JNDI in SAP NetWeaver Application Server|].

When the program lauch to Context ctx = new InitialContext(props);

A ClassNotFoundException is throw out.

I found the error is caused by the property entry:



So which JAR file contains the InitialContextFactoryImpl class? How can I solve this problem?

I copied my code as follow, hope you can help me.

   	Properties props = new Properties();
    	props.put(Context.PROVIDER_URL, "localhost:50004");
    	props.put(Context.SECURITY_PRINCIPAL, "administrator");
    	props.put(Context.SECURITY_CREDENTIALS, "abcd1234");
    		Context ctx = new InitialContext(props);
    		Object o = ctx.lookup(
    		cartRemote = (CartRemote) PortableRemoteObject.narrow(o, CartRemote.class);