6 Replies Latest reply on Mar 2, 2012 4:34 PM by kenfinni

    Weld not activated for portlets?

    nickarls

      Hi,

       

        I'm using the latest JBoss AS 7.1.0.Final based GateIn and I'm having problems accessing CDI components (JSF + facelets using the JBoss 3.0.0.Beta1 bridge). When I deploy my portlet using the jboss-as:deploy mvn plugin I see the

       

       

      JBAS016002: Processing weld deployment portlet-palvelimet-1.0.0-SNAPSHOT.war

      JBAS016005: Starting Services for CDI deployment: portlet-palvelimet-1.0.0-SNAPSHOT.war

      JBAS016008: Starting weld service for deployment portlet-palvelimet-1.0.0-SNAPSHOT.war

      Init GenericFacesPortlet for portlet WebMarela-palvelimet

      Bridge class name is org.jboss.portletbridge.AjaxPortletBridge

      Init GenericFacesPortlet for portlet WebMarela-palvelimet

      Bridge class name is org.jboss.portletbridge.AjaxPortletBridge

      Initializing Mojarra 2.1.5 (SNAPSHOT 20111202) for context '/portlet-palvelimet-1.0.0-SNAPSHOT'

      JBAS018210: Registering web context: /portlet-palvelimet-1.0.0-SNAPSHOT

      JBAS018559: Deployed "portlet-palvelimet-1.0.0-SNAPSHOT.war"

       

       

      (but no WELD boot messages)

       

      and my JSF page displays hardcoded stuff but EL doesn't go to Weld (I can't access CDI beans from the view). I have the beans.xml in place.

        • 1. Re: Weld not activated for portlets?
          nickarls

          Is CDI even supposed to work in the AS7-branch? I used the sandbox/as7_support/tags/AS7-Beta03 but then I noticed that sandbox has a cdi_support branch, those are not merged, are they?

          • 2. Re: Weld not activated for portlets?
            mstruk

            CDI support branch in sandbox is a prototype of CDI support in portlets. It only covers portlets not any bridge technologies. It also is primarily an exploration of what GateIn services to make available for injection, and how to target specific gatein kernel containers.

             

            It has not yet been integrated into trunk, and hasn't been brought up to date with the trunk for quite a while.

             

            So in short, currently GateIn doesn't provide CDI injection in portlets. And JBoss Portlet Bridge doesn't have any special support for CDI either ATM (meaning it does not provide any custom CDI extension, or API of injectable types to support generic Portlet environment, and specific GateIn environment).

             

            But, if a .war contains beans.xml, AS7 Weld subsystem should kick in and do its thing. Are you sure your beans.xml is in the right place? Otherwise maybe JPB inadvertently somehow breaks the default functioning of CDI ?

            • 3. Re: Weld not activated for portlets?
              nickarls

              Pretty sure beans.xml is in the right place (and the log shows Weld service being started which probably wouldn't happen without the beans.xml)

              • 4. Re: Weld not activated for portlets?
                mstruk

                Try debug it to see what's going on

                • 5. Re: Weld not activated for portlets?
                  nickarls

                  Yes but between the deployers in AS7, gatein code and bridge code there are lots of places where stuff can (and won't) happen...

                  • 6. Re: Weld not activated for portlets?
                    kenfinni

                    Nicklas,

                     

                    Hopefully next week I'll be more focused on PBR 3.x and will be able to verify whether this works or not!

                     

                    Ken