首先,这是我的设置:
1。)jboss7.1.3
2。)maven javaee6生成的项目
3。)ear,war,ejb项目格式
4。)java 7
我正在尝试使用LazyDataModel作为源创建一个DataTable组件,但无法解决以下问题:
22:28:56,419 WARN [org.jboss.modules] (MSC service thread 1-6) Failed to define class org.primefaces.model.LazyDataModel in Module "deployment.dropship-ear.ear:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/primefaces/model/LazyDataModel (Module "deployment.dropship-ear.ear:main" from Service Module Loader)
...
Caused by: java.lang.NoClassDefFoundError: javax/faces/model/DataModel
到目前为止我尝试的是(两者都不起作用):
1。)在ejb项目中添加primefaces依赖项,scope = compile
2。)在jboss7.1.3中添加primefaces模块,并为ejb和war项目添加依赖项,scope = compile | provided
请注意,我已在web和ejb项目中定义了jboss jsf-api:
<dependency>
<groupId>org.jboss.spec.javax.faces</groupId>
<artifactId>jboss-jsf-api_2.1_spec</artifactId>
<scope>provided</scope>
</dependency>
有什么建议吗?
答案 0 :(得分:0)
我能够通过添加jboss-deployment-structure.xml解决这个问题:
在ejb / pom.xml中添加primefaces依赖项,并在war / pom.xml中将其排除,如以下链接中所述:http://czetsuya-tech.blogspot.com/2013/05/how-to-use-primefaces-with-jboss-713.html