9 Replies Latest reply on Apr 12, 2010 12:31 PM by Pete Muir

    Tomcat 6 + JSF 1.2 + Facelets + Weld 1.0 => How?

    Sergio Samayoa Newbie
      "Me estoy volviendo mono, no logro enteder!!"

      I'm trying to run a very simple Tomcat 6 + JSF 1.2 + Facelets + Weld 1.0 but cant!!

      I've already create context.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <Context>
           <Resource name="BeanManager" auth="Container"
                type="javax.enterprise.inject.spi.BeanManager" factory="org.jboss.weld.resources.ManagerObjectFactory" />
      </Context>

      Chage web.xml:

           <!-- WELD -->
           <listener>
                <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
           </listener>
           <resource-env-ref>
                <resource-env-ref-name>BeanManager</resource-env-ref-name>
                <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
           </resource-env-ref>

      And put the phase listener in faces-config.xml:

           <lifecycle>
                <phase-listener>org.jboss.weld.jsf.WeldPhaseListener</phase-listener>
           </lifecycle>

      Put empry beans.xml in WEB-INF

      But when I try to access request scoped I go this:

      ADVERTENCIA: JSF1053: (Listener: org.jboss.weld.jsf.WeldPhaseListener.afterPhase(), Phase ID: RENDER_RESPONSE 6,  View ID: /Uno.xhtml) Exception thrown during phase-listener execution: org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type @ConversationScoped
      17/03/2010 02:19:27 PM com.sun.faces.lifecycle.Phase handleAfterPhase

      Documentation says:

      If you are integrating Weld into a JSF environment you must register
      org.jboss.weld.el.WeldELContextListener as an EL Context listener.

      If you are integrating Weld into a JSF environment you must register
      org.jboss.weld.jsf.ConversationAwareViewHandler as a delegating view handler

      But where the h... I register the EL Context listener!
      Also, ConversationAwareViewHandler!

      By code?

      Please give me some hints