Announcement Announcement Module
Collapse
No announcement yet.
Shared parent context used within a JSF webapp Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Shared parent context used within a JSF webapp

    On pages 416-419 of "Professional Java Development with the Spring Framework", the authors describe an extension to the Spring ContextLoader that will use a ContextSingletonBeanFactoryLocator to load a shared context that can be used from both the webapp(s) and EJB(s). A specialized ContextLoaderListener is then defined to using this new specialized ContextLoader implementation. Finally, the web.xml is modified to use the new ContextLoaderListener and pass it the two init parameters.

    I've used this solution in an application that I'm working on that happens to use JSF. When I hit a JSF page, the page bombs out with the following:

    Error Message: javax.faces.el.EvaluationException: java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
    Error Code: 500
    Target Servlet: null
    Error Stack:
    javax.servlet.jsp.JspException: javax.faces.el.EvaluationException: java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
    at com.sun.faces.taglib.html_basic.PanelGridTag.doEnd Tag(PanelGridTag.java:470)
    at org.apache.jsp._header._jspService(_header.java:66 8)
    at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.se rvice(HttpJspBase.java:89)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$Jsp ServletWrapper.service(JspServlet.java:344)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.ser viceJspFile(JspServlet.java:669)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.ser vice(JspServlet.java:767)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
    at com.ibm.ws.webcontainer.servlet.StrictServletInsta nce.doService(StrictServletInstance.java:110)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet._service(StrictLifecycleServlet.java:174)
    at com.ibm.ws.webcontainer.servlet.ServicingServletSt ate.service(StrictLifecycleServlet.java:333)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet.service(StrictLifecycleServlet.java:116)
    at com.ibm.ws.webcontainer.servlet.ServletInstance.se rvice(ServletInstance.java:283)
    at com.ibm.ws.webcontainer.servlet.ValidServletRefere nceState.dispatch(ValidServletReferenceState.java: 42)
    at com.ibm.ws.webcontainer.servlet.ServletInstanceRef erence.dispatch(ServletInstanceReference.java:40)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.handleWebAppDispatch(WebAppRequestDispatcher. java:978)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.dispatch(WebAppRequestDispatcher.java:564)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.include(WebAppRequestDispatcher.java:253)
    at org.apache.jasper.runtime.JspRuntimeLibrary.includ e(JspRuntimeLibrary.java:991)
    at org.apache.jsp._home._jspService(_home.java:252)
    at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.se rvice(HttpJspBase.java:89)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$Jsp ServletWrapper.service(JspServlet.java:344)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.ser viceJspFile(JspServlet.java:669)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.ser vice(JspServlet.java:767)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
    at com.ibm.ws.webcontainer.servlet.StrictServletInsta nce.doService(StrictServletInstance.java:110)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet._service(StrictLifecycleServlet.java:174)
    at com.ibm.ws.webcontainer.servlet.IdleServletState.s ervice(StrictLifecycleServlet.java:313)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet.service(StrictLifecycleServlet.java:116)
    at com.ibm.ws.webcontainer.servlet.ServletInstance.se rvice(ServletInstance.java:283)
    at com.ibm.ws.webcontainer.servlet.ValidServletRefere nceState.dispatch(ValidServletReferenceState.java: 42)
    at com.ibm.ws.webcontainer.servlet.ServletInstanceRef erence.dispatch(ServletInstanceReference.java:40)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.handleWebAppDispatch(WebAppRequestDispatcher. java:978)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.dispatch(WebAppRequestDispatcher.java:564)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.forward(WebAppRequestDispatcher.java:200)
    at com.ibm.faces.context.MultipartExternalContextImpl .dispatch(MultipartExternalContextImpl.java:320)
    at com.sun.faces.application.ViewHandlerImpl.renderVi ew(ViewHandlerImpl.java:130)
    at com.sun.faces.lifecycle.RenderResponsePhase.execut e(RenderResponsePhase.java:87)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(Lifecy cleImpl.java:200)
    at com.sun.faces.lifecycle.LifecycleImpl.render(Lifec ycleImpl.java:117)
    at javax.faces.webapp.FacesServlet.service(FacesServl et.java:198)
    at com.ibm.ws.webcontainer.servlet.StrictServletInsta nce.doService(StrictServletInstance.java:110)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet._service(StrictLifecycleServlet.java:174)
    at com.ibm.ws.webcontainer.servlet.IdleServletState.s ervice(StrictLifecycleServlet.java:313)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet.service(StrictLifecycleServlet.java:116)
    at com.ibm.ws.webcontainer.servlet.ServletInstance.se rvice(ServletInstance.java:283)
    at com.ibm.ws.webcontainer.servlet.ValidServletRefere nceState.dispatch(ValidServletReferenceState.java: 42)
    at com.ibm.ws.webcontainer.servlet.ServletInstanceRef erence.dispatch(ServletInstanceReference.java:40)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:76)
    at org.apache.myfaces.component.html.util.ExtensionsF ilter.doFilter(ExtensionsFilter.java:122)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapp er.doFilter(FilterInstanceWrapper.java:132)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:71)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.handleWebAppDispatch(WebAppRequestDispatcher. java:974)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.dispatch(WebAppRequestDispatcher.java:564)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.forward(WebAppRequestDispatcher.java:200)
    at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForwar d(WebAppInvoker.java:119)
    at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleIn vocationHook(WebAppInvoker.java:276)
    at com.ibm.ws.webcontainer.cache.invocation.CachedInv ocation.handleInvocation(CachedInvocation.java:71)
    at com.ibm.ws.webcontainer.srp.ServletRequestProcesso r.dispatchByURI(ServletRequestProcessor.java:182)
    at com.ibm.ws.webcontainer.oselistener.OSEListenerDis patcher.service(OSEListener.java:334)
    at com.ibm.ws.webcontainer.http.HttpConnection.handle Request(HttpConnection.java:56)
    at com.ibm.ws.http.HttpConnection.readAndHandleReques t(HttpConnection.java:618)
    at com.ibm.ws.http.HttpConnection.run(HttpConnection. java:443)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:672)


    The ContextLoaderListener is indeed registered in the web.xml. Is there some issues with using this shared parent context mechanism within a JSF application? Is this solved in the JSF-Spring integration project on SourceForge? BTW, I'm using Spring 2.0 M3 on WebSphere 5.1 with the MyFaces JSF implementation.

    Regards,

    -- chris --
Working...
X