on 03-04-2007 8:25 PM
Hi all,
I am trying to obtain a jndi Context with the following method:
public static Context getInitialContext() throws javax.naming.NamingException {
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
props.put(Context.PROVIDER_URL, "localhost:50004");
Context jndiContext = new InitialContext(props);
return jndiContext;
}
When I execute the code from an external client I get the following exception:
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:657)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
...
Any ideas? Thanks,
Arne
Hi Arne,
Seems your client doesn't have the required jars on its classpath. You need the following: sapj2eeclient.jar, exception.jar, logging.jar from /usr/sap/<SID>/<instance>/j2ee/j2eeclient.
HTH!
-Vladimir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
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.