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(NamingManager.java:659)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:250)
at javax.naming.InitialContext.init(InitialContext.java:226)
at javax.naming.InitialContext.(InitialContext.java:182)
..
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?
Thanks