2 Replies Latest reply on May 15, 2009 9:10 AM by Daniel Knott

    JSFUnit CONFIGURATION FAILED! org.jboss.jsfunit.context.JSFU

    Daniel Knott Newbie

      Hi,

      i have a problem with jsfunit in my jsf project. i developed an jsf web application with jsf 1.2 sun and tomcat 6.0.18. now i want to test the jsf pages.

      i did the steps from getting started part, but i get the following exception after starting tomcat:

      Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
      com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org.jboss.jsfunit.context.JSFUnitFacesContextFactory
       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:3843)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
       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:525)
       at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
       at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
       at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
       at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
       at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
       at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
       at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
       at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
       at org.apache.catalina.core.StandardService.start(StandardService.java:516)
       at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
       at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
       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:597)
       at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
       at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
      Caused by: java.lang.InstantiationException: org.jboss.jsfunit.context.JSFUnitFacesContextFactory
       at java.lang.Class.newInstance0(Class.java:340)
       at java.lang.Class.newInstance(Class.java:308)
       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)
       ... 25 more
      


      I use the jsf-impl.jar and jsf-api.jar file in /lib folder for jsf. when i delete the jsf-api.jar file the exception is not available but then a got another exception that tomcat could not find facescontext.

      these are my jar files from tomcat /lib folder

      /usr/local/tomcat/lib/annotations-api.jar
      /usr/local/tomcat/lib/ant-1.5.4.jar
      /usr/local/tomcat/lib/aspectjrt-1.2.1.jar
      /usr/local/tomcat/lib/cactus-13-1.7.1.jar
      /usr/local/tomcat/lib/cactus-ant-13-1.7.1.jar
      /usr/local/tomcat/lib/cargo-0.5.jar
      /usr/local/tomcat/lib/catalina.jar
      /usr/local/tomcat/lib/catalina-ant.jar
      /usr/local/tomcat/lib/catalina-ha.jar
      /usr/local/tomcat/lib/catalina-tribes.jar
      /usr/local/tomcat/lib/commons-codec-1.3.jar
      /usr/local/tomcat/lib/commons-collections-3.2.jar
      /usr/local/tomcat/lib/commons-httpclient-3.1.jar
      /usr/local/tomcat/lib/commons-io-1.4.jar
      /usr/local/tomcat/lib/commons-lang-2.4.jar
      /usr/local/tomcat/lib/commons-logging-1.1.1.jar
      /usr/local/tomcat/lib/cssparser-0.9.5.jar
      /usr/local/tomcat/lib/el-api.jar
      /usr/local/tomcat/lib/htmlunit-2.4.jar
      /usr/local/tomcat/lib/htmlunit-core-js-2.4.jar
      /usr/local/tomcat/lib/jasper.jar
      /usr/local/tomcat/lib/jasper-el.jar
      /usr/local/tomcat/lib/jasper-jdt.jar
      /usr/local/tomcat/lib/jboss-jsfunit-core-1.0.0.GA.jar
      /usr/local/tomcat/lib/jsf-api.jar
      /usr/local/tomcat/lib/jsf-impl.jar
      /usr/local/tomcat/lib/jsp-api.jar
      /usr/local/tomcat/lib/jstl-1.2.jar
      /usr/local/tomcat/lib/junit-3.8.1.jar
      /usr/local/tomcat/lib/nekohtml-1.9.9.jar
      /usr/local/tomcat/lib/sac-1.3.jar
      /usr/local/tomcat/lib/servlet-api.jar
      /usr/local/tomcat/lib/standard.jar
      /usr/local/tomcat/lib/tomcat-coyote.jar
      /usr/local/tomcat/lib/tomcat-dbcp.jar
      /usr/local/tomcat/lib/tomcat-i18n-es.jar
      /usr/local/tomcat/lib/tomcat-i18n-fr.jar
      /usr/local/tomcat/lib/tomcat-i18n-ja.jar

      in web.xml in my project i do:


      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
       <display-name>xBlogThesis</display-name>
       <welcome-file-list>
       <welcome-file>index.html</welcome-file>
       <welcome-file>index.htm</welcome-file>
       <welcome-file>index.jsp</welcome-file>
       <welcome-file>default.html</welcome-file>
       <welcome-file>default.htm</welcome-file>
       <welcome-file>default.jsp</welcome-file>
       </welcome-file-list>
      
      
      
      
       <servlet>
       <servlet-name>Faces Servlet</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet>
      
       <filter>
       <filter-name>JSFUnitFilter</filter-name>
       <filter-class>org.jboss.jsfunit.framework.JSFUnitFilter</filter-class>
       </filter>
      
       <filter-mapping>
       <filter-name>JSFUnitFilter</filter-name>
       <servlet-name>ServletTestRunner</servlet-name>
       </filter-mapping>
      
       <filter-mapping>
       <filter-name>JSFUnitFilter</filter-name>
       <servlet-name>ServletRedirector</servlet-name>
       </filter-mapping>
      
       <servlet>
       <servlet-name>ServletRedirector</servlet-name>
       <servlet-class>org.jboss.jsfunit.framework.JSFUnitServletRedirector</servlet-class>
       </servlet>
      
       <servlet>
       <servlet-name>ServletTestRunner</servlet-name>
       <servlet-class>org.apache.cactus.server.runner.ServletTestRunner</servlet-class>
       </servlet>
      
       <servlet-mapping>
       <servlet-name>ServletRedirector</servlet-name>
       <url-pattern>/ServletRedirector</url-pattern>
       </servlet-mapping>
      
       <servlet-mapping>
       <servlet-name>ServletTestRunner</servlet-name>
       <url-pattern>/ServletTestRunner</url-pattern>
       </servlet-mapping>
      
      
       <servlet-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>/faces/*</url-pattern>
       </servlet-mapping>
      </web-app>
      


      I hope somebody could help my.

      thanks in advance.