8 Replies Latest reply on Jan 26, 2007 6:02 AM by Tom Slater

    jboss-forums-2.2.2-CR1 distro broken ?

    Tom Slater Newbie

      I'm trying to install forums using jboss-forums-2.2.2-CR1 and get the following error when deploying:

      2007-01-11 14:13:46,648 DEBUG [org.jboss.deployment.SARDeployer] create operation failed for package file:/C:/Program Files/jboss-4.0.5.GA/server/default/deploy/portal-forums.ear/portal-forums.sar/
      org.jboss.deployment.DeploymentException: No ClassLoaders found for: org.jboss.portal.core.hibernate.SessionFactoryBinder; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.portal.core.hibernate.SessionFactoryBinder)
      at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:196)
      at org.jboss.system.ServiceController.install(ServiceController.java:226)
      at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      ....

      The AS and portal where installed using jems-installer-1.2.0.CR1 on Windows2000 so that makes the AS version 4.0.5 but the portal version is unknown but suspect it may be 2.4.

      Apparently this is the only combo that works with the wiki (installed from jbosswiki-beta2-2.4-bin) which we require for our project.

      The error is similar to an earlier posting regarding image gallery portlet:

      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=88886&view=next

      "zerrt" wrote:
      This question is regarding the image gallery portlet.

      Is there a way to get this portlet to work with portal version 2.4 GA?

      When I try to load the portlet in this portal I get the follwing error:

      15:33:53,031 INFO [EARDeployer] Init J2EE application: file:/C:/jboss4.04/server/fishmas/deploy/portal-imagegallery.ear
      ERROR [MainDeployer] Could not create deployment: file:/C:/jboss4.04/server/fishmas/tmp/deploy/tmp24585portal-imagegallery.ear-contents/portal-imagegallery.sar
      org.jboss.deployment.DeploymentException: No ClassLoaders found for: org.jboss.portal.core.hibernate.SessionFactoryBinder; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.portal.core.hibernate.SessionFactoryBinder)

      Is there perhaps a way to make this class available so this portlet might run?

      Any help would be greatly appreciated.


      Both errors appear to be caused by missing class org.jboss.portal.core.hibernate.SessionFactoryBinder

      Is it just a simple matter of including this class in the distro and if so can we except a fix soon or is there a more serious problem.

      Many thanks,

      Tom

        • 1. Re: jboss-forums-2.2.2-CR1 distro broken ?
          Ryszard Kozmik Master

          Do you use forums downloaded from here : http://labs.jboss.com/portal/jbossforums/downloads ?
          Or even better from JBoss Forums svn repository where the newest changes are available.

          Regards
          ----------------------
          Ryszard Kozmik
          JBoss Forums Lead
          JBoss Labs Team

          • 2. Re: jboss-forums-2.2.2-CR1 distro broken ?
            Tom Slater Newbie

            The forums file was downloaded from http://labs.jboss.com/portal/jbossportal/download/index.html but I now realise that this version is incompatible with AS 4.0.4 and portal 2.4.

            I has subsequently tried all the forum installations from the download location you suggested and the only one that deploys is jboss-forums-1.0.0Alpha-P2.4 (as would be expected).

            However, when attempting to use the forum portlet in a portlet page I get the following error displayed in the web page:

            An error occurred while rendering window 'default.forum.forum'
            java.lang.NullPointerException: serialFactory


            Search in log file reveals the following occurred during deployment:

            java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions!
            If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml.
            A typical config looks like this;
            <listener>
            <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
            </listener>


            What do I need to do to fix this new error ?


            Many thanks,

            Tom



            • 3. Re: jboss-forums-2.2.2-CR1 distro broken ?
              Tom Slater Newbie

              Searching thought other post on this forum it appears that the following lines are missing from the web.xml file


              <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>


              I have a got at adding them and see if that does the trick.

              Tom.

              • 4. Re: jboss-forums-2.2.2-CR1 distro broken ?
                Ryszard Kozmik Master

                Yeah, it should help. It is one of the reasons I recommend using building Forums from sources as there were many bugfixes since Alpha release.

                ----------------------
                Ryszard Kozmik
                JBoss Forums Lead
                JBoss Labs Team

                • 5. Re: jboss-forums-2.2.2-CR1 distro broken ?
                  Tom Slater Newbie

                  Downloaded source code from

                  http://anonsvn.labs.jboss.com/labs/jbossforums/trunk

                  and compiled according to instructions in doc

                  http://labs.jboss.com/file-access/default/members/jbossforums/downloads/JBossForumsGuide.pdf

                  but when forum portlet is access through browser I get the following error:


                  2007-01-15 14:59:04,601 ERROR [org.jboss.portlet.forums.ui.ForumsJSFPortlet] The portlet threw an exception
                  javax.portlet.PortletException: java.lang.NullPointerException
                  at org.jboss.portlet.forums.ui.ForumsJSFPortlet.doView(ForumsJSFPortlet.java:325)
                  at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:167)
                  at javax.portlet.GenericPortlet.render(GenericPortlet.java:407)
                  .....

                  Caused by: java.lang.NullPointerException
                  at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:122)
                  at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
                  at org.jboss.portlet.forums.ui.ForumsJSFPortlet.doView(ForumsJSFPortlet.java:318)


                  It appears that var 'lifecycle' on line 318 of org.jboss.portlet.forums.ui.doView() is null. Searching the code base reveals that this var is only referenced twice both times in method doView() neither which are assignments so I not sure how the var should acquires its value.

                  Any clues ?

                  Environment:
                  OS: Windows2000
                  AS: 4.0.5
                  Portal: 2.4

                  Many thanks,

                  Tom.


                  • 6. Re: jboss-forums-2.2.2-CR1 distro broken ?
                    Ryszard Kozmik Master

                    Hi

                    I'm very surprised by this exception. I'll try to do a clean deployment same as you later this week to see whether I can reproduce problem.

                    Did you change any myfaces/JSF libraries in Portal on in AS deploy directory?

                    And btw, lifecycle is inherited from MyFacesGenericPortlet.

                    Thanks
                    ----------------------
                    Ryszard Kozmik
                    JBoss Forums Lead
                    JBoss Labs Team

                    • 7. Re: jboss-forums-2.2.2-CR1 distro broken ?
                      Tom Slater Newbie

                      No, here's what I did to get the error:

                      1) install AS 4.0.5 and portal2.4 by running java -jar jems-install-1.2.0.CR1.jar. Ensuring that the portal radio button is the only one selected and go with all the defaults.

                      2) Install wiki by copying wiki.war to deploy directory.

                      3) Build and install forums by pulling code from

                      http://anonsvn.labs.jboss.com/labs/jbossforums/trunk

                      4) Added following to forums/src/resources/portal-forums-war/WEB-INF/web.xml


                      <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>


                      (NB. I've tried omitting step 4 as it references myFaces but the result is the same)

                      5) Compiled according to instructions in doc

                      http://labs.jboss.com/file-access/default/members/jbossforums/downloads/JBossForumsGuide.pdf

                      6) Log on to portal as admin and go to admin tab.

                      7) Use management portlet to create forum page under default page and added JSFForumPortletInstance.

                      9) Go to forum page to trigger error.

                      10) View server log for details.

                      • 8. Re: jboss-forums-2.2.2-CR1 distro broken ?
                        Tom Slater Newbie

                        Considering the error below:


                        Caused by: java.lang.NullPointerException
                        at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:122)
                        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
                        at org.jboss.portlet.forums.ui.ForumsJSFPortlet.doView(ForumsJSFPortlet.java:318)


                        Looking through the source for ForumsJSFPortlet and LifecyleImpl here's what I discovered:

                        The method ForumsJSFPortlet.doView() calls LifecycleImpl.execute() passing fc (FacesContext) as a parameter. The method LifecycleImpl.execute() then in turn calls LifecycleImpl.restoreView() also passing fc as a param. The method restoreView() then gets the externalContext from the facesContext with the following line:

                        ExternalContext externalContext = facesContext.getExternalContext();

                        it then goes on to call externalContext.getRequestSeverletPath() which return null and causes the error above.

                        Placing a couple of println statements in the ForumsJSFPortlet.doView() above the lifecycle.execute() call to clarify the situation:

                        System.out.println("**** lifecycle = " + lifecycle);
                        System.out.println("**** fc = " + fc);

                        ExternalContext externalContext = fc.getExternalContext();
                        System.out.println("**** externalContext = " + externalContext);
                        System.out.println("**** externalContext.getRequestServletPath() = " + externalContext.getRequestServletPath());

                        lifecycle.execute(fc);

                        when compiled and executed reveals:


                        2007-01-25 11:42:47,383 INFO [STDOUT] **** lifecycle = org.apache.myfaces.lifecycle.LifecycleImpl@2f06b6
                        2007-01-25 11:42:47,383 INFO [STDOUT] **** fc = org.apache.myfaces.context.servlet.ServletFacesContextImpl@10fbe75
                        2007-01-25 11:42:47,383 INFO [STDOUT] **** externalContext = org.apache.myfaces.context.portlet.PortletExternalContextImpl@a0ff27
                        2007-01-25 11:42:47,383 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@101751, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1cf5ee4{ url=null ,addedOrder=0}
                        2007-01-25 11:42:47,383 INFO [STDOUT] **** externalContext.getRequestServletPath() = null
                        2007-01-25 11:42:47,383 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@101751, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@15ef3ab{ url=null ,addedOrder=0}
                        2007-01-25 11:42:47,393 ERROR [org.jboss.portlet.forums.ui.ForumsJSFPortlet] The portlet threw an exception
                        javax.portlet.PortletException: java.lang.NullPointerException
                        at org.jboss.portlet.forums.ui.ForumsJSFPortlet.doView(ForumsJSFPortlet.java:339)


                        The point to note here is that the externalContext if of type PortletExternalContextImpl and both the javadoc and the code reveal that the getRequestServletPath() method returns null.

                        Are lifecycle, fc and externalContext of the expected types ?

                        Both lifecycle and facesContext are obtained from lifecycleFactory and facesContextFactory respectively in MyFacesGenericPortlet.init() (the super of ForumsJSFPortlet) and these are in turn obtained from the FactoryFinder class.

                        Are the factories returning the right types for lifecycle and facesContext ? Are the factories controlled by an xml file and if so which and what parameters do I need to look for?

                        Many thanks,

                        Tom.