3 Replies Latest reply on Mar 20, 2008 4:54 AM by bgrand

    jsf for jboss 4.2

    robert_trudel

      hi

      with jboss 4.2, i got some problem with jsf

      if i remove
      myfaces-impl-1.1.4.jar
      myfaces-api-1.1.4.jar

      i get

       Exception sending context destroyed event to listener instance of class
      (listener) org.jboss.web.jsf.integration.config.JBossJSFConfigureListener
      java.lang.NoClassDefFoundError: javax/el/ELResolver
      


      if i don't remove thees files
      [JBossJSFConfigureListener] MyFaces JSF implementation found! This version
      of JBoss AS ships with the java.net implementation of JSF. There are known
      issues when mixing JSF implementations. This warning does not apply to
      MyFaces component libraries such as Tomahawk. However, myfaces-impl.jar
      and myfaces-api.jar should not be used without disabling the built-in JSF
      implementation. See the JBoss wiki for more details.
      15:58:07,218 ERROR [STDERR] javax.faces.FacesException:
      org.ajax4jsf.framework.DebugLifecycleFactory
      ...
      ...
      Caused by: java.lang.InstantiationException:
      org.ajax4jsf.framework.DebugLifecycleFactory
       at java.lang.Class.newInstance0(Class.java:335)
       at java.lang.Class.newInstance(Class.java:303)
       at
      javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:567)
      


      my web.xml
      <?xml version="1.0" encoding="UTF-8"?>
      
      <web-app xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
      http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
       version="2.5">
      
       <!-- Seam -->
       <listener>
       <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
       </listener>
       <filter>
       <filter-name>Seam Filter</filter-name>
       <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
       </filter>
       <filter-mapping>
       <filter-name>Seam Filter</filter-name>
       <url-pattern>/*</url-pattern>
       </filter-mapping>
       <filter-mapping>
       <filter-name>Seam Filter</filter-name>
       <url-pattern>*.seam</url-pattern>
       </filter-mapping>
       <filter>
       <display-name>Ajax4jsf Filter</display-name>
       <filter-name>ajax4jsf</filter-name>
       <filter-class>org.ajax4jsf.FastFilter</filter-class>
       <!--
       <filter-class>org.ajax4jsf.Filter</filter-class>
       -->
       </filter>
      
       <filter-mapping>
       <filter-name>ajax4jsf</filter-name>
       <servlet-name>Faces Servlet</servlet-name>
       <dispatcher>REQUEST</dispatcher>
       <dispatcher>FORWARD</dispatcher>
       <dispatcher>INCLUDE</dispatcher>
       </filter-mapping>
      
       <!--
       <context-param>
       <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
      
      <param-value>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</param-value>
       </context-param>
       -->
      
       <servlet>
       <servlet-name>Seam Resource Servlet</servlet-name>
       <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
       </servlet>
       <servlet-mapping>
       <servlet-name>Seam Resource Servlet</servlet-name>
       <url-pattern>/seam/resource/*</url-pattern>
       </servlet-mapping>
      
       <!-- MyFaces -->
       <!--
       <listener>
      
      <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
      
       </listener>
       -->
      
       <context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>client</param-value>
       </context-param>
       <context-param>
       <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
       <param-value>.xhtml</param-value>
       </context-param>
       <servlet>
       <servlet-name>Faces Servlet</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet>
       <servlet-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>*.do</url-pattern>
       </servlet-mapping>
       <!-- Config -->
       <session-config>
       <session-timeout>120</session-timeout>
       </session-config>
      </web-app>
      
      


      my faces-config
      <?xml version="1.0" encoding="UTF-8"?>
      
      <!--
      
      <!DOCTYPE faces-config
      PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
      
      "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
      <faces-config>
      -->
      
      
      <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
      http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
       version="1.2">
      
      
       <application>
      
      <view-handler>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</view-handler>
       </application>
      
       <!-- Phase listener needed for all Seam applications -->
      
       <lifecycle>
      
      <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
       </lifecycle>
      
      </faces-config>
      


      i searched on the web and mailing list, but found no answer about this problem..

        • 1. Re: jsf for jboss 4.2
          hryhory

          Today I had the same problem.

          To avoid this exception you have to add to your web.xml
          following lines:

          <context-param>
           <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
           <param-value>true</param-value>
          </context-param>


          This will disable the built-in jsf implementation (just read server output)

          • 2. Re: jsf for jboss 4.2
            bgrand

            Hi !

            Same problem for me... I added your context-param code in my web.xml file, but I still have the same error message when deploying the application in JBoss...

            09:14:03,310 WARN [JBossJSFConfigureListener] MyFaces JSF implementation found! This version of JBoss AS ships with the java.net implementation of JSF. There are known issues when mixing JSF implementations. This warning does not apply to MyFaces component libraries such as Tomahawk. However, myfaces-impl.jar and myfaces-api.jar should not be used without disabling the built-in JSF implementation. See the JBoss wiki for more details.


            My configuration: JBossAS 4.2.2.GA, myfaces-api-1.1.1.jar and myfaces-impl-1.1.1.jar bundled in the EAR.

            Maybe, is it possible to disable the JBossAS built-in implementation of JSF directly in JBossAS, or to replace it by MyFaces' one ?

            if someone has enougth experience with this to help me, I will appreciate very much, and even if you have only ideas about this :)

            • 3. Re: jsf for jboss 4.2
              bgrand

              I tried to replace jsf-api.jar and jsf-impl.jar in server\default\deploy\jboss-web.deployer\jsf-libs by myfaces-api-1.1.1.jar and myfaces-impl-1.1.1.jar, but myfaces-impl doesn't have this package : com/sun/... like jsf-impl :-/

              And thus JBoss makes errors during its startup...