4 Replies Latest reply on Mar 3, 2009 11:14 AM by Nick Belaevski

    Simple example delpoying to JBoss 5.0.1 not work

    Eldon Coutinho Newbie

      Hi,

      In the book Pratical Richfaces (Max Katz), there is a first and simple application calling Echo. When I did deploy this application to Tomcat 6.0.18 the application works fine. But the same war deployed to JBoss 5.0.1 cause this error:

      javax.el.ELException: /echo.xhtml: Property 'countListener' not found on type echo.EchoBean
      at com.sun.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:53)
      at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39)
      at com.sun.facelets.compiler.UILeaf.encodeAll(UILeaf.java:149)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
      ....


      Actually, the first time I did try to deploy I receive this error:

      JSF1029: The specified InjectionProvider implementation 'org.jboss.web.jsf.integration.injection.JBossDelegatingInjectionProvider' does not implement the InjectionProvider interface.

      I did search a solution in google and did find in:

      http://dushyants.blogspot.com/2009/01/error-running-jsf-with-jboss.html

      Error running JSF with Jboss
      Error: The specified InjectionProvider implementation 'org.jboss.web.jsf.integration.injection.JBossDelegatingInjectionProvider' does not implement the InjectionProvider interface.

      Solution:
      You need to remove the bundled JSF implementation. To do so you need to comment/remove the following from the web.xml found under jboss-4.2.0.GA\server\\deploy\jboss-web.deployer\conf.

      Under jboss 5.0.0GA jboss-5.0.0.GA\server\default\deployers\jbossweb.deployer\web.xml

      <!-- Comment/Remove this -->
      <!-- Configures JSF for a web application if the javax.faces.webapp.FacesServlet is declared -->
      <!-- in web.xml. -->
      <!--

      <listener-class>org.jboss.web.jsf.integration.config.JBossJSFConfigureListener </listener-class>

      -->
      <!-- Comment/Remove this -->
      <!-- 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-class>com.sun.faces.application.WebappLifecycleListener</listener-class>

      -->

      After I did comment this lines, I did sucessfully deploy the war in Jboss 5.0.1 but following error occurs: javax.el.ELException: /echo.xhtml: Property 'countListener' not found on type echo.EchoBean






        • 1. Re: Simple example delpoying to JBoss 5.0.1 not work
          Eldon Coutinho Newbie

          I deploy the same war to Glassfish v2 and works fine!

          The code is:

          echo.xhtml


          <?xml version="1.0" encoding="ISO-8859-1" ?>
          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          <html xmlns="http://www.w3.org/1999/xhtml"
           xmlns:ui="http://java.sun.com/jsf/facelets"
           xmlns:h="http://java.sun.com/jsf/html"
           xmlns:f="http://java.sun.com/jsf/core"
           xmlns:rich="http://richfaces.org/rich"
           xmlns:a4j="http://richfaces.org/a4j">
          
          <head>
           <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
           <title>Echo</title>
          </head>
          
          
          <body>
           <h:form>
           <rich:panel style="width:50%">
           <h:panelGrid columns="2">
           <h:outputText value="Name:" />
          
           <h:inputText value="#{echoBean.name}">
           <a4j:support event="onkeyup" reRender="echo, count"
           actionListener="#{echoBean.countListener}"/>
           </h:inputText>
          
          
           <h:outputText value="Echo:" />
           <h:outputText id="echo" value="#{echoBean.name}" />
          
           <h:outputText value="Count:" />
           <h:outputText id="count" value="#{echoBean.count}" />
           </h:panelGrid>
          
           <a4j:commandButton value="Submit" actionListener="#{echoBean.countListener}" reRender="echo, count" />
          
          
          
           </rich:panel>
          
           </h:form>
          </body>
          
          
          </html>
          
          



          EchoBean.java


          package echo;
          
          import javax.faces.event.ActionEvent;
          
          public class EchoBean {
          
           private String name;
           private Integer count;
          
           public EchoBean() {
          
           }
          
          
           public String getName() {
           return name;
           }
          
           public void setName(String name) {
           this.name = name;
           }
          
           public Integer getCount() {
           return count;
           }
          
           public void setCount(Integer count) {
           this.count = count;
           }
          
           public void countListener(ActionEvent event) {
          
           this.count = name.length();
           }
          
          
          
          }
          
          


          web.xml

          
          <?xml version="1.0"?>
          <web-app version="2.5"
          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">
          
           <description>CaronaBrasil</description>
           <display-name>CaronaBrasil</display-name>
          
           <context-param>
           <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
           <param-value>.xhtml</param-value>
           </context-param>
          
           <!--
           <context-param>
           <param-name>facelets.REFRESH_PERIOD</param-name>
           <param-value>2</param-value>
           </context-param>
           -->
          
           <context-param>
           <param-name>facelets.DEVELOPMENT</param-name>
           <param-value>true</param-value>
           </context-param>
          
           <context-param>
           <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
           <param-value>server</param-value>
           </context-param>
          
           <context-param>
           <param-name>org.richfaces.SKIN</param-name>
           <param-value>blueSky</param-value>
           </context-param>
          
           <filter>
           <display-name>Ajax4jsf Filter</display-name>
           <filter-name>ajax4jsf</filter-name>
           <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>
          
           <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>*.jsf</url-pattern>
           </servlet-mapping>
          
           <login-config>
           <auth-method>BASIC</auth-method>
           </login-config>
          
          </web-app>
          


          faces-config.xml

          <?xml version="1.0" encoding="UTF-8"?>
          <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
           xmlns:xi="http://www.w3.org/2001/XInclude"
           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">
          
          
           <application>
           <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
           </application>
          
          
           <managed-bean>
           <managed-bean-name>echoBean</managed-bean-name>
           <managed-bean-class>echo.EchoBean</managed-bean-class>
           <managed-bean-scope>request</managed-bean-scope>
           </managed-bean>
          
          
          </faces-config>
          
















          [img][/img]

          • 2. Re: Simple example delpoying to JBoss 5.0.1 not work
            Nick Belaevski Master

            Hello,

            Please try removing JSF libraries from the application.

            • 3. Re: Simple example delpoying to JBoss 5.0.1 not work
              Eldon Coutinho Newbie

              Hi nbelaevski,

              I tried to remove the libraries from the application but the following error occurs:

              java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory


              • 4. Re: Simple example delpoying to JBoss 5.0.1 not work
                Nick Belaevski Master

                Hi, I can run richfaces-demo on JBoss 5.0.1.GA without removing JSF libraries and changing anything in the application. Livedemo sources can be checked out from here: http://anonsvn.jboss.org/repos/richfaces/trunk/samples/richfaces-demo