dcsimg
Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rafal_Kulinski
Posted On:   Monday, June 10, 2002 01:04 PM

For some reason I can't instantiate object WsnInitialContextFactory in this call: ctx = new InitialContext(...); I'm converting existing app from WebSphere3.5 to WS4.0. Please help.... .............................. .............................. protected synchronized void cacheDataSource() { Context ctx = null; try { String name = getClass().getName(); logOut(name , ": beginning DataSource create ", "", ""); ctx = new InitialContext(dataSourceParms()); logOut(name , ": Creating Datasource-- DS=" , getDataSourceString(), ""); ds = (PortableDataSource) ctx.lookup(getDataSourceString()); if (ds == null) {ds = new Missing   More>>

For some reason I can't instantiate object WsnInitialContextFactory in this call: ctx = new InitialContext(...); I'm converting existing app from WebSphere3.5 to WS4.0. Please help....
..............................
..............................


protected synchronized void cacheDataSource() {
Context ctx = null;
try {
String name = getClass().getName();
logOut(name , ": beginning DataSource create ", "", "");
ctx = new InitialContext(dataSourceParms());
logOut(name , ": Creating Datasource-- DS=" , getDataSourceString(), "");
ds = (PortableDataSource) ctx.lookup(getDataSourceString());
if (ds == null) {ds = new MissingDataSource();}
logOut(name , ": Finished creation of DataSource object", "", "");
logOut(name , ": WebSphere: DataSource: " , getDataSource().toString(), "");
logOut(name, ": Data source attributes: ", getDataSource().getAttributes().toString() ,"");
}
catch (NamingException ex){
messageLog.writeLog(DashboardUtil.getTimeStamp(), ex);
}catch (Exception ex){
messageLog.writeLog(DashboardUtil.getTimeStamp(), ex);
} finally {
closeContext(ctx);
}
}


protected Hashtable dataSourceParms() {

Hashtable parms = new Hashtable();
parms.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");

return parms;

}

..............................
..............................

EXCEPTION:

Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory
javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory. Root exception is java.lang.ClassCastException: com.ibm.websphere.naming.WsnInitialContextFactory
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:202)
at com.dcx.HRTS.dashboard.database.DashboardWebSphereConnect.cacheDataSource(DashboardWebSphereConnect.java)
at com.dcx.HRTS.dashboard.database.DashboardWebSphereConnect.getDataSource(DashboardWebSphereConnect.java)
at com.dcx.HRTS.dashboard.database.DashboardWebSphereConnect.privateGetConnection(DashboardWebSphereConnect.java)
at com.dcx.HRTS.dashboard.database.DashboardWebSphereConnect.getConnection(DashboardWebSphereConnect.java)
at com.dcx.HRTS.dashboard.database.DashboardWebSphereConnect.getConnection(DashboardWebSphereConnect.java)
at com.dcx.HRTS.dashboard.database.DashboardDataBase.getConnection(DashboardDataBase.java)
at com.dcx.HRTS.dashboard.workerbeans.SelfServiceProfileWorkerBean.processRequest(SelfServiceProfileWorkerBean.java)
at com.dcx.HRTS.dashboard.navigation.DashboardNavigationController.processRequest(DashboardNavigationController.java)
at com.dcx.HRTS.dashboard.servlet.DashboardMediatorServlet.getUrl(DashboardMediatorServlet.java)
at com.dcx.HRTS.dashboard.servlet.DashboardMediatorServlet.doTask(DashboardMediatorServlet.java)
at com.dcx.HRTS.dashboard.servlet.DashboardMediatorServlet.performTask(DashboardMediatorServlet.java)
at com.dcx.HRTS.dashboard.servlet.DashboardBaseServlet.doPost(DashboardBaseServlet.java)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:167)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:297)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:110)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:665)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:331)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:117)
at com.dcx.HRTS.dashboard.servlet.DashboardBaseServlet.forward(DashboardBaseServlet.java)
at com.dcx.HRTS.dashboard.servlet.WebSphereEnvironment.mediatorForward(WebSphereEnvironment.java)
at com.dcx.HRTS.dashboard.servlet.WebSphereEnvironment.mediatorForward(WebSphereEnvironment.java)
at com.dcx.HRTS.dashboard.servlet.DashboardBaseServlet.mediatorForward(DashboardBaseServlet.java)
at com.dcx.HRTS.dashboard.servlet.LogonServlet.doTask(LogonServlet.java)
at com.dcx.HRTS.dashboard.servlet.DashboardBaseServlet.performTask(DashboardBaseServlet.java)
at com.dcx.HRTS.dashboard.servlet.DashboardBaseServlet.doPost(DashboardBaseServlet.java)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:167)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:297)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:110)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:665)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:331)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:117)
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:124)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:218)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:122)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315)
at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:323)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:252)

   <<Less
About | Sitemap | Contact