我试图从.war归档文件中提取Omnifaces库到JBoss模块,但是,存在org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type org.omnifaces.cdi.ViewScoped
的问题。应用程序成功部署,但在第一次加载页面时中断。作为JBoss AS7模块的Omnifaces
我读过BalusC关于.wars打包成.ear(http://balusc.blogspot.com/2013_10_01_archive.html)问题的报告,但我不确定它是否也适用于这种情况,因为我们只有.war。
当Omnifaces库通过的Maven列入的.war的lib文件夹作为一个编译时依赖的一切完美的作品:
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>1.7</version>
</dependency>
设置的依赖所提供的范围,创造一个JBoss模块和追加的JBoss部署结构:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.omnifaces" export="true" meta-inf="import"/>
<!-- i tried multiple export and meta-inf combinations -->
</dependencies>
</deployment>
</jboss-deployment-structure>
module.xml:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.omnifaces">
<resources>
<resource-root path="omnifaces-1.7.jar"/>
</resources>
<dependencies>
<module name="javaee.api"/>
<module name="javax.api"/>
<module name="javax.faces.api" />
</dependencies>
</module>
以这种方式使用Omnifaces作为JBoss模块是否可行?