1 Reply Latest reply on Oct 24, 2011 1:22 PM by xadil

    java.lang.UnsupportedOperationException with rich faces 4.1.0.20110805-M1

    xadil

      I am new to jsf/rich faces. I am trying to build the demo application step by step as per the link http://java.dzone.com/articles/jboss-richfaces-spring

      I am using tomcat apache-tomcat-7.0.22 to run the application. I am using eclipse indigo to create the jsf project. When i run the first page i get the below stack trace error

       

      java.lang.UnsupportedOperationException

                at javax.faces.application.Application.getResourceHandler(Application.java:286)

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:305)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)

                at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)

                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)

                at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)

                at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)

                at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)

                at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                at java.lang.Thread.run(Thread.java:662)

       

      I have the following libraries under web-inf/lib folder

       

      ajax4jsf-1.1.1.jar

      commons-beanutils-1.7.0.jar

      commons-collections-3.2.1.jar

      commons-digester-1.8.jar

      commons-logging-1.0.4.jar

      cssparser-0.9.5.jar

      geronimo-validation_1.0_spec-1.0-CR5.jar

      guava-10.0.1.jar

      hibernate-validator-4.2.0.Final.jar

      jhighlight-1.0.jar

      jsf-api-2.0.0.jar

      org.springframework.asm-3.1.0.M2.jar

      org.springframework.beans-3.1.0.M2.jar

      org.springframework.context.support-3.1.0.M2.jar

      org.springframework.context-3.1.0.M2.jar

      org.springframework.core-3.1.0.M2.jar

      org.springframework.expression-3.1.0.M2.jar

      org.springframework.web-3.1.0.M2.jar

      richfaces-components-api-4.1.0.20110910-M2.jar

      richfaces-components-ui-4.1.0.20110910-M2.jar

      richfaces-core-api-4.1.0.20110910-M2.jar

      richfaces-core-impl-4.1.0.20110910-M2.jar

      sac-1.3.jar

       

      My faces config looks like this

       

      <?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">

                <managed-bean>

                          <managed-bean-name>temperatureConvertor</managed-bean-name>

                          <managed-bean-class>de.vogella.jsf.first.model.TemperatureConvertor</managed-bean-class>

                          <managed-bean-scope>session</managed-bean-scope>

                </managed-bean>

                <application>

                          <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>

                          <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>

                </application>

      </faces-config>

       

      my web.xml looks like this

       

      <?xml version="1.0" encoding="UTF-8"?>

      <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/j2ee/web-app_2_5.xsd">

        <display-name>XTransfer</display-name>

        <welcome-file-list>

          <welcome-file>index.html</welcome-file>

          <welcome-file>index.htm</welcome-file>

          <welcome-file>index.jsp</welcome-file>

          <welcome-file>default.html</welcome-file>

          <welcome-file>default.htm</welcome-file>

          <welcome-file>default.jsp</welcome-file>

        </welcome-file-list>

        <filter>

                            <display-name>Ajax4jsf Filter</display-name>

                            <filter-name>richfaces</filter-name>

                          <filter-class>org.ajax4jsf.Filter</filter-class>

                </filter>

                <filter-mapping>

                          <filter-name>richfaces</filter-name>

                          <servlet-name>Faces Servlet</servlet-name>

                          <dispatcher>REQUEST</dispatcher>

                          <dispatcher>FORWARD</dispatcher>

                          <dispatcher>INCLUDE</dispatcher>

                </filter-mapping>

                <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>laguna</param-value>

                </context-param>

                <context-param>

                          <param-name>contextConfigLocation</param-name>

                          <param-value>/WEB-INF/spring-beans.xml</param-value>

                </context-param>

                <listener>

                          <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

                </listener>

                <listener>

                          <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>

                </listener>

        <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>/faces/*</url-pattern>

        </servlet-mapping>

        <context-param>

          <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>

          <param-value>resources.application</param-value>

        </context-param>

        <context-param>

          <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>

          <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

          <param-value>client</param-value>

        </context-param>

        <context-param>

          <description>

                This parameter tells MyFaces if javascript code should be allowed in

                the rendered HTML output.

                If javascript is allowed, command_link anchors will have javascript code

                that submits the corresponding form.

                If javascript is not allowed, the state saving info and nested parameters

                will be added as url parameters.

                Default is 'true'</description>

          <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>

          <param-value>true</param-value>

        </context-param>

        <context-param>

          <description>

                If true, rendered HTML code will be formatted, so that it is 'human-readable'

                i.e. additional line separators and whitespace will be written, that do not

                influence the HTML code.

                Default is 'true'</description>

          <param-name>org.apache.myfaces.PRETTY_HTML</param-name>

          <param-value>true</param-value>

        </context-param>

        <context-param>

          <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>

          <param-value>false</param-value>

        </context-param>

        <context-param>

          <description>

                If true, a javascript function will be rendered that is able to restore the

                former vertical scroll on every request. Convenient feature if you have pages

                with long lists and you do not want the browser page to always jump to the top

                if you trigger a link or button action that stays on the same page.

                Default is 'false'

      </description>

          <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>

          <param-value>true</param-value>

        </context-param>

        <listener>

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

        </listener>

      </web-app>

       

      Any pointers on this would be appreciated. Most probably i am messing with the jar versoins or some thing else. Any help would be apreciated.