1 Reply Latest reply on Apr 5, 2012 6:46 PM by Jason Porter

    seam-faces -> java.lang.IllegalStateException: Could not wrap ExternalContext

    Franck Garcia Newbie

      Hi,

       

      I tried to configure a "page not found" default page in my ear application. I have this xml element in web.xml:

       


      <error-page>

      <error-code>404</error-code>

      <location>/notFound.jsp</location>

      </error-page>

       

      The jsp forward then to a jsf (2.0) page.

       

      However when I query a non existing page I've got the following error:

       

      java.lang.IllegalStateException: Could not wrap ExternalContext
          at org.jboss.seam.faces.environment.SeamExternalContextFactory.getExternalContext(SeamExternalContextFactory.java:47) [seam-faces-3.1.0.Final.jar:]
          at com.sun.faces.context.FacesContextFactoryImpl.getFacesContext(FacesContextFactoryImpl.java:93) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
          at org.richfaces.context.FileUploadFacesContextFactory.getFacesContext(FileUploadFacesContextFactory.java:143) [richfaces-components-ui-4.2.0.CR1.jar:]
          at com.sun.faces.context.InjectionFacesContextFactory.getFacesContext(InjectionFacesContextFactory.java:121) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:583) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:126) [prettyfaces-jsf2-3.3.2.jar:]
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:543) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:706) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:677) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.jsp.notFound_jsp._jspService(notFound_jsp.java:60)
          at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.jasper.servlet.JspServlet._serviceJspFile(JspServlet.java:326) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:126) [prettyfaces-jsf2-3.3.2.jar:]
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:543) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:528) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:454) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
          at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]
      Caused by: org.jboss.solder.beanManager.BeanManagerUnavailableException: Failed to locate BeanManager using any of these providers: org.jboss.solder.servlet.beanManager.ServletContextAttributeProvider(20), org.jboss.solder.beanManager.DefaultJndiBeanManagerProvider(11), org.jboss.solder.beanManager.ServletContainerJndiBeanManagerProvider(10)
          at org.jboss.solder.beanManager.BeanManagerLocator.getBeanManager(BeanManagerLocator.java:88) [solder-api-3.1.0.Final.jar:]
          at org.jboss.seam.faces.environment.SeamExternalContextFactory.getExternalContext(SeamExternalContextFactory.java:39) [seam-faces-3.1.0.Final.jar:]
          ... 42 more
      

       

      It seems that the instance behind java:comp/BeanManager jndi name is not bound anymore when the error page is processed. Any help is appreciated. Thanks,