Hi All,

I am getting following exception when trying to get a default initial context:

javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory. Root exception is java.lang.ClassCastException: com.ibm.websphere.naming.WsnInitialContextFactory incompatible with javax.naming.spi.InitialContextFactory
at javax.naming.spi.NamingManager.getInitialContext(N amingManager.java:659)
at javax.naming.InitialContext.getDefaultInitCtx(Init ialContext.java:250)
at javax.naming.InitialContext.init(InitialContext.ja va:226)
at javax.naming.InitialContext.(InitialContext.java:1 82)

I have a utility class that is trying to get the initial context so that it can look up a datasource. This class is being called from a servlet. The exception happens at the line:

InitialContext initialContext = new InitialContext();

This code works in Websphere on Windows, but throws above exception in Websphere on AIX.

What can be causing this problem?