2010-07-25 82 views
0

我使用的是jetty 7的嵌入式版本,以便在来自another thread的建议中使用Apache MyFaces 1.2在junit 4测试类中加载Web应用程序。使用Jetty 7嵌入式+ Myfaces 1.2配置没有工厂

运行测试时,我得到这个错误。

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; 

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

此应用程序适用于Tomcat,weblogic甚至oc4j!

我如何得到这个与码头一起工作?

+0

codehaus http://jira.codehaus.org/browse/JETTY-170有个问题 – JavaRocky 2010-07-25 22:27:58

回答

0

我通过添加在WEB-INF/lib目录中具有.tld文件的myfaces-impl jar来解决此问题。

相关问题