10 Replies Latest reply on Dec 13, 2010 7:05 AM by antoine_h

    GateIn sample-portal problem

    baylessg

      Hello,

       

      I am trying to build the sample-portal found in the GateIn source distribution (GateIn-3.0.0-FINAL-src.tar) and run it in my installed GateIn Tomcat distribution (GateIn-3.0.0-FINAL-tomcat.tar).  I work on a private network so cannot use maven.  Therefore, I tried to follow all the steps in the "Portal containers" article Thomas Heute published on March 3rd and in the README.txt located in the examples/portal directory but with the code built in NetBeans projects.  I build and copy sample-portal.war, rest-sample-portal.war and startup.war to the webapps directory of my GateIn Tomcat install and I build and copy exo.portal.sample.portal.jar and exo.portal.sample.portal.config.jar to the lib directory.  I also defined the realm in tomcat/conf/jaas.conf and made the sample-portal.xml and rest-sample-portal.xml files in tomcat/conf/Catalina/localhost as per the README.txt.  When I start GateIn, the servlet doesn't start because it gets the error

       

           Cannot find a satisfying constructor for class org.exoplatform.portal.application.PortalStatisticService with parameter class org.exoplatform.portal.config.UserPortalConfigService

         at org.exoplatform.container.ExoContainer.createComponent (ExoContainer.java:209)

         at org.exoplatform.container.jmx.MX4JComponentAdapter

       

      In the sample-portal, the sample code (SampleFilter, SampleHttpSessionCreatedListener, SampleHttpSessionDestroyedListener, SampleContextInitializedListener and SampleContextDestroyedListener) each has a system.out.println and I see in the output from SampleFilter.doFilter() then the SampleSessionCreatedListener.onEvent() then the error then the output from the 'finally' clause of SampleFilter.doFilter() and then the SampleHttpSessionDestroyedListener.onEvent().

       

      I can see and use the regular GateIn portal in the browser even with these errors but obviously when I try to go to sample-portal in the browser there is an error in the logs and the page is blank.

       

      Help!!??

       

      Thank you,

      Gail

        • 1. Re: GateIn sample-portal problem
          trong.tran

          I guess it means "starter.war" when you say "startup.war", this is a special application to create and start the portal containers when all the web application have already been loaded. So make sure that the starter.war is the last war file to be loaded, and don't hesitate to rename it if your war files are loaded following to the alphabetic order.

          1 of 1 people found this helpful
          • 2. Re: GateIn sample-portal problem
            baylessg

            Trong,

             

            Thank you for your prompt response.  Do you think that starter.war not going last could cause the error I am getting.  Actually, I'm not really sure how to make sure that it is the last war file loaded.  Given the suggestions in the GateIn source distribution examples/portal/README.txt to just rename starter to starter.war, that is what I did.  I copied the directory and its contents to my webapps directory and renamed it xstarter.war so it would hopefully deploy last.   I still get that error.

             

            Gail

            • 3. Re: GateIn sample-portal problem
              baylessg

              Here are some more details from the logs set at FINE:

               

              <timestamp> org.exoplatform.container.RootContainer createPortalContainer

              FINE: ==> Trying to create the portal container 'sample-portal'

              <timestamp> org.exoplatform.container.ExoContainer createComponent

              FINE: ==> org.exoplatform.web.application.javascript.JavascriptConfigService added to sample-portal

              <timestamp> org.exoplatform.container.management.ManageableComponentAdapter getComponentInstance

              FINE: ==> add org.exoplatform.web.application.javascript.JavascriptConfigService@166e555 to a mbean server

              <timestamp> org.exoplatform.container.ExoContainer createComponent

              FINE: ==> org.exoplatform.portal.application.ApplicationStatisticService added to sample-portal

              <timestamp> org.exoplatform.container.management.ManageableComponentAdapter getComponentInstance

              FINE: ==> add org.exoplatform.portal.application.ApplicationStatisticService@88dd83 to a mbean server

              <timestamp> org.exoplatform.container.ExoContainer createComponent

              FINE: ==> org.exoplatform.portal.application.PortalStatisticService added to sample-portal

              <timestamp> org.exoplatform.container.RootContainer createPortalContainer

              SEVERE:  Cannot create the portal-container 'sample-portal'

              ServletContext: org.apache.catalina.core.ApplicationContextFacade@19efe65

              java.lang.RuntimeException:Cannot instantiate component key=org.exoplatform.portal.application.PortalStatisticService type=org.exoplatform.portal.application.PortalStatisticService found at jar: file: /<path to gatein>/lib/exo.portal.webui.portal-3.0.0.jar!/conf/portal/configuration.xml

                .

                .  <stack trace>

                .

              Caused by: java.lang.Exception Cannot find a satisfying constructor for class org.exoplatform.portal.application.PortalStatisticService with parameter class org.exoplatform.portal.config.UserPortalConfigService

                at org.exoplatform.container.ExoContainer.createComponent (ExoContainer.java:209)

                at org.exoplatform.container.jmx.MX4JComponentAdapter

                .

                .   <stack trace>

                .

               

               

              Prior to this, the same series of logging occurred for portal container 'portal' but with other things added between the "Trying to create ..." message and the "...ApplicationStatisticService added ..." message and the "...PortalStatisticService added ..." message and of course no errors occurred.

               

              Gail

              • 4. Re: GateIn sample-portal problem
                trong.tran

                Yes, the starter.war stuff seems not related to the error.

                 

                I guess the problem might come from the duplication of a jar library Or there are two classes with same qualified name in your tomcat/lib

                • 5. Re: GateIn sample-portal problem
                  trong.tran

                  that is you should check if there are two org.exoplatform.portal.application.PortalStatisticService classes in the library

                  1 of 1 people found this helpful
                  • 6. Re: GateIn sample-portal problem
                    baylessg

                    I grepped for PortalStatisticService in the <gatein-install-dir>/lib directory and only one library has it:  exo.portal.webui.portal-3.0.0-GA.jar contains that text.  Also, I see in the logs that the regular 'portal' portal starts up that service with no error.

                     

                    It turns out that this error is not keeping my sample-portal from coming up, though.  I thought it was when I first couldn't access the sample-portal in the browser, looked in the logs and saw that error.  I guess the starter.war issue was causing that problem because I happened to try again and my sample-portal came up.  So I'm good except that I still have that error in my logs.

                     

                    I appreciate your help and would welcome any other suggestions.  If I figure it out as I build my portal from that sample-portal start, I'll certainly post it here.

                    • 7. Re: GateIn sample-portal problem
                      trong.tran

                      it looks like the org.exoplatform.portal.config.UserPortalConfigService is not registered to sample-portal portal container. This is declared in configuration of portal.war

                       

                      so let try to check the dependencies order defined in configuration.xml in the exo.portal.sample.portal.config.jar, ensure that the portal is on top of the list like this

                       

                                              ...
                                              <field name="dependencies">
                                                  <collection type="java.util.ArrayList">
                                                      <value>
                                                          <string>eXoResources</string>
                                                      </value>
                                                      <value>
                                                          <string>portal</string>
                                                      </value>
                                                      <value>
                                                          <string>dashboard</string>
                                                      </value>
                                                      <value>
                                                          <string>exoadmin</string>
                                                      </value>
                                                      <value>
                                                          <string>eXoGadgets</string>
                                                      </value>
                                                      <value>
                                                          <string>eXoGadgetServer</string>
                                                      </value>
                                                      <value>
                                                          <string>rest-sample-portal</string>
                                                      </value>
                                                      <value>
                                                          <string>web</string>
                                                      </value>
                                                      <!-- No wsrp in beta02
                                                      <value>
                                                          <string>wsrp-producer</string>
                                                      </value>
                                                      -->
                                                      <value>
                                                          <string>sample-portal</string>
                                                      </value>
                                                  </collection>
                                              </field>
                                              ...
                      
                      • 8. Re: GateIn sample-portal problem
                        sqli

                        Hi,

                         

                        My portal is not created, and I've got the same error :

                         

                        ...

                        <timestamp> ERROR [exo.kernel.container.RootContainer] (main) Cannot create the portal container 'bm' . ServletContext: org.apache.catalina.core.ApplicationContextFacade@1cfbe6c
                        java.lang.RuntimeException: Cannot instantiate component key=org.exoplatform.portal.application.PortalStatisticService type=org.exoplatform.portal.application.PortalStatisticService found at vfszip:/<path to gatein>/lib/exo.portal.webui.portal-3.1.0-GA.jar/conf/portal/configuration.xml
                            at org.exoplatform.container.jmx.MX4JComponentAdapter.getComponentInstance(MX4JComponentAdapter.java:124)

                         

                        ...

                         

                        Did you manage to start your portal ? how ?

                         

                        I work with "gatein-3.1.0-GA".

                         

                         

                        Thank  you.

                        • 9. Re: GateIn sample-portal problem
                          baylessg

                          Hanh,

                           

                          Further in your log, do you see something that says "caused by...".  That is the line that tells you where the start up got stuck.  I found that it was indicating a service that was not started which the current service (PortalStatisticService) depends on.  Once I set the config files so that service starts successfully, I got past that error.  Afraid I did get stuck on another service dependency error and had to repeat the process several times.  When it started getting stuck on the identity management services, I stopped trying to get the sample running since I wasn't sure what the sample really did.  At JBoss world I asked about this process / problem.  They don't have the service dependencies documented and said you just have to kind-of go along like I described, seeing what gets stuck and starting services that the logs indicate are needed.  I asked if they were working on decoupling some of these dependencies...

                           

                          If you need more details on solving the problem, I can look it up in my notes and provide more information.  Let me know.

                           

                          Gail

                          • 10. Re: GateIn sample-portal problem
                            antoine_h

                            Hello,

                             

                            I got the same problem.

                            I solved it this way : make sure that the "config jar" of the portal-sample, in the ear, is proper. That is : make sure the conf/configuration.xml is there, in the packaged jar.

                             

                            If not there, the UserPortalConfigService is not started, hence when trying to start the PortalStatisticService, the UserPortalConfigService instance cannot be found... and the PortalStatisticService start fails.

                             

                            Explaination :

                            I have built my portal from the portal-sample code.

                            The conf/configuration.xml file is under src/main/java.

                            for any reason, the maven-compiler-plugin does not copy this folder and file in the jar.

                            I put it under : src/main/resources/conf

                            then it is built in the jar.

                            I looked at the config of the maven-compiler-plugin. I cannot see the reason it is built properly in the GateIn projects, and not in mine.

                            May be it is because the config of the maven-compiler-plugin is with java version 1.5, and mine is with java version 1.6.

                             

                            So anyway, make sure the configuration files are there, and that the portal components are started.

                             

                            The exception message is misleading.

                            I created a Jira about that : http://jira.exoplatform.org/browse/KER-167

                             

                            Antoine
                            <a href="http://www.sysemo.com/Sysemo-expertise-portails-jboss-portal.php" title="JBoss Portal and GateIn (JSR-286), JSF, Richfaces, J2EE, Drools, BRMS.">JBoss Portal and GateIn (JSR-286), JSF, Richfaces, J2EE.</a>