2 Replies Latest reply on Jul 27, 2007 8:17 AM by Tino Schmeier

    jboss-4.2.1 - seam-2.0 - myfaces classpath

    Tino Schmeier Newbie

      Hello.

      I want to port our webapp to seam-2.0 and use myfaces-core-1.2, jbossas-4.2.1 and the tomahawk-components-1.1.6. I followed the instructions from http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss5AndMyFaces and the seam2migration.txt. The application starts and is working. But MyFacesConfig/jboss shows an errormessage on stdout


      Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.

      In debugmode i figured out, that the current classloader of the deployed webapp only include the myfaces-jars? Is this message a bug on the myfaces-classes or do i have to change the classpathconfiguration. By the way, how could i do this.


      Best regards
      Tino

        • 1. Re: jboss-4.2.1 - seam-2.0 - myfaces classpath
          Stan Silvert Master

          That message comes from Tomahawk. You should be OK, but note that the WAR_BUNDLES_JSF_IMPL flag has not been tested with MyFaces 1.2.

          If you want to get rid of that message and make sure you are totally safe, you can remove jsf-impl.jar and jsf-api.jar from deploy/jboss-web.deployer/jsf-libs.

          Then, comment out the following in deploy/jboss-web.deployer/conf/web.xml:

          <!-- JBossInjectionProvider provides resource injection for managed beans. -->
           <!-- See JSF 1.2 spec section 5.4 for details. -->
           <context-param>
           <param-name>com.sun.faces.injectionProvider</param-name>
           <param-value>org.jboss.web.jsf.integration.injection.JBossInjectionProvider</param-value>
           </context-param>
          
           <!-- Configures JSF for a web application if the javax.faces.webapp.FacesServlet is declared -->
           <!-- in web.xml. -->
           <listener>
           <listener-class>org.jboss.web.jsf.integration.config.JBossJSFConfigureListener</listener-class>
           </listener>
          
           <!-- Listens to all web app lifecycle events so that @PreDestroy can be called on -->
           <!-- JSF managed beans that go out of scope. You can comment this out if you -->
           <!-- don't use JSF or you don't use annotations on your managed beans. -->
           <listener>
           <listener-class>com.sun.faces.application.WebappLifecycleListener</listener-class>
           </listener>
          
           <init-param>
           <description>JSF standard tlds</description>
           <param-name>tagLibJar0</param-name>
           <param-value>jsf-libs/jsf-impl.jar</param-value>
           </init-param>


          I would also point out that the RI is much older and more likely to be stable. Plus, the annotation processor is integrated with JBoss so you can use things like @PreDestroy and @PostConstruct on your managed beans. You can also use JBoss Serialization to potentially speed up your application. So I encourage you to give the RI a try.

          There is really no reason to change the JSF implementation. Would you like to use a different JSP implementation with JBoss? I can show you how to do that too. But nobody would think of such a thing! The same goes for JSF. It's now part of the container.

          Stan Silvert
          http://jsf.jboss.org

          • 2. Re: jboss-4.2.1 - seam-2.0 - myfaces classpath
            Tino Schmeier Newbie

            Hello.

            Thank you for this workaround.
            At the moment we use the fck-faces-library which has dependencies to the myfaces-impl. I think, in the future we will change to RI and have to adapt it to RI.


            Tino