我正在尝试将Arquillian + Selenium测试添加到我的jsf应用程序中。问题是,当我尝试运行测试时(在tomcat 7上,使用命令mvn test
),浏览器将打开并显示错误:HTTP Status 500 - Could not find backup for factory javax.faces.context.FacesContextFactory
。
我做了一些搜索,发现将com.sun.faces.config.ConfigureListener
添加到我的web.xml可以提供帮助。它有帮助 - 测试运行没有错误,但我得到了很多关于表单的警告:
WARNING: JSF1074: Managed bean named '<myBeanName>' has already been registered. Replacing existing managed bean class type <Path to bean class> with <Path to bean class>
两条路径都相同。如果没有ConfigureListener,应用程序将运行而不会出现错误和警告(但测试失败)。
我正在使用: