gpt4 book ai didi

jersey - jboss 6.3.0 : decent way to remove resteasy and use jersey

转载 作者:行者123 更新时间:2023-12-02 02:11:56 25 4
gpt4 key购买 nike

我正在使用 Jersey 。

这是我的 jboss 部署结构:

<?xml version="1.0" encoding="UTF-8"  ?>  
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclusions>
<module name="org.jboss.resteasy.resteasy-atom-provider" />
<module name="org.jboss.resteasy.resteasy-cdi" />
<module name="org.jboss.resteasy.resteasy-jaxrs" />
<module name="org.jboss.resteasy.resteasy-jaxb-provider" />
<module name="org.jboss.resteasy.resteasy-jackson-provider" />
<module name="org.jboss.resteasy.resteasy-jsapi" />
<module name="org.jboss.resteasy.resteasy-multipart-provider" />
<module name="org.jboss.resteasy.async-http-servlet-30" />
<module name="javax.ws.rs.api" />
</exclusions>

<exclude-subsystems>
<subsystem name="resteasy" />
<subsystem name="webservices" />
<subsystem name="jaxrs" />
</exclude-subsystems>
</deployment>
</jboss-deployment-structure>

仅此一点是行不通的。我不得不发表评论

<resource-root path="jboss-jaxrs-api_1.1_spec-1.0.1.Final-redhat-2.jar"/>

jbossHOME\modules\system\layers\base\javax\ws\rs\api\main\module.xml。

现在rest服务工作正常,但是通过注释该行,我为服务器中的每个应用程序禁用resteasy!这是一个 hack,而不是一个正确的解决方案。有没有一种不错的方法可以仅针对给定的应用程序禁用resteasy,而无需触及常规服务器配置?

谢谢

最佳答案

在 JBoss 6 或 7 AS 中,resteasy 由 JavaEE 模块作为依赖模块加载。大多数时候人们会陷入困境,因为我们不能排除 JavaEE。但是,可以排除 JavaEE 并包含 JavaEE 应该加载的模块(除了我们不需要的模块)。

欲了解更多详情,您可以查看这里Foolproof method of excluding resteasy...

来自同一位置的示例 jboss-deployment-struct.xml(位于 WEB-INF/中):

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclude-subsystems>
<subsystem name="jaxrs" />
<subsystem name="webservices" />
<subsystem name="resteasy" />
</exclude-subsystems>
<exclusions>
<module name="javaee.api" />
<module name="javax.ws.rs.api" />
<module name="org.jboss.as.jaxrs" />
<module name="org.jboss.resteasy.resteasy-jaxrs" />
<module name="org.jboss.resteasy.resteasy-cdi" />
<module name="org.jboss.resteasy.jackson-provider" />
<module name="org.jboss.resteasy.resteasy-atom-provider" />
<module name="org.jboss.resteasy.resteasy-hibernatevalidator-provider" />
<module name="org.jboss.resteasy.resteasy-jaxb-provider" />
<module name="org.jboss.resteasy.resteasy-jettison-provider" />
<module name="org.jboss.resteasy.resteasy-jsapi" />
<module name="org.jboss.resteasy.resteasy-multipart-provider" />
<module name="org.jboss.resteasy.resteasy-yaml-provider" />
<module name="org.codehaus.jackson.jackson-core-asl" />
<module name="org.codehaus.jackson.jackson-jaxrs" />
<module name="org.codehaus.jackson.jackson-mapper-asl" />
<module name="org.codehaus.jackson.jackson-xc" />
<module name="org.codehaus.jettison" />
<module name="org.jboss.as.webservices.*" />
<module name="org.jboss.ws.*" />
</exclusions>

<dependencies>
<module name="javax.activation.api" export="true" />
<module name="javax.annotation.api" export="true" />
<!-- <module name="javax.ejb.api" export="true" />
<module name="javax.el.api" export="true" /> -->
<module name="javax.enterprise.api" export="true" />
<module name="javax.enterprise.deploy.api" export="true" />
<module name="javax.inject.api" export="true" />
<module name="javax.interceptor.api" export="true" />
<!-- <module name="javax.jms.api" export="true" />
<module name="javax.jws.api" export="true" />
<module name="javax.mail.api" export="true" />
<module name="javax.management.j2ee.api" export="true" /> -->
<module name="javax.persistence.api" export="true" />
<module name="javax.resource.api" export="true" />
<!-- <module name="javax.rmi.api" export="true" />
<module name="javax.security.auth.message.api" export="true" />
<module name="javax.security.jacc.api" export="true" /> -->
<module name="javax.servlet.api" export="true" />
<module name="javax.servlet.jsp.api" export="true" />
<module name="javax.transaction.api" export="true" />
<module name="javax.validation.api" export="true" />

<!-- <module name="javax.ws.rs.api" export="true" services="export" /> -->

<module name="javax.xml.bind.api" export="true" />
<module name="javax.xml.registry.api" export="true" />
<module name="javax.xml.soap.api" export="true" />
<module name="javax.xml.ws.api" export="true" />

<!-- This one always goes last. -->
<module name="javax.api" export="true" />
</dependencies>

</deployment>
</jboss-deployment-structure>

关于jersey - jboss 6.3.0 : decent way to remove resteasy and use jersey,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31329767/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com