11 Replies Latest reply on Nov 28, 2012 2:54 AM by Patrick Verboom

    Gatein 3.4 jboss7.1.1-Final jsf2 portlet

    Patrick Verboom Newbie

      Hi,

       

      I am trying to get a jsf portlet working on a standard downloaded  GateIn-3.4.0.Final-jbossas7.zip

      The application server is running on java 7.

       

      I have downloaded the examples from:

      https://github.com/jbossportletbridge/jbossportletbridge/tree/master/examples

       

      The examples are build with java 7 with maven 3. The war file that is generated looks fine.

       

      When I deploy that war file into the gatein/deployments directory than it throws the excepion shown below duing startup.

      Does anybody have an idea why this is happening? Does anybody have a working example?

       

      org.jboss.portletbridge.lifecycle.PortalPhaseListener implements the javax.faces.event.PhaseListener.

      I can only assume that it must be a classloading issue.

       

       

      17:01:21,562 INFO  [org.exoplatform.portal.application.ResourceRequestFilter] (MSC service thread 1-3) Cache eXo Resource at client: false

      17:01:21,562 INFO  [org.jboss.web] (MSC service thread 1-3) JBAS018210: Registering web context: /web

      17:01:21,578 INFO  [org.exoplatform.portal.application.ResourceRequestFilter] (MSC service thread 1-3) Cache eXo Resource at client: false

      17:01:21,656 INFO  [org.jboss.web] (MSC service thread 1-3) JBAS018210: Registering web context: /dashboard

      17:01:21,859 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/wsrp-admin-gui]] (MSC service thread 1-4) Exception sending context init

      ialized event to listener instance of class com.sun.faces.config.ConfigureListener: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED!

        Source Document: vfs:/C:/java/jboss-as-7.1.1.Final-GateIn-3.4.0.Final/gatein/deployments/gatein-wsrp-integration.ear/wsrp-admin-gui.war/WEB-INF/lib/portletbri

      dge-impl-2.3.0.Final.jar/META-INF/faces-config.xml

        Cause: Class 'org.jboss.portletbridge.lifecycle.PortalPhaseListener' is not an instance of 'interface javax.faces.event.PhaseListener'

              at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:215) [jsf-impl-1.2_15-jbossorg-2.jar:1.2_15.jbossorg-1-20111019-SNAPSHOT]

              at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:200) [jsf-impl-1.2_15-jbossorg-2.jar:1.2_15.jbossorg-1-20111019-SNAP

      SHOT]

              at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.10.Final.jar:]

              at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.10.Final.jar:]

              at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.0.Final.jar:7.1.0.Final]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_05]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]

              at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]

      Caused by: com.sun.faces.config.ConfigurationException:

        Source Document: vfs:/C:/java/jboss-as-7.1.1.Final-GateIn-3.4.0.Final/gatein/deployments/gatein-wsrp-integration.ear/wsrp-admin-gui.war/WEB-INF/lib/portletbri

      dge-impl-2.3.0.Final.jar/META-INF/faces-config.xml

        Cause: Class 'org.jboss.portletbridge.lifecycle.PortalPhaseListener' is not an instance of 'interface javax.faces.event.PhaseListener'

              at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:259) [jsf-impl-1.2_15-jbossorg-2.jar:1.2_15.jbosso

      rg-1-20111019-SNAPSHOT]

              at com.sun.faces.config.processor.LifecycleConfigProcessor.addPhaseListeners(LifecycleConfigProcessor.java:142) [jsf-impl-1.2_15-jbossorg-2.jar:1.2_15.j

      bossorg-1-20111019-SNAPSHOT]

              at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:115) [jsf-impl-1.2_15-jbossorg-2.jar:1.2_15.jbossorg-1-

      20111019-SNAPSHOT]

              at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:108) [jsf-impl-1.2_15-jbossorg-2.jar:1.2_15.jbossorg-1

      -20111019-SNAPSHOT]

              at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:133) [jsf-impl-1.2_15-jbossorg-2.jar:1.2_15.jbossorg-1-2011

      1019-SNAPSHOT]

              at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:205) [jsf-impl-1.2_15-jbossorg-2.jar:1.2_15.jbossorg-1-20111019-SNAPSHOT]

              ... 9 more

       

      17:01:22,312 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-4) Error listenerStart

      17:01:22,312 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-4) Context [/wsrp-admin-gui] startup failed due to previous errors

      17:01:22,312 INFO  [org.hibernate.validator.util.Version] (MSC service thread 1-2) Hibernate Validator 4.2.0.Final

      17:01:22,312 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.web.deployment.default-host./wsrp-admin-gui: or

      g.jboss.msc.service.StartException in service jboss.web.deployment.default-host./wsrp-admin-gui: JBAS018040: Failed to start context

              at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_05]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]

              at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]

       

      17:01:22,390 WARNING [javax.enterprise.resource.webcontainer.jsf.managedbean] (MSC service thread 1-2) JSF1074: Managed bean named 'echo' has already been regis

      tered.  Replacing existing managed bean class type basicajax.Echo with basicajax.Echo.

      17:01:22,468 INFO  [org.exoplatform.portal.application.ResourceRequestFilter] (MSC service thread 1-4) Cache eXo Resource at client: false

        • 1. Re: Gatein 3.4 jboss7.1.1-Final jsf2 portlet
          Ken Finnigan Master

          Patrick,

           

          Did you add any config to the built war or add JSF libs to the WEB-INF/lib?

           

          From the stacktrace I can see it's trying to use JSF 1.2 for the WAR, but Portlet Bridge 3 is only supported on JSF 2 and above.

           

          Ken

          • 2. Re: Gatein 3.4 jboss7.1.1-Final jsf2 portlet
            Patrick Verboom Newbie

            Hi Ken,

             

            Thank you for the fast reply.

            The lib directory contains two jar files:

            portletbridge-api-3.2.0.Final-SNAPSHOT.jar

            portletbridge-impl-3.2.0.Final-SNAPSHOT.jar

             

            I have no specific JSF libraries in the lib directory.

            I have added a bigger part from the log file below. as you can see it is initializing the Mojarra 1.2_15 for /wsrp-admin-gui and a little lower it is initializing Morarra 2.1.5 for /jsf2portlet. So that looks fine.

            The following lines than show the exception:

            17:56:00,421 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/wsrp-admin-gui]] (MSC service thread 1-2) Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED!

              Source Document: vfs:/C:/java/jboss-as-7.1.1.Final-GateIn-3.4.0.Final/gatein/deployments/gatein-wsrp-integration.ear/wsrp-admin-gui.war/WEB-INF/lib/portletbridge-impl-2.3.0.Final.jar/META-INF/faces-config.xml

              Cause: Class 'org.jboss.portletbridge.lifecycle.PortalPhaseListener' is not an instance of 'interface javax.faces.event.PhaseListener'

             

            The thing that confuses me is that it is throwing an exception on the  /wsrp-admin-gui.war. When I start the server without the /jsf2portlet war than it starts fine. From my understanding it are two seperate artifacts with there own classloader but somehow the new war files influence the existing  gatein-wsrp-integration.ear/wsrp-admin-gui.war.

             

            For full reference I have attached the full log file and the jsf2portlet.war.

             

            17:55:59,187 INFO  [org.jboss.web] (MSC service thread 1-3) JBAS018210: Registering web context: /eXoResources

            17:55:59,203 INFO  [org.jboss.web] (MSC service thread 1-2) JBAS018210: Registering web context: /gwtGadgets

            17:55:59,218 INFO  [org.jboss.web] (MSC service thread 1-3) JBAS018210: Registering web context: /redirect-portlet

            17:55:59,265 WARN  [org.jboss.web] (MSC service thread 1-3) JBAS018204: Clustering not supported, falling back to non-clustered session manager

            17:55:59,265 WARN  [org.jboss.web] (MSC service thread 1-2) JBAS018204: Clustering not supported, falling back to non-clustered session manager

            17:55:59,375 INFO  [org.exoplatform.portal.application.ResourceRequestFilter] (MSC service thread 1-3) Cache eXo Resource at client: false

            17:55:59,453 INFO  [org.jboss.web] (MSC service thread 1-3) JBAS018210: Registering web context: /portal

            17:55:59,796 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-2) Initializing Mojarra (1.2_15.jbossorg-1-20111019-SNAPSHOT) for context '/wsrp-admin-gui'

            17:55:59,812 INFO  [org.exoplatform.portal.application.ResourceRequestFilter] (MSC service thread 1-3) Cache eXo Resource at client: false

            17:55:59,812 INFO  [org.jboss.web] (MSC service thread 1-3) JBAS018210: Registering web context: /sample-ext

            17:55:59,843 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-3) Initializing Mojarra 2.1.5 (SNAPSHOT 20111202) for context '/jsf2portlet'

            17:56:00,250 INFO  [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-1) Creating Service {urn:oasis:names:tc:wsrp:v1:wsdl}WSRPService from WSDL: /WEB-INF/wsdl/wsrp_services.wsdl

            17:56:00,421 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/wsrp-admin-gui]] (MSC service thread 1-2) Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED!

              Source Document: vfs:/C:/java/jboss-as-7.1.1.Final-GateIn-3.4.0.Final/gatein/deployments/gatein-wsrp-integration.ear/wsrp-admin-gui.war/WEB-INF/lib/portletbridge-impl-2.3.0.Final.jar/META-INF/faces-config.xml

              Cause: Class 'org.jboss.portletbridge.lifecycle.PortalPhaseListener' is not an instance of 'interface javax.faces.event.PhaseListener'

            at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:215) [jsf-impl-1.2_15-jbossorg-2.jar:1.2_15.jbossorg-1-20111019-SNAPSHOT]

            at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:200) [jsf-impl-1.2_15-jbossorg-2.jar:1.2_15.jbossorg-1-20111019-SNAPSHOT]

            at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.10.Final.jar:]

            at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.10.Final.jar:]

            at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.0.Final.jar:7.1.0.Final]

            at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

            at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_05]

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]

            at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]

            Caused by: com.sun.faces.config.ConfigurationException:

              Source Document: vfs:/C:/java/jboss-as-7.1.1.Final-GateIn-3.4.0.Final/gatein/deployments/gatein-wsrp-integration.ear/wsrp-admin-gui.war/WEB-INF/lib/portletbridge-impl-2.3.0.Final.jar/META-INF/faces-config.xml

              Cause: Class 'org.jboss.portletbridge.lifecycle.PortalPhaseListener' is not an instance of 'interface javax.faces.event.PhaseListener'

            at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:259) [jsf-impl-1.2_15-jbossorg-2.jar:1.2_15.jbossorg-1-20111019-SNAPSHOT]

            at com.sun.faces.config.processor.LifecycleConfigProcessor.addPhaseListeners(LifecycleConfigProcessor.java:142) [jsf-impl-1.2_15-jbossorg-2.jar:1.2_15.jbossorg-1-20111019-SNAPSHOT]

            at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:115) [jsf-impl-1.2_15-jbossorg-2.jar:1.2_15.jbossorg-1-20111019-SNAPSHOT]

            at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:108) [jsf-impl-1.2_15-jbossorg-2.jar:1.2_15.jbossorg-1-20111019-SNAPSHOT]

            at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:133) [jsf-impl-1.2_15-jbossorg-2.jar:1.2_15.jbossorg-1-20111019-SNAPSHOT]

            at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:205) [jsf-impl-1.2_15-jbossorg-2.jar:1.2_15.jbossorg-1-20111019-SNAPSHOT]

            ... 9 more

             

            17:56:00,453 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Error listenerStart

            17:56:00,453 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Context [/wsrp-admin-gui] startup failed due to previous errors

            17:56:00,453 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.web.deployment.default-host./wsrp-admin-gui: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./wsrp-admin-gui: JBAS018040: Failed to start context

            at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95)

            at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

            at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_05]

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]

            at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]

             

            17:56:00,781 INFO  [org.exoplatform.portal.gadget.core.GateInJsonContainerConfig] (MSC service thread 1-4) Loading resources from: containers/default/container.js

            17:56:00,781 INFO  [org.exoplatform.portal.gadget.core.GateInJsonContainerConfig] (MSC service thread 1-4) Reading container config: containers/default/container.js

            • 3. Re: Gatein 3.4 jboss7.1.1-Final jsf2 portlet
              Ken Finnigan Master

              And these errors with wsrp-admin at startup don't happen when jsf2portlet is not deployed?  That's very weird.

               

              Can you try upgrading to 3.5.0.Beta2 to see if you have the same problem?

              • 4. Re: Gatein 3.4 jboss7.1.1-Final jsf2 portlet
                Patrick Verboom Newbie

                I have installed a Gatein 3.5.0.Beta02-jbossas7. Installed the same jsf2portlet.war in the extensions directory and there is deploys without startup problems.

                There I also notice that both war's (/wsrp-admin-gui and /jsf2portlet) use the same JSF implementation.

                 

                13:04:26,640 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-3) Initializing Mojarra 2.1.7-jbossorg-1 (20120227-1401) for context '/jsf2portlet'

                13:04:26,640 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-2) Initializing Mojarra 2.1.7-jbossorg-1 (20120227-1401) for context '/wsrp-admin-gui'

                • 5. Re: Gatein 3.4 jboss7.1.1-Final jsf2 portlet
                  Joe Padula Novice

                  I thought the portlet war files went in standalone/deployments? When I tried the richfaces-simple.war in gatein/deployments, it hot deploys OK, but after restarting GateIn-3.4.0.Final-jbossas7, I get the exact same errors as Patrick. But when I place the war in standalone/deployments, it deploys correctly and renders correctly in the browser.

                  • 6. Re: Gatein 3.4 jboss7.1.1-Final jsf2 portlet
                    Marko Strukelj Master

                    Joe,

                     

                    you mean, that when you place your war in gatein/extensions, and start JBossAS7 it deploys fine.

                    But if you place it in standalone/deployments, and start jbossas7 you get the exception.

                    And the third case, if you have an already running JBossAS7, and you place you war in standalone/deployments it deploys fine.

                     

                    Is that the behaviour you're seeing?

                    • 7. Re: Gatein 3.4 jboss7.1.1-Final jsf2 portlet
                      Joe Padula Novice

                      No, not really. I haven't tried to put anything in gatein/extensions.

                       

                      I put the sample war in standalone/deployments per previous instructions from Ken Finnigan, and do not have any problems/exceptions, whether hot deploy or cold start..

                       

                      I just tried it in GateIn-3.5.0.Beta02_jbossas7 also, and do not have any exceptions.

                       

                      Is there instructions somewhere that I can read that describes where we a supposed to put our portlet wars (I'm using the JBoss Portlet Bridge)? (We do not develop with Maven.)

                       

                      I'm trying to port our app to GateIn-3.5.0.Beta02_jbossas7, starting yesterday and putting our wars in standalone/deployments, I hope that is correct location.

                       

                      According to this post by Thomas Heute, I believe we should be putting our portlets in standalone/deployments.

                           "The idea was that /standalone/deployments is left empty for user applications..."

                      https://community.jboss.org/message/756365#756365

                      • 8. Re: Gatein 3.4 jboss7.1.1-Final jsf2 portlet
                        Marko Strukelj Master

                         

                        I put the sample war in standalone/deployments per previous instructions from Ken Finnigan, and do not have any problems/exceptions, whether hot deploy or cold start..

                         

                         

                        I thought you were having problems based on your first comment:

                         

                         

                        When I tried the richfaces-simple.war in gatein/deployments, it hot deploys OK, but after restarting GateIn-3.4.0.Final-jbossas7, I get the exact same errors as Patrick.

                         

                         

                        There is info about GateIn JBossAS7 integration in GateIn 3.5 Reference Guide. And also in JBoss AS7 packaging module's README.txt.

                         

                        In short - portlet applications can be deployed to standalone/deployments, or via JBoss AS7 management tools (web console, command-line client, jboss-as maven plugin) unless they integrate with GateIn Kernel services in some way i.e. use extension mechanism to override resources, or use configuration.xml to install components to GateIn Kernel. In that case they should be deployed to gatein/extensions.

                        • 9. Re: Gatein 3.4 jboss7.1.1-Final jsf2 portlet
                          Joe Padula Novice

                          Marko,

                          Thanks for that clarification. The documentation is very good and clarifies things.

                          Joe

                          • 10. Re: Gatein 3.4 jboss7.1.1-Final jsf2 portlet
                            Ken Finnigan Master

                            Patrick,

                             

                            With the follow ups from Joe I re-read your original post and I think the problems you're experiencing may be due to the portlet war being added to gatein/deployments instead of standalone/deployments.

                             

                            Ken

                            • 11. Re: Gatein 3.4 jboss7.1.1-Final jsf2 portlet
                              Patrick Verboom Newbie

                              Dear All,

                               

                              I have tried it again in the Gatein 3.4 and your correct the deployment directory was false. Now that I have moved the file in the standalone/deployments directory it work fine.

                               

                              Thanks a lot for all your help,

                              Patrick