cancel
Showing results for 
Search instead for 
Did you mean: 

NoInitialContextException

Former Member
0 Kudos

Hello,

We deployed an EJB with some "XYZ" jndi name on sap webas.

and we are able to execute client program from dos command with the following command

java -jar myprog.jar host 53804

But,when we try to run this same code with same jar files in unix,we are getting the following errors.

we are able to ping host from the unix also

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 com.client.MyProg.<init>(MyProg.java:38)

at com.client.MyProg.main(MyProg.java:47)

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)

... 5 more

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

maybe there are problems with "\com.xxx\xxx\xxx" --> slash / backslash issues on unix.

you may try "/xxx/xxx..." for getting the context by lookup command