1 2 3 Previous Next 36 Replies Latest reply on Feb 23, 2011 9:41 AM by slominskir

    JBoss 6M2: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5

    marcosaps
      Hello, everybody!

      I'm trying JBoss 6 M2 and I'm getting the following error when I try to execute my web application:

      2010-04-16 14:35:44,609 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/solicitacoes].[Faces Servlet]] (http-127.0.0.1-8080-1) Servlet.service() for servlet Faces Servlet threw exception: org.jboss.weld.exceptions.ForbiddenArgumentException: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
           at org.jboss.weld.servlet.ServletHelper.getModuleBeanManager(ServletHelper.java:44)
           at org.jboss.weld.servlet.BeanProvider.httpSessionManager(BeanProvider.java:51)
           at org.jboss.weld.jsf.WeldPhaseListener.initiateSessionAndConversation(WeldPhaseListener.java:167)
           at org.jboss.weld.jsf.WeldPhaseListener.beforeRestoreView(WeldPhaseListener.java:118)
           at org.jboss.weld.jsf.WeldPhaseListener.beforePhase(WeldPhaseListener.java:87)
           at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
           at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:336)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
           at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734)
           at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:541)
           at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479)
           at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407)
           at org.apache.catalina.authenticator.FormAuthenticator.forwardToLoginPage(FormAuthenticator.java:318)
           at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:243)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:559)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:872)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
           at java.lang.Thread.run(Thread.java:619)

      2010-04-16 14:35:44,609 WARN  [org.apache.catalina.authenticator.FormAuthenticator] (http-127.0.0.1-8080-1) Unexpected error forwarding to login page: javax.servlet.ServletException: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:325)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:336)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
           at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734)
           at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:541)
           at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479)
           at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407)
           at org.apache.catalina.authenticator.FormAuthenticator.forwardToLoginPage(FormAuthenticator.java:318)
           at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:243)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:559)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:872)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
           at java.lang.Thread.run(Thread.java:619)
      Caused by: org.jboss.weld.exceptions.ForbiddenArgumentException: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
           at org.jboss.weld.servlet.ServletHelper.getModuleBeanManager(ServletHelper.java:44)
           at org.jboss.weld.servlet.BeanProvider.httpSessionManager(BeanProvider.java:51)
           at org.jboss.weld.jsf.WeldPhaseListener.initiateSessionAndConversation(WeldPhaseListener.java:167)
           at org.jboss.weld.jsf.WeldPhaseListener.beforeRestoreView(WeldPhaseListener.java:118)
           at org.jboss.weld.jsf.WeldPhaseListener.beforePhase(WeldPhaseListener.java:87)
           at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
           at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
           ... 21 more

      I'm not using Seam. Just Weld. Below are the contents of the files of my simple application:

      *solicitacoes-web.war*
      META-INF/beans.xml
      META-INF/MANIFEST.MF
      modelos/layout.xhtml
      resources/css/
      resources/imagens/
      resources/script/
      WEB-INF/jboss-web.xml
      WEB-INF/web.xml
      WEB-INF/classes/br/urca/solicitacoes/web/Pagina.class
      WEB-INF/classes/br/urca/solicitacoes/web/jndi.properties
      errologin.xhtml
      login.xhtml
      novasolicitacao.xhtml

      *solicitacoes-ejb.jar*
      META-INF/beans.xml
      META-INF/MANIFEST.MF
      META-INF/persistence.xml
      br/urca/solicitacoes/ejb/LocalizadorSetores.class
      br/urca/solicitacoes/ejb/LocalizadorSetoresBean.class
      br/urca/solicitacoes/ejb/Utils.class
      br/urca/solicitacoes/ejb/seguranca/ModuloLogin$Login$Dados.class
      br/urca/solicitacoes/ejb/seguranca/ModuloLogin$Login$SenhaSituacao.class
      br/urca/solicitacoes/ejb/seguranca/ModuloLogin$Login$Login.class
      br/urca/solicitacoes/ejb/seguranca/ModuloLogin$Login$LoginFuncionario.class
      br/urca/solicitacoes/ejb/seguranca/ModuloLogin.class

      *solicitacoes-ejbClient.jar*
      META-INF/MANIFEST.MF
      br/urca/solicitacoes/AdministracaoFuncionario.class
      br/urca/solicitacoes/CategoriaFuncionario.class
      br/urca/solicitacoes/CodigoAdministracaoFuncionario.class
      br/urca/solicitacoes/CodigoPermissaoFuncionario.class
      br/urca/solicitacoes/CodigoSetor.class
      br/urca/solicitacoes/Funcionario.class
      br/urca/solicitacoes/ILocalizadorSetores.class
      br/urca/solicitacoes/PermissaoFuncionario.class
      br/urca/solicitacoes/Setor.class
      br/urca/solicitacoes/TipoPermissao.class
      br/urca/solicitacoes/TipoSolicitacao.class
      br/urca/solicitacoes/TipoUsuario.class

      Thank you in advance.

      Marcos
        • 1. Re: JBoss 6M2: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
          nickarls

          Sounds a bit strange since it's getting the BeanManager from a servlet context attribute which it sets itself. What version of Weld?

          • 2. Re: JBoss 6M2: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
            marcosaps

            Weld 1.0.1.CR1, the default version that comes with JBoss 6.0.0 M2. I really would like to get rid of this error.


            Marcos

            • 3. Re: JBoss 6M2: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
              nickarls

              What it you drop in the jsf-numberguess.war. Does it work?

              • 4. Re: JBoss 6M2: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
                marcosaps

                Nicklas Karlsson wrote on Apr 16, 2010 22:35:


                What it you drop in the jsf-numberguess.war. Does it work?



                Good guess. I haven't tried it yet. Unfortunately I've just got home and all my work is set up at work. I think I have to wait for Monday to try it out.


                Marcos

                • 5. Re: JBoss 6M2: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
                  napunapu

                  Curiously enough I got the same error today when I tried the @ConversationScoped for the first time on JBoss 6.0.0.M2 and Weld 1.0.1.Final.


                  Almost everything else I have tried so far has worked.


                  The code is extremely simple:


                  @ConversationScoped @Named
                  public class Conversationdemo {
                     @Inject private Conversation conversation;
                     private String data;
                     ...
                  

                  • 6. Re: JBoss 6M2: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
                    napunapu

                    My bad. It seems that forgetting implements Serializable wasn't a clever idea.

                    • 7. Re: JBoss 6M2: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
                      nickarls

                      Panu Korpela wrote on Apr 18, 2010 07:58:


                      My bad. It seems that forgetting implements Serializable wasn't a clever idea.


                      You got a BeanManager not found from missing a Serializable?

                      • 8. Re: JBoss 6M2: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
                        marcosaps
                        <blockquote>
                        _Marcos Antonio wrote on Apr 16, 2010 23:46:_<br/>

                        <blockquote>
                        _Nicklas Karlsson wrote on Apr 16, 2010 22:35:_<br/>

                        What it you drop in the jsf-numberguess.war. Does it work?

                        </blockquote>

                        Good guess. I haven't tried it yet. Unfortunately I've just got home and all my work is set up at work. I think I have to wait for Monday to try it out.

                        Marcos
                        </blockquote>

                        Hello, Hicklas. I moved the file beans.xml from the directory META-INF to WEB-INF and the error went away.

                        Now I'm getting this error when I call the page novasolicitacao.xhtml:

                        2010-04-19 11:18:31,203 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/solicitacoes].[Faces Servlet]] (http-127.0.0.1-8080-1) Servlet.service() for servlet Faces Servlet threw exception: java.lang.StackOverflowError
                             at org.apache.catalina.connector.ResponseFacade.addHeader(ResponseFacade.java:488)
                             at javax.servlet.http.HttpServletResponseWrapper.addHeader(HttpServletResponseWrapper.java:202)
                             at javax.servlet.http.HttpServletResponseWrapper.addHeader(HttpServletResponseWrapper.java:202)
                             at javax.servlet.http.HttpServletResponseWrapper.addHeader(HttpServletResponseWrapper.java:202)
                             at javax.servlet.http.HttpServletResponseWrapper.addHeader(HttpServletResponseWrapper.java:202)
                             at javax.servlet.http.HttpServletResponseWrapper.addHeader(HttpServletResponseWrapper.java:202)
                             at javax.servlet.http.HttpServletResponseWrapper.addHeader(HttpServletResponseWrapper.java:202)
                             at javax.servlet.http.HttpServletResponseWrapper.addHeader(HttpServletResponseWrapper.java:202)
                             at javax.servlet.http.HttpServletResponseWrapper.addHeader(HttpServletResponseWrapper.java:202)
                             at javax.servlet.http.HttpServletResponseWrapper.addHeader(HttpServletResponseWrapper.java:202)

                        ...

                        It's a very long stack overflow.

                        This is my web.xml:

                        <?xml version="1.0" encoding="UTF-8"?>
                        <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
                             <display-name>Solicitações</display-name>

                             <!-- ========== JSF ========== -->

                             <servlet>
                                  <servlet-name>Faces Servlet</servlet-name>
                                  <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                                  <load-on-startup>1</load-on-startup>
                             </servlet>

                             <servlet-mapping>
                                  <servlet-name>Faces Servlet</servlet-name>
                                  <url-pattern>*.xhtml</url-pattern>
                             </servlet-mapping>

                             <context-param>
                                  <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                                  <param-value>client</param-value>
                             </context-param>

                             <context-param>
                                  <param-name>javax.faces.PROJECT_STAGE</param-name>
                                  <param-value>Development</param-value>
                             </context-param>

                             <!-- ========== Página inicial ========== -->

                             <welcome-file-list>
                                  <welcome-file>novasolicitacao.xhtml</welcome-file>
                             </welcome-file-list>
                        </web-app>

                        And these are two web pages that I use:

                        novasolicitacao.xhtml:

                        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                        <html xmlns="http://www.w3.org/1999/xhtml"
                             xmlns:f="http://java.sun.com/jsf/core"
                             xmlns:h="http://java.sun.com/jsf/html"
                             xmlns:ui="http://java.sun.com/jsf/facelets">
                             <body>
                                  <ui:composition template="/modelos/layout.xhtml">
                                       <ui:define name="titulo">Nova Solicitação</ui:define>
                                       
                                       <ui:define name="conteudo">
                                            Conteúdo
                                            <!-- <h:outputText value="#{pagina.abc}" /> -->
                                       </ui:define>
                                  </ui:composition>
                             </body>
                        </html>

                        layout.xhtml:

                        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                        <html xmlns="http://www.w3.org/1999/xhtml"
                             xmlns:f="http://java.sun.com/jsf/core"
                             xmlns:h="http://java.sun.com/jsf/html"
                             xmlns:ui="http://java.sun.com/jsf/facelets">
                             <h:head>
                                  <title><ui:insert name="titulo" /></title>
                             </h:head>
                             <h:body>
                                  <h:form id="form">
                                       <ui:insert name="conteudo" />
                                       <h:inputHidden id="componenteFocalizado" />
                                  </h:form>
                             </h:body>
                        </html>

                        Do you have any idea about the cause of this error?

                        Marcos
                        • 9. Re: JBoss 6M2: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
                          marcosaps

                          The last problem that I showed (the StackOverflow erro) is also related to Weld. When I removed the beans.xml from my ejb jar and war file the application worked, the page requested was loaded correctly. One of my reasons to try Java EE 6 is to use CDI, so I would like to know what could be the problem here.


                          Thank you.


                          Marcos

                          • 10. Re: JBoss 6M2: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
                            marcosaps

                            Hey, listen to this: I kept doing tests and I placed a faces-config.xml file in my web application, along with the beans.xml files again and the application worked. Does Weld need to see a faces-config.xml file in order to work?


                            Marcos

                            • 11. Re: JBoss 6M2: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
                              nickarls

                              Actually, I think you have to have a faces-config.xml in order to hook on to the Weld EL resolver.

                              • 12. Re: JBoss 6M2: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
                                marcosaps
                                <blockquote>
                                _Nicklas Karlsson wrote on Apr 19, 2010 20:43:_<br/>

                                Actually, I think you have to have a faces-config.xml in order to hook on to the Weld EL resolver.
                                </blockquote>

                                Interesting you have pointed out about EL resolver, because the next issue that I'm seeing in just about that. This is my simple test web page:

                                <?xml version="1.0" encoding="ISO-8859-1" ?>
                                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                                <html xmlns="http://www.w3.org/1999/xhtml"
                                     xmlns:f="http://java.sun.com/jsf/core"
                                     xmlns:h="http://java.sun.com/jsf/html"
                                     xmlns:ui="http://java.sun.com/jsf/facelets">
                                     <body>
                                          <ui:composition template="/modelos/layout.xhtml">
                                               <ui:define name="titulo">Nova Solicitação</ui:define>
                                               
                                               <ui:define name="conteudo">
                                                    Conteúdo
                                                    <h:outputText value="#{pagina.abc}" />
                                               </ui:define>
                                          </ui:composition>
                                     </body>
                                </html>

                                and this is my simple test bean:

                                import javax.enterprise.context.RequestScoped;

                                @RequestScoped
                                public class Pagina
                                {
                                     public String getAbc()
                                     {
                                          return "abc";
                                     }
                                     
                                     public void setAbc(String abc)
                                     {
                                     }
                                }

                                When the page is shown, only the word "Conteúdo" appear, not the word "abc", even though it is referenced by an EL expression. Any ideas?

                                Marcos
                                • 13. Re: JBoss 6M2: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
                                  nickarls

                                  It must be @Named to be EL-exposed

                                  • 14. Re: JBoss 6M2: WELD-000702 Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacade@b8c4f5
                                    marcosaps

                                    Nicklas Karlsson wrote on Apr 19, 2010 20:58:


                                    It must be @Named to be EL-exposed


                                    Yes, I forgot that (long time I read the documentation about this). Now the application works fine. I think I can start doing something more interesting. Thank you for you help, Nicklas.


                                    Marcos

                                    1 2 3 Previous Next