Menu

IllegalArgumentException JSF-Spring

Users
vizible
2007-08-13
2013-04-08
  • vizible

    vizible - 2007-08-13

    Hi,
       I don't know if somebody can help me through this problem or not. I am getting an IllegalArgumentException, I am using Tomcat 5.5.20 and using all the binaries from the JSF-Spring4.0.3zip file. I am assuming it bundles all the required spring and my faces files. Afetr looking at the all ths source code it is complaing about the faces factory initializations. Below is the error log, web.xml and faces-config.xml.

    I am pulling my hair out of this. Something this simple shouldn't be too hard to integrate.

    Any help will be appreciated.

    Thanks in Advance.

    ~pk

    Aug 13, 2007 12:50:49 AM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Exception sending context initialized event to listener instance of class de.mindmatters.faces.spring.context.ContextLoaderListener
    java.lang.IllegalArgumentException: Faces configuration not loaded yet. Please configure your faces implementation before jsf-spring starts its configuration!
        at org.springframework.util.Assert.notNull(Assert.java:112)
        at de.mindmatters.faces.spring.context.ContextLoader.validateFacesConfiguration(ContextLoader.java:205)
        at de.mindmatters.faces.spring.context.ContextLoader.initWebApplicationContext(ContextLoader.java:152)
        at de.mindmatters.faces.spring.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:61)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:904)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:867)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
        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(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
    Aug 13, 2007 12:50:49 AM org.apache.catalina.core.ApplicationContext log
    INFO: Closing ConfigWebApplicationContext
    Aug 13, 2007 12:50:49 AM org.apache.catalina.core.ApplicationContext log
    INFO: Closing Spring root WebApplicationContext

    My Web.xml looks 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>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.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>

    <listener>
    <listener-class>de.mindmatters.faces.spring.context.ContextLoaderListener
    </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>*.jsf</url-pattern>
    </servlet-mapping>
    </web-app>

    faces-config.xml

    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE faces-config PUBLIC
        "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
        "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>

     
    <managed-bean>
        <managed-bean-name>uiBean</managed-bean-name>
        <managed-bean-class>test.UiBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
        <managed-property>
            <property-name>timeService</property-name>
            <value>#{timeService}</value>
        </managed-property>
    </managed-bean>

    </faces-config>

     
    • Anna Manukyan

      Anna Manukyan - 2007-09-13

      Hello!

      I'm new to jsf-spring. I'm trying to use jsf-spring4.0.3. I have the same problem. And here is my code.

      web.xml
      ------------------
      <context-param>
              <param-name>contextConfigLocation</param-name>
              <param-value>/WEB-INF/appContexts/appContext.xml</param-value>
          </context-param>
          <context-param>
              <param-name>javax.faces.CONFIG_FILES</param-name>
              <param-value>faces-config.xml</param-value>
          </context-param>
      <listener>
              <listener-class>
                  de.mindmatters.faces.spring.context.ContextLoaderListener
              </listener-class>
          </listener>
      <servlet-name>springFaces</servlet-name>
          <servlet-class>de.mindmatters.faces.spring.context.servlet.FacesDispatcherServlet</servlet-class>
          </servlet>
      <servlet-mapping>
              <servlet-name>springFaces</servlet-name>
              <url-pattern>/admin/targets/*</url-pattern>
          </servlet-mapping>

      faces-config.xml
      -------------------
      <faces-config>
          <managed-bean>
              <managed-bean-name>userTarget</managed-bean-name>
              <managed-bean-class>
                  UserTargetData
              </managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
          </managed-bean>
      </faces-config>

      spring-servlet.xml
      ----------------------
      <beans>
          <bean id="userTargetController" class="com.be2.target.UserTargetController"/>

          <bean id="userTargetValidator"
              class="UserTargetValidator" />
             
          <bean id="targetUrlMapping"
              class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
              <property name="mappings">
                  <props>
                      <prop key="/user_targets.jsp">
                          userTargetController
                      </prop>
                  </props>
              </property>
          </bean>
      </beans>

      and my UserTargetController extends de.mindmatters.faces.spring.context.servlet.controller.SimpleActionController.

      When I run jboss server (jboss-4.0.1) I get the following:

      StandardContext[] Validating faces configuration
      StandardContext[] Exception sending context initialized event to listener instance of de.mindmatters.faces.spring.context.ContextLoaderListener
      java.lang.IllegalArgumentException: Faces configuration not loaded yet. Please configure your faces implementation before jsf-spring starts its configuration ...

      Please help me. I really need to solve this problem.

      Thanks, andy20.

       

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.