1 Reply Latest reply on Apr 27, 2007 12:56 PM by Sergey Smirnov

    Problem starting the Server

    Tobias Diederich Newbie

      Hello,
      My purpose is, to make my existing Exadel Studio pro JSF Project Ajax comliant. The project uses MyFaces components and runs on a Tomcat 5.5 Server.
      What I did is the following:
      Downloaded ajax4jsf-1.1.0.jar and copied it in the <Tomcat-HOME>/common/lib dir. Then I updated my Application Web.xml.
      Now, it looks like this:

      <?xml version="1.0"?>
      <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      <context-param>
      State saving method: "client" or "server" (= default)
      See JSF Specification 2.5.2
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>server</param-value>
      </context-param>
      <context-param>
      <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</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>
      <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
      <param-value>true</param-value>
      </context-param>
      <context-param>
      <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
      <param-value>true</param-value>
      </context-param>

      <filter-name>MyFacesExtensionsFilter</filter-name>
      <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
      <init-param>
      <param-name>maxFileSize</param-name>
      <param-value>20m</param-value>
      </init-param>


      <display-name>Ajax4jsf Filter</display-name>
      <filter-name>ajax4jsf</filter-name>
      <filter-class>org.ajax4jsf.Filter</filter-class>

      <filter-mapping>
      <filter-name>MyFacesExtensionsFilter</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
      </filter-mapping>
      <filter-mapping>
      <filter-name>MyFacesExtensionsFilter</filter-name>
      <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
      </filter-mapping>
      <filter-mapping>
      <filter-name>MyFacesExtensionsFilter</filter-name>
      <url-pattern>*.jsp</url-pattern>
      </filter-mapping>
      <filter-mapping>
      <filter-name>ajax4jsf</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
      REQUEST
      FORWARD
      INCLUDE
      </filter-mapping>

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

      <!-- Faces Servlet -->

      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>

      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.jsf</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>/faces/*</url-pattern>
      </servlet-mapping>
      <login-config>
      <auth-method>BASIC</auth-method>
      </login-config>
      </web-app>



      When I start the Server now, the following Exception is printed in the StackTrace:

      java.lang.IllegalArgumentException: Class org.ajax4jsf.framework.ajax.AjaxStateManager is no javax.faces.application.StateManager
      at org.apache.myfaces.config.FacesConfigurator.getApplicationObject(FacesConfigurator.java:536)
      at org.apache.myfaces.config.FacesConfigurator.configureApplication(FacesConfigurator.java:462)
      at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:141)
      at org.apache.myfaces.webapp.StartupServletContextListener.initFaces(StartupServletContextListener.java:69)
      at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:52)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3729)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4187)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
      at org.apache.catalina.core.StandardService.start(StandardService.java:450)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)



      This is strange, because in the javadoc, the AjaxStateManager is described as extending javax.faces.application.StateManager!!

      Any help would be great, cause i'm looking forward to use this great Ajax thing as soon as possible.
      Thx