I have to port a web application from AIX to windows server, but it throws exception like his on the newly installed IBM WebSphere Community Edition in windows like this:
javax.servlet.ServletException: javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory in classloader...
Tracing the code and nailed down to be caused by this code:
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
Context jdbcCtx = new InitialContext(env);
The AIX Websphere is the full WebSphere Application Server while the windows one is Community Edition. I’m not sure what differences if any.
Can anyone help to to fix that? Thanks!
The WebSphere Application Server Community Edition isn’t a real WebSphere application server. Its a “pimped” Apache Geronimo.
I wouldn’t count on seeing any IBM classes in the Community Edition that where present in your AIX WebSphere.
I guess your options are:
Check the WAS edition comparison.