Comments (3)
This issue looks tricky. While it can be a Jersey issue, I'd like to exclude possibilities that come from the Specific JBoss environment.
-
HttpServletRequest can be provided by multiple sources. One of them is one of the CDI/Weld jars that provides a CDI bean for the HttpServletRequest. Since
@Inject
is used, the CDI can be the injector instead of Jersey. Jersey supplies HttpServletRequest only by org.glassfish.jersey.containers:jersey-container-servlet-core. Do you have it in your environment? -
Jersey supplies the HttpServletRequest provided by the servlet container, it does not have its own implementation, so from the actual injected instance it won't be clear whose bean is injected
-
From the intermittent nature of this issue it might be that sometimes there is some other provider than usual.
-
Jersey sets the HttpServletRequest in Request Scope so your issue should not apply from the quick look at the code.
-
When you change
@Inject
to@Context
, does it help?
from jersey.
@jansupol Thanks for the response... PFB my clarifications on this issue.
-
Yes, we have org.glassfish.jersey.containers:jersey-container-servlet-core in our library path. Also HttpServletRequest is part of javax.servlet:javax.servlet-api and tomcat.servlet-api jars, I believe jersey uses the javax.servlet-api for injecting.
-
Not tried modifying the @Inject to @context as the file this Inject done is a common file for all our APIs, so don't want to touch that point. But added the local variables for http servlet and response in the ActualResourceFile.class as below, after that the issue is not observed yet and keep monitoring.
@context HttpServletRequest request;
@context HttpServletResponse response; -
But wanted to understand how jersey injects and sets the scope of request processing context, also the actual cause of the issue that why the first API hit request context is always used. Is there Appserver level dependency, we using Jboss.
Thanks in advance... !!!
from jersey.
You can observe Jersey setting the supplier for injection in the WebComponent class.
from jersey.
Related Issues (20)
- NettyConnector does not respect timeouts HOT 7
- CVE-2023-4043 for jersey-media-json-binding dependency (parsson-1.1.1) HOT 2
- Injection error when using a `DynamicFeature` HOT 3
- Possible NPE in RequestContextFilter when other Filters prioritized
- Carrier Thread pinning on stack CommittingOutputStream.flushBuffer() HOT 9
- Jersey 3.1.7 release HOT 5
- Jersey 3.1.6 not closing request on Jetty earlyEOF HOT 3
- Connection is not stable (wrong detection if SSL context is configured) HOT 1
- Preserve whitespace in Content-Type header HOT 5
- Unexpected javax.net.ssl.SSLHandshakeException in seemingly simple usage scenario with Jersey Client 2 (>= 2.41) HOT 9
- What is the difference between jersey2.x, jersey 3.x and jersey4.x and which one is recommended? HOT 8
- Connection Leak when Circuit Breaker Hystrix Command timeout HOT 2
- 3.1.7 OSGi bundle issue HOT 12
- "MessageBodyWriter not found for media type=application/xml" error preventing upgrade from 2.32 to 2.33 HOT 4
- KeepAlive Caching stops working in 2.41 HOT 1
- Incosistent handling of inherited @Produces annotations HOT 2
- AsyncContext completion attempt after AsyncListener.onError is called HOT 3
- Process dump caused by malicious response headers HOT 2
- ChunkedInput.close is not sufficient to release client connections
- Json Jackon Maven test failing for version 3.1.3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jersey.