2010-07-25 67 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來解決此問題。

相關問題