JoseHdez_2
JoseHdez_2

Reputation: 4171

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

Problem

When I try to use GrizzlyHttpServerFactory.createHttpServer I get a "WARNING: Unknown HK2 failure detected:" followed by two errors inside a "MultiException":

I've Tried

I am not knowledgeable in Jersey, but I have:

In-depth

ResourceConfig I'm using:

public class MyResourceConfig extends ResourceConfig {

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

        register(MyAPIPoint.class);
    }
}

Contains two classes being registered and nothing else.

Truncated Error Stack Trace:

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)

Upvotes: 3

Views: 4104

Answers (1)

JoseHdez_2
JoseHdez_2

Reputation: 4171

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

After reading this question and this issue thread it seems that I might have a conflict in my dependencies.

Relevant dependencies: I'm using jersey 2.11 and tyrus-container-grizzly-server 1.13.

Edit: Updated the jersey version to 2.25 in the pom and the error disappeared.

If someone wants to try and give a better solution or explanation I can give more information about the setup of the project. I won't accept this answer as it is not complete.

Upvotes: 2

Related Questions