-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RESTEASY003880: Unable to find contextual data of type: javax.servlet.ServletConfig #1691
Comments
I think I know what the problem is. I'm bootstrapping resteasy with a filter dispatcher rather than a servlet dispatcher, so the ServletConfig is not available in this case. Apparently this last version of swagger is using getInitParameter from ServletConfig that restasy can not provide. |
last version uses indeed ServletConfig if not null, also previous versions do actually in some configurations like the ones affected by #1491. as you said in your case ServletConfig is not available, but it's not null and I would say possibly this is related to solution mentioned in #1491. This will need some investigation, as workaround you could change resteasy bootstrap or try #1491 solution |
I don't think it's related to #1491. In my case the ServletContext is set and is valid, but the same does not happen with ServletConfig. IIRC, the ServletConfig is one for each servlet while the ServletContext is for all servlets. public User getMessage(@Context ServletContext ctx, @Context ServletConfig cfg) {
} The debugger shows me this
|
I'll try as soon as possible. Thank you.
|
Fix #1691 - fixes ServletConfig related error in RESTEasy Filter based config
The exception still exist since I change to 1.5.8: <dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jaxrs</artifactId>
<version>1.5.8</version>
</dependency> and the error log : 12:50:08.441 [pool-3-thread-3] INFO i.s.j.config.SwaggerContextService 69 - Exception caught testing servletConfig. see https://github.com/swagger-api/swagger-core/issues/1691
12:50:08.441 [pool-3-thread-3] INFO i.s.j.config.SwaggerContextService 69 - Exception caught testing servletConfig. see https://github.com/swagger-api/swagger-core/issues/1691
12:50:08.441 [pool-3-thread-3] INFO i.s.j.config.SwaggerContextService 69 - Exception caught testing servletConfig. see https://github.com/swagger-api/swagger-core/issues/1691
1 |
@afredlyj log seems to be correct (INFO level) it just signals the "invalid" servlet config, and adopts appropriate behavior; previously you would get a blocking error instead |
I use netty + resteasy + swagger, but still something is wrong when request
this is my spring xml :
|
I opened a new issue, because I use resteasy with google guice and I dont use the default implementation of resteasy servlet dispatcher. You can see how I resolved this in #2239 |
This is happening after updating from swagger 1.5.6 to 1.5.6. I'm using jetty-maven-plugin with resteasy 3.0.16
The text was updated successfully, but these errors were encountered: