8 Replies Latest reply on Sep 23, 2010 7:38 AM by Karsten Wutzke

    Manually configuring Seam + Facelets on Tomcat 6: ConfigurationException caused by InstantiationException

    Karsten Wutzke Expert

      I'm manually configuring Tomcat 6 with Seam 2.2.0 GA. I have done everything as in Dan Allen's book Seam in Action (Ch.3., pages 83-87):


      web.xml:


        <context-param>
          <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
          <param-value>.xhtml</param-value>
        </context-param>
      
        ...
      
        <!-- Faces Servlet -->
        <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>*.seam</url-pattern>
        </servlet-mapping>
        
        <!-- Seam Listener -->
        <listener>
          <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
        </listener>





      faces-config.xml:



      <faces-config version="1.2"
                    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/javaee/web-facesconfig_1_2.xsd">
      
        <!-- Facelets -->
        <application>
          <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
        </application>
          
      </faces-config>



      I did the above, but I keep getting an exception on deploying my webapp:


      SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
      com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org.jboss.seam.jsf.SeamApplicationFactory
          at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:213)
          at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:196)
          at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
          at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
          at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
          at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
          at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
          at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
          at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1345)
          at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
          at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
          at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
          at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
          at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
          at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
          at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.InstantiationException: org.jboss.seam.jsf.SeamApplicationFactory
          at java.lang.Class.newInstance0(Unknown Source)
          at java.lang.Class.newInstance(Unknown Source)
          at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:537)
          at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:405)
          at javax.faces.FactoryFinder.access$400(FactoryFinder.java:135)
          at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:717)
          at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:239)
          at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:186)
          at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:131)
          at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:203)
          ... 17 more



      Does anyone know what I'm doing wrong? Which JSF and Facelets version am I using with Seam 2.2.0 GA? faces-config.xml header wrong?


      Feel free to guess, I'm pretty much out of ideas.


      Karsten