我正在使用JSF + Spring + Hibernate + TomEE 我的应用程序运行良好。因为我正在使用primefaces 4.0并决定使用omniface FullAjaxExceptionHandler。我在我的项目中执行了以下步骤
1)在 faces-config.xml
中添加工厂<factory>
<exception-handler-factory>org.omnifaces.exceptionhandler.FullAjaxExceptionHandlerFactory</exception-handler-factory>
</factory>
点击此处查看我的faces-config.xml
2)在 web.xml
中添加以下条目<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/WEB-INF/errorpages/expired.xhtml</location>
</error-page>
<error-page>
<exception-type>java.sql.SQLException</exception-type>
<location>/WEB-INF/errorpages/database.xhtml</location>
</error-page>
<error-page>
<exception-type>java.lang.RuntimeException</exception-type>
<location>/WEB-INF/errorpages/bug.xhtml</location>
</error-page>
<error-page>
<exception-type>org.omnifaces.showcase.exceptionhandlers.EpicFailException</exception-type>
<location>/WEB-INF/errorpages/epicfail.xhtml</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/WEB-INF/errorpages/500.xhtml</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/WEB-INF/errorpages/404.xhtml</location>
</error-page>
<error-page>
<error-code>400</error-code>
<location>/WEB-INF/errorpages/400.xhtml</location>
</error-page>
点击此处查看我的web.xml
3)在 pom.xml
中添加依赖项<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>2.1</version>
</dependency>
点击此链接查看我的pom.xml
之后我运行服务器 TomEE ,它在控制台中显示以下异常
SEVERE: Unable to deploy collapsed ear in war StandardEngine[Catalina].StandardHost[localhost].StandardContext[/vanter]
org.apache.openejb.OpenEJBException: Can't find resource for class com.vs.erp.dao.template.GenericDAOImpl#sessionFactory. (No provider available for resource-ref id with type 'org.hibernate.SessionFactory' for 'vanter.Comp1804974291'.)
at org.apache.openejb.config.AutoConfig.processResourceRef(AutoConfig.java:1153)
点击查看详细信息Complete Console log
任何更新 / 解决方案,我错过了什么?为什么omnifaces会影响SessionFactory?