GrizzlyHttpServerFactory.createHttpServer:无法执行操作:在 org.glassfish.jersey.server.wadl.processor.WadlModelProcessor 上创建

GrizzlyHttpServerFactory.createHttpServer: Unable to perform operation: create on org.glassfish.jersey.server.wadl.processor.WadlModelProcessor

问题

当我尝试使用 GrizzlyHttpServerFactory.createHttpServer 时,我得到一个“WARNING: Unknown HK2 failure detected:”,然后在 "MultiException" 中出现两个错误:

我试过了

我不熟悉泽西岛,但我有:

深入

我正在使用的资源配置:

public class MyResourceConfig extends ResourceConfig {

    public MyResourceConfig(){
        register(CORSResponseFilter.class);

        register(MyAPIPoint.class);
    }
}

包含两个 类 正在注册,没有其他内容。

截断错误堆栈跟踪:

WARNING: The following warnings have been detected: WARNING: Unknown HK2 failure detected:
MultiException stack 1 of 2
java.lang.NoSuchFieldError: WADL
    at org.glassfish.jersey.server.wadl.processor.WadlModelProcessor.<init>(WadlModelProcessor.java:96)
    ...
    at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.<init>(GrizzlyHttpContainer.java:331)
    at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory.createHttpServer(GrizzlyHttpServerFactory.java:116)
MultiException stack 2 of 2
java.lang.IllegalStateException: Unable to perform operation: create on org.glassfish.jersey.server.wadl.processor.WadlModelProcessor
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:395)
    ...
    at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.<init>(GrizzlyHttpContainer.java:331)
    at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory.createHttpServer(GrizzlyHttpServerFactory.java:116)

(It's OK to Ask and Answer Your Own Questions)

阅读 this question and this issue thread 后,我的依赖项似乎有冲突。

相关依赖项:我正在使用 jersey 2.11tyrus-container-grizzly-server 1.13.

编辑: 在 pom 中将球衣版本更新为 2.25,错误消失。

如果有人想尝试提供更好的解决方案或解释,我可以提供有关项目设置的更多信息。我不会接受这个答案,因为它不完整。