Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WAS 6.1.0.15 - ClassCastException getting the default initial context

56 views
Skip to first unread message

pde...@gmail.com

unread,
Mar 13, 2009, 12:22:35 AM3/13/09
to
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(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

0 new messages