0

Jboss 7.1.1我正在使用and设置 OAuth 2.0 服务器Resteasy 3.0-beta-3。我遵循了官方文档,最终设法构建了一个简单的应用程序,该应用程序使用DatabaseServerLoginModule.

当我把战争放在耳朵里时,问题就出现了。当我重新部署应用程序时,我看到了这个错误:

13:32:58,336 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.subunit."JauBM-EAR.ear"."JauBM-WEB.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."JauBM-EAR.ear"."JauBM-WEB.war".INSTALL: Failed to process phase INSTALL of subdeployment "JauBM-WEB.war" of deployment "JauBM-EAR.ear"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018096: Error instantiating container component: org.jboss.resteasy.skeleton.key.as7.OAuthAuthenticationServerValve
    at org.jboss.as.web.deployment.WarDeploymentProcessor.getInstance(WarDeploymentProcessor.java:386)
    at org.jboss.as.web.deployment.WarDeploymentProcessor.processDeployment(WarDeploymentProcessor.java:210)
    at org.jboss.as.web.deployment.WarDeploymentProcessor.deploy(WarDeploymentProcessor.java:114)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    ... 5 more
Caused by: java.lang.ClassNotFoundException: org.jboss.resteasy.skeleton.key.as7.OAuthAuthenticationServerValve from [Module "deployment.JauBM-EAR.ear.JauBM-WEB.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
    at org.jboss.as.web.deployment.WarDeploymentProcessor.getInstance(WarDeploymentProcessor.java:378)
    ... 8 more

我错过了什么?

4

1 回答 1

3

我弄清楚了问题所在,所以我决定回答这个问题,以防有人遇到同样的问题。解决方案是移动jboss-deployment-structure.xmlEAR 文件中的文件,并根据以下内容进行更改:

JauBM-Oauth/WebContent/WEB-INF/jboss-deployment-structure.xml(已删除)

<jboss-deployment-structure>
    <deployment>
        <dependencies>
            <module name="org.jboss.resteasy.resteasy-jaxrs" services="import"/>
            <module name="org.jboss.resteasy.resteasy-jackson-provider" services="import"/>
            <module name="org.jboss.resteasy.skeleton-key"/>
        </dependencies>
    </deployment>
</jboss-deployment-structure>

EAR/META-INF/jboss-deployment-structure.xml(创建)

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
    <sub-deployment name="JauBM-Oauth.war">
        <dependencies>
            <module name="org.jboss.resteasy.resteasy-jaxrs" services="import"
                export="true" />
            <module name="org.jboss.resteasy.resteasy-jackson-provider"
                services="import" export="true" />
            <module name="org.jboss.resteasy.skeleton-key" export="true" />
        </dependencies>
    </sub-deployment>
</jboss-deployment-structure>
于 2013-02-13T15:35:53.357 回答