在 Jboss AS 7 上部署 Jersey webapp [英] Deploying a Jersey webapp on Jboss AS 7

查看:29
本文介绍了在 Jboss AS 7 上部署 Jersey webapp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前在 Jboss AS 4/5 上运行一些 webapp,我正在测试迁移到 jboss7.当我尝试在 JBoss AS 7 上部署基于球衣的 webapp(带有独立预览配置文件的完整配置文件)时,我得到:

Currently running some webapps on Jboss AS 4/5 and I am testing migration to jboss7. When I try to deploy a jersey based webapp on JBoss AS 7 (full profile with standalone-preview config file), I get:

org.jboss.as.server.deployment.DeploymentUnitProcessingException: Only one JAX-RS Application Class allowed.

我对它进行了一些搜索,发现 RestEasy 是嵌入到 Application Server 中的默认 JAX-RS 实现.http://community.jboss.org/message/579996https://issues.jboss.org/browse/JBAS-8830) 提到 RestEasy 部署器接管.

I've done a bit of hunting around on it and found that RestEasy is the default JAX-RS implementation embedded into Application Server. Posts like http://community.jboss.org/message/579996 and https://issues.jboss.org/browse/JBAS-8830) mention that the RestEasy deployer takes over.

在 AS 6 中,删除部署器似乎更容易,而我还没有看到任何适用于 AS 7 的解决方案.

In AS 6, it seems easier to remove the deployer whereas I have not seen any solutions for AS 7.

推荐答案

在这篇文章中已经提到过:https://community.jboss.org/message/744530#744530 ,你可以只要求resteasy模块不要扫描你的webapp中的其他JAX RS实现;只需将其添加到您的 web.xml 中:

it has already been mentioned in this post : https://community.jboss.org/message/744530#744530 , you can just ask the resteasy module to not scan for other JAX RS implementations in your webapp; just add this to your web.xml :

<context-param>
    <param-name>resteasy.scan</param-name>
    <param-value>false</param-value>
</context-param>
<context-param>
    <param-name>resteasy.scan.providers</param-name>
    <param-value>false</param-value>
</context-param>
<context-param>
    <param-name>resteasy.scan.resources</param-name>
    <param-value>false</param-value>
</context-param>

对我来说很好用

这篇关于在 Jboss AS 7 上部署 Jersey webapp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆