我使用Jax-RS创建了一个简单的JEE rest应用程序,同时在PicketLink上搜索安全实现,看起来非常棒。 我能够成功地在我的本地Wildfly实例上部署authorization-rs-rbac示例,之后我尝试将它集成到我自己的项目中,但是我继续在部署时从WildFly获得类未找到的异常。
我的POM.xml依赖管理是:
<dependencyManagement>
<dependencies>
<!-- JBoss distributes a complete set of Java EE 6 APIs including a Bill
of Materials (BOM). A BOM specifies the versions of a "stack" (or a collection)
of artifacts. We use this here so that we always get the correct versions
of artifacts. Here we use the jboss-javaee-6.0-with-tools stack (you can
read this as the JBoss stack of the Java EE 6 APIs, with some extras tools
for your project, such as Arquillian for testing) and the jboss-javaee-6.0-with-hibernate
stack you can read this as the JBoss stack of the Java EE 6 APIs, with extras
from the Hibernate family of projects) -->
<dependency>
<groupId>org.jboss.bom</groupId>
<artifactId>jboss-javaee-6.0-with-tools</artifactId>
<version>${version.org.jboss.bom}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.bom</groupId>
<artifactId>jboss-javaee-6.0-with-hibernate</artifactId>
<version>${version.org.jboss.bom}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.bom</groupId>
<artifactId>jboss-javaee-6.0-with-security</artifactId>
<version>${version.jboss.bom.eap}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.bom.wfk</groupId>
<artifactId>jboss-javaee-6.0-with-deltaspike</artifactId>
<version>2.4.0-redhat-1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
我的依赖性也是:
<!-- Import the PicketLink API, we deploy this as library with the application,
and can compile against it -->
<dependency>
<groupId>org.picketlink</groupId>
<artifactId>picketlink-api</artifactId>
</dependency>
<!-- Import the PicketLink implementation, we deploy this as library with
the application, but can't compile against it -->
<dependency>
<groupId>org.picketlink</groupId>
<artifactId>picketlink-impl</artifactId>
<scope>runtime</scope>
</dependency>
<!-- Deltaspike API. We use compile scope as we need compile against its
API -->
<dependency>
<groupId>org.apache.deltaspike.core</groupId>
<artifactId>deltaspike-core-api</artifactId>
<scope>compile</scope>
</dependency>
<!-- Deltaspike Impl. we use runtime scope as we need its implementation
dependencies only on runtime -->
<dependency>
<groupId>org.apache.deltaspike.core</groupId>
<artifactId>deltaspike-core-impl</artifactId>
<scope>runtime</scope>
</dependency>
<!-- Deltaspike Security Module API. We use compile scope as we need to
compile against its API -->
<dependency>
<groupId>org.apache.deltaspike.modules</groupId>
<artifactId>deltaspike-security-module-api</artifactId>
<scope>compile</scope>
</dependency>
<!-- Deltaspike Security Impl. we use runtime scope as we need its implementation
dependencies only on runtime -->
<dependency>
<groupId>org.apache.deltaspike.modules</groupId>
<artifactId>deltaspike-security-module-impl</artifactId>
<scope>runtime</scope>
</dependency>
我还定义了一个拦截器,如上面提到的例子所示
<interceptors>
<class>org.apache.deltaspike.security.impl.extension.SecurityInterceptor</class>
</interceptors>
我从服务器获取的错误是:
17:18:22,470 ERROR [org.jboss.msc.service.fail](MSC服务主题1-10)MSC000001:无法启动服务jboss.deployment.unit。&#34; Project.war&#34; .POST_MODULE:服务jboss.deployment.unit中的org.jboss.msc.service.StartException。&#34; Project.war&#34; .POST_MODULE:JBAS018733:无法处理部署的阶段POST_MODULE&#34; Project.war&# 34; 在org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166)[wildfly-server-8.0.0.CR1.jar:8.0.0.CR1] at org.jboss.msc.service.ServiceControllerImpl $ StartTask.startService(ServiceControllerImpl.java:1948)[jboss-msc-1.2.0.CR1.jar:1.2.0.CR1] 在org.jboss.msc.service.ServiceControllerImpl $ StartTask.run(ServiceControllerImpl.java:1881)[jboss-msc-1.2.0.CR1.jar:1.2.0.CR1] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)[rt.jar:1.7.0_25] at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)[rt.jar:1.7.0_25] 在java.lang.Thread.run(未知来源)[rt.jar:1.7.0_25] 引起:java.lang.RuntimeException:JBAS018757:获取类com.gr.project.authentication.IDMInitializer的反射信息时出错,其中包含ClassLoader ModuleClassLoader for Module&#34; deployment.Project.war:main&#34;来自服务模块加载器 at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:72)[wildfly-server-8.0.0.CR1.jar:8.0.0.CR1] at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58) at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:107) at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:92) at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:77) 在org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159)[wildfly-server-8.0.0.CR1.jar:8.0.0.CR1] ......还有5个 引起:java.lang.NoClassDefFoundError:org / picketlink / idm / model / IdentityType at java.lang.Class.getDeclaredFields0(Native Method)[rt.jar:1.7.0_25] at java.lang.Class.privateGetDeclaredFields(Unknown Source)[rt.jar:1.7.0_25] at java.lang.Class.getDeclaredFields(Unknown Source)[rt.jar:1.7.0_25] at org.jboss.as.server.deployment.reflect.ClassReflectionIndex。(ClassReflectionIndex.java:57)[wildfly-server-8.0.0.CR1.jar:8.0.0.CR1] at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:68)[wildfly-server-8.0.0.CR1.jar:8.0.0.CR1] ......还有10个 引起:java.lang.ClassNotFoundException:org.picketlink.idm.model.IdentityType来自[Module&#34; deployment.Project.war:main&#34;来自服务模块加载器] 在org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197)[jboss-modules.jar:1.3.0.Final] 在org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443)[jboss-modules.jar:1.3.0.Final] 在org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431)[jboss-modules.jar:1.3.0.Final] 在org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373)[jboss-modules.jar:1.3.0.Final] 在org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118)[jboss-modules.jar:1.3.0.Final] ......还有15个 17:18:22,475 ERROR [org.jboss.as.controller.management-operation](DeploymentScanner-threads - 2)JBAS014613:操作(&#34;部署&#34;)失败 - 地址:([(&#34;部署&#34; =&gt;&#34; Project.war&#34;)]) - 失败描述:{&#34; JBAS014671:失败的服务&#34; =&GT; {&#34; jboss.deployment.unit \&#34; Project.war \&#34; .POST_MODULE&#34; =&GT; &#34; org.jboss.msc.service.StartException in service jboss.deployment.unit。\&#34; Project.war \&#34; .POST_MODULE:JBAS018733:无法处理部署的POST_MODULE阶段\&#34 ; Project.war \&#34; 引起:java.lang.RuntimeException:JBAS018757:使用ClassLoader获取模块com.gr.project.authentication.IDMInitializer的反射信息时出错Module && 34; deployment.Project.war:main \&#34;来自服务模块加载器 引起:java.lang.NoClassDefFoundError:org / picketlink / idm / model / IdentityType 引起:java.lang.ClassNotFoundException:org.picketlink.idm.model.IdentityType来自[Module \&#34; deployment.Project.war:main \&#34;来自服务模块加载器]&#34;}} 17:18:22,511 INFO [org.jboss.as.server](DeploymentScanner-threads - 2)JBAS018559:已部署&#34; Project.war&#34; (runtime-name:&#34; Project.war&#34;) 17:18:22,512 INFO [org.jboss.as.controller](DeploymentScanner-threads - 2)JBAS014774:服务状态报告 JBAS014777:无法启动的服务:服务jboss.deployment.unit。&#34; Project.war&#34; .POST_MODULE:服务jboss.deployment.unit中的org.jboss.msc.service.StartException。&#34;项目.war&#34; .POST_MODULE:JBAS018733:无法处理部署的阶段POST_MODULE&#34; Project.war&#34;
这似乎是一个配置问题,但我真的无法查明错误,包含了PicketLink,我没有编译错误。
过去是否有人遇到过这个问题?