-
Hello everyone, I have a problem with RESTEasy Reactive. It seems, RESTEasy Reactive does not support injection of a ServletConfig with @context. Let me explain: In a Quarkus project we use RESTEasy Classic. We also use Swagger from https://github.com/swagger-api/swagger-core. I tried to switch from RESTEasy Classic to Reactive. When I start the project I get an error like this: [1] Unsatisfied dependency for type jakarta.servlet.ServletConfig and qualifiers [@default] I researched and found that Swagger itself defines resources which inject the ServletConfig. See https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-jaxrs2/src/main/java/io/swagger/v3/jaxrs2/integration/resources/OpenApiResource.java I tried to reconstruct the situation in a more simple way. I did create a new project: quarkus create app quarkus-servlet-config -x io.quarkus:quarkus-resteasy-reactive and modified the GreetingResource to inject the ServletConfig: @Path("/hello")
public class GreetingResource {
@Context
ServletConfig servletConfig;
@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
return "Hello from RESTEasy Reactive";
}
} Then I started it with quarkus dev and it failed the same way. I also tried to add the extensions quarkus-undertow and quarkus-resteasy-reactive-servle but without any positive results. At the moment, I am not sure that I can expect the @context annotation to work or if this is just not supported. Does anybody know if this should work and if so what I am missing? Or did I found a bug? Greetings |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
/cc @FroMage (resteasy-reactive), @Sgitario (resteasy-reactive), @geoand (resteasy-reactive), @stuartwdouglas (resteasy-reactive) |
Beta Was this translation helpful? Give feedback.
-
What is the alternative now? I have swagger integration with Quarkus and now migrating to resteasy reactive and I am also getting below error
|
Beta Was this translation helpful? Give feedback.
ServletConfig (and servler in general) is not supported in RESTEasy Reactive.
Are you using the quarkus-openapi extension?
Asking because that works just fine with RESTEasy Reactive