Menu

java.lang.IllegalStateException

Users
Alonso
2007-09-18
2013-04-08
  • Alonso

    Alonso - 2007-09-18

    Good evenings, on having deploied my application it gives me the following mistake:

    java.lang.IllegalStateException: No Factories configured for this Application -
    typically this is because a context listener is not setup in your web.xml.
    A typical config looks like this;
    <listener>
      <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</liste
    ner-class>
    </listener>

    i`m using myfaces
    <dependency>
            <groupId>myfaces</groupId>
            <artifactId>myfaces-jsf-api</artifactId>
            <version>1.0.9rc3</version>
    </dependency>

    my web.xml is like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <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>
            <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
        </context-param>
        <context-param>
            <param-name>com.sun.faces.verifyObjects</param-name>
            <param-value>true</param-value>
        </context-param>
        <context-param>
            <param-name>com.sun.faces.validateXml</param-name>
            <param-value>true</param-value>
        </context-param>
        <context-param>
            <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
            <param-value>client</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>
            <servlet-name>TilesServlet</servlet-name>
            <servlet-class>org.apache.struts.tiles.TilesServlet</servlet-class>
            <init-param>
                <param-name>definitions-config</param-name>
                <param-value>/WEB-INF/tiles-defs.xml</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>Faces Servlet</servlet-name>
            <url-pattern>/faces/*</url-pattern>
        </servlet-mapping>
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
        <welcome-file>
                index.jsp
            </welcome-file>
        </welcome-file-list>
        <!-- listener de spring-->
        <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
        <!-- listener jsf-spring-->
        <listener>
        <listener-class>de.mindmatters.faces.spring.context.ContextLoaderListener</listener-class>
        </listener>
    </web-app>

    is necessary to add another listener?

    thx in advance

     
    • Alonso

      Alonso - 2007-09-18

      hi everybody,

      i tried fixing the problem deleting the tomcat work directory, but it doesn`t work!

      then i tried adding to web.xml a contextListener like this:

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

      it didnt work again.

      pls help!

       
    • Alonso

      Alonso - 2007-09-19

      hi again, i resolved the problem adding to my pom.xml

      <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-api</artifactId>
            <version>1.1.4</version>
          </dependency>
          <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-impl</artifactId>
            <version>1.1.4</version>
          </dependency>

      <repositories>
          <repository>
               <releases>
                 <enabled>true</enabled>
               </releases>
               <snapshots>
                 <enabled>false</enabled>
               </snapshots>
               <id>myfaces.staging</id>
               <name>MyFaces Staging Repository</name>
               <url>http://myfaces.zones.apache.org/dist/maven-repository</url>
          </repository>
        </repositories>

      of course still having problems, other exceptions on deploying, but thats another history!

      cheers!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.