Topic
  • 2 replies
  • Latest Post - ‏2009-04-06T14:43:54Z by SystemAdmin
SystemAdmin
SystemAdmin
3918 Posts

Pinned topic NamingManager.getURLContext cannot find the factory for this scheme: portal

‏2009-03-31T16:31:24Z |
Hi,

I am having issues getting back a WebContentService object using the below method in a servlet deployed into 6.1 WCM implementation. What is strange is that the same method works fine when used with in a jsp deployed as part of the same war. In the servelt this code is called as part of the servlet initializaiton.

Any thoughts on this would be appreciated.

thanks

try
{
// Construct and initialize Context
InitialContext ctx = new InitialContext();

// Retrieve WebContentService using JNDI name
webContentService = (WebContentService) ctx.lookup("portal:service/wcm/WebContentService");

if (webContentService==null){
System.out.println("createWorkspace() portal:service/wcm/WebContentService did not return a WebContentService object");
}
}
catch (NamingException ne)
{
System.out.println("webContentService to string: "+webContentService.toString());
System.out.println("Naming Exception: " + ne);
System.out.println("Naming Exception Cause: " +ne.getCause());
ne.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}

Here is the full stack.
3/27/09 15:05:20:120 EDT 0000001a SystemErr R javax.naming.ConfigurationException: NamingManager.getURLContext cannot find the factory for this scheme: portal
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.ibm.ws.naming.jndicos.CNContextImpl.checkForUrlContext(CNContextImpl.java:3290)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:165)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at javax.naming.InitialContext.lookup(InitialContext.java:363)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.recommind.wcmservlet.WCMConfigUtil.createWorkspace(WCMConfigUtil.java:125)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.recommind.wcmservlet.WCMConfigUtil.<init>(WCMConfigUtil.java:39)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.recommind.wcmservlet.WCMRMIServlet.init(WCMRMIServlet.java:103)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:226)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.init(ServletWrapper.java:320)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1305)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:153)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:99)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:887)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:809)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:527)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:364)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:292)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:92)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157)
3/27/09 15:05:20:121 EDT 0000001a SystemErr R at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:671)
3/27/09 15:05:20:122 EDT 0000001a SystemErr R at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:624)
3/27/09 15:05:20:122 EDT 0000001a SystemErr R at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:335)
3/27/09 15:05:20:122 EDT 0000001a SystemErr R at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:551)
3/27/09 15:05:20:122 EDT 0000001a SystemErr R at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1274)
3/27/09 15:05:20:122 EDT 0000001a SystemErr R at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1138)
3/27/09 15:05:20:122 EDT 0000001a SystemErr R at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:569)
3/27/09 15:05:20:122 EDT 0000001a SystemErr R at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:817)
3/27/09 15:05:20:122 EDT 0000001a SystemErr R at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:921)
3/27/09 15:05:20:122 EDT 0000001a SystemErr R at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2124)
3/27/09 15:05:20:122 EDT 0000001a SystemErr R at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:342)
3/27/09 15:05:20:122 EDT 0000001a SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
Updated on 2009-04-06T14:43:54Z at 2009-04-06T14:43:54Z by SystemAdmin
  • coolwolf
    coolwolf
    22 Posts

    Re: NamingManager.getURLContext cannot find the factory for this scheme: portal

    ‏2009-04-01T05:35:31Z  
    Check web application startup order number which your servlet is located in.
    Please set the number higher than wps.ear. The default of wps.ear is set to 10. You can set your web application startup number to 100 to make sure your application startup after wps.ear get started.

    You can go to WAS console. Nav to Applications->Enterprise Applications->your application-> startup order to change it.
  • SystemAdmin
    SystemAdmin
    3918 Posts

    Re: NamingManager.getURLContext cannot find the factory for this scheme: portal

    ‏2009-04-06T14:43:54Z  
    Thanks that resolved the issue.