Skip to content
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

Defensive reference to JNDI API for JDK 9+ (optional java.naming module) #27483

Closed
jhoeller opened this issue Sep 28, 2021 · 0 comments
Closed
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@jhoeller
Copy link
Contributor

Following up on #26884 (comment), our optional JNDI support for injection points - and therefore the java.naming module on JDK 9+ - is being referenced in two common places: CommonAnnotationBeanPostProcessor and StandardServletEnvironment. Since we're only really referring to JNDI API types such as javax.naming.NamingException through our own support classes, we can easily make this defensive with a reflective jndiPresent check before touching our actual JNDI support classes.

While java.naming is a minor concern on 5.3.x (where the much larger java.desktop is still a required module as well), this is easy enough to address there, in preparation for a more significant benefit in 6.0 (#26884).

@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels Sep 28, 2021
@jhoeller jhoeller added this to the 5.3.11 milestone Sep 28, 2021
@jhoeller jhoeller self-assigned this Sep 28, 2021
@jhoeller jhoeller changed the title Defensively refer to JNDI API types (making java.naming optional on JDK 9+) Defensively refer to JNDI API types (for optional java.naming module) Sep 28, 2021
@jhoeller jhoeller changed the title Defensively refer to JNDI API types (for optional java.naming module) Defensive reference to JNDI API for JDK 9+ (optional java.naming module) Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant