Troubleshooting
Problem
Servlets annotated with []@PostConstruct[
] and []@PreDestroy[
] injection methods might be put into service, and those methods might be injected and called, even when those methods are not strictly well formed.
Symptom
In the following scenarios, the @PostConstruct
and @PreDestroy
methods are used and the servlets are put into service, instead of returning a 404 error to the client:
1. @PostConstruct
and @PreDestroy
method must not declare to throw exceptions;
2. @PostConstruct
and @PreDestroy
method must not be static;
3. One object must not have two @PostConstruct
or two @PreDestroy
injections;
4. @PostConstruct
and @PreDestroy
must not be declared with passed in parameters;
5. @PostConstruct
and @PreDestroy
must not be declared final.
Resolving The Problem
This problem has been fixed in 8.5.5 releases. You can either use the latest 8.5.5 releases, or change the servlets to strictly obey the @PostConstruct
and @PreDestroy
method annotation rules in 8.5.0.x releases.
Related Information
Was this topic helpful?
Document Information
Modified date:
06 June 2019
UID
swg21593497