1 Reply Latest reply on Nov 5, 2007 4:24 PM by Maykell Frometa

    Myfaces and JBoss 4.2.x

    Maykell Frometa Newbie

      Hi all, i had can't deploy an old Myfaces-EJB3 application in JBoss 4.2.x, i've been looking for information about it and every body say that the problem is that JBoss 4.2.x come with JSF RI attached and when you deploy an application with its own JSF implementation like my case the server rise an exception because it found 2 JSF implementations.

      The question is:
      ?An old application that uses Myfaces can't be deployed in JBoss 4.2.x?

      If it is posible, what steps i most to follow in order to deploy my application in JBoss 4.2.x?

      The error emerged when i was trying to integrate Seam in my project, this is the error i get when trying to deploy my application:

      23:51:06,875 INFO [STDOUT] 23:51:06,859 ERROR [StartupServletContextListener] Error initializing ServletContext
      java.lang.IllegalArgumentException: Class org.jboss.seam.jsf.SeamApplicationFactory is no javax.faces.application.ApplicationFactory
      at javax.faces.FactoryFinder.newFactoryInstance(FactoryFinder.java:132)
      at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:107)
      at org.apache.myfaces.config.FacesConfigurator.configureApplication(FacesConfigurator.java:439)

      If i let the Myfaces jar files in web-inf/lib but delete the myfaces listener entry from web.xml the application get the following error:

      00:27:19,234 INFO [STDOUT] 00:27:19,234 ERROR [[/jsfTest]] StandardWrapper.Throwable
      java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions!
      If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml.
      A typical config looks like this;


      at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:90)
      at javax.faces.webapp.FacesServlet.init(FacesServlet.java:88)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4069)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4373)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
      at org.apache.catalina.

      If i eliminate the myfaces jar, and the myfaces listener declaration in web.xml the application works well, then the error is exclusively related to the use of Myfaces, i think some kind of conflict between Seam listener and Myfaces Listener, but i don't know why and how solve this.

      This is my web.xml:
      <?xml version="1.0"?>
      * Copyright 2004 The Apache Software Foundation.
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
      * You may obtain a copy of the License at
      * http://www.apache.org/licenses/LICENSE-2.0
      * Unless required by applicable law or agreed to in writing, software
      * distributed under the License is distributed on an "AS IS" BASIS,
      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      * See the License for the specific language governing permissions and
      * limitations under the License.
      <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">


      State saving method: "client" or "server" (= default)
      See JSF Specification 2.5.2


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

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

      <!-- Listener, that does all the startup work (configuration, init). -->



      <!-- Faces Servlet -->

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

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

      I'm using JBoss 4.2.1 GA, seam 1.2.0.AP and Myfaces 1.1.4

      I hope you can help me