eclipse-ee4j / eclipse-ee4j/jersey
SpringComponentProvider is dependent on ServletContext which doesn't exist in non-servlet container case
Open
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
SpringComponentProvider is dependent on ServletContext which doesn't exist in non-servlet container case. So it will cause ClassNotFoundException in non-servlet container case where ServletContext.class can not be found.
The related code in SpringComponentProvider.initialize
```java
ServletContext sc = locator.getService(ServletContext.class);
if (sc != null) {
// servlet container
ctx = WebApplicationContextUtils.getWebApplicationContext(sc);
} else {
// non-servlet container
ctx = createSpringContext();
}
```
Contributor guide
Assessment
This issue has not been assessed yet.