Glassfish 4.1 - 最新 Jersey 版本

标签 glassfish classpath jersey-2.0 glassfish-4

我们想在 Glassfish 4.1 中集成最新的 Jersey 版本。

Glassfish 提供 Jersey 2.21.0 实现,因此我们将 Jersey 2.22.2 添加到 WEB-INF/lib。它可以与新版本一起使用。

但这是正确的解决方案吗? Glassfish 是否总是将库放在 WEB-INF 中,然后放在类路径中?

最佳答案

If it is not an option to modify glassfish installation, you still may force glassfish to consider the libs in your web app before the global ones. You just need to provide file glassfish-web.xml in your application along standard web.xml in WEB-INF. Set delegate="false" in the class-loader element of the glassfish-web.xml file. For more documentation, see Glassfish Deployment Guide, section C - Elements of the GlassFish Server Deployment Descriptors.

感谢 OndrejM!

关于Glassfish 4.1 - 最新 Jersey 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35769351/

相关文章:

jpa - Arquillian : Do I need domain. xml 和 arquillian.xml 用于使用 Derby DB 进行最少的 Glassfish 嵌入式测试?

java - 为什么我创建一个新域不存在主密码

java - 将 EAR 的多个实例(代表版本)部署到 Glassfish

java - 构建时找不到符号 request.getServletContext()

java - j2me导入外部jar : what classpath?

java - 使用 JPA/EclipseLink/EJB 从 Java Web 应用程序访问多个数据库

android-gradle-plugin - 警告 : [options] bootstrap class path not set in conjunction with -source 1. 7 1 警告

java - 当 @Context 用于 setter/field/constructor 注入(inject)时,在 Jersey 过滤器之前调用 HK2 工厂

java - Jersey 2.7 和 Dropwizard 0.7 - 支持吗?

java - Ehcache 与 Spring + Jersey