Re: PostConstruct annotation in a filter since version 9.0.60

2022-04-06 Thread Cherio
Mark, I understand that no matter what the point of view is, there are requirements as to what an application can package in order to correctly run within Tomcat. I appreciate the details and thank you for elaborating on it. On Wed, Apr 6, 2022 at 2:35 AM Mark Thomas wrote: > Your application

Re: PostConstruct annotation in a filter since version 9.0.60

2022-04-05 Thread Mark Thomas
Your application must not package any of the specification API jars provided by Tomcat. That includes annotation-api.jar Tomcat implements the specific version of the API defined by those jars. You can't drop in a different API version and expect Tomcat to magically implement that new version

Re: PostConstruct annotation in a filter since version 9.0.60

2022-04-05 Thread Cherio
This makes no sense. The application and the container need to be able to maintain an independent life cycle of the libraries. I may want to update Tomcat and not be concerned that it breaks my application because I may not even have means to adapt the application to the updated tomcat library ver

Re: PostConstruct annotation in a filter since version 9.0.60

2022-04-05 Thread Mark Thomas
5 Apr 2022 20:58:26 Cherio : I found what the issue is. This has to do with the sequence of loading of libraries/jars AND project supplied "annotation-api.jar" which declares PostConstruct annotation. The same set of annotations are also being supplied by Tomcat in an identically named JAR. S

Re: PostConstruct annotation in a filter since version 9.0.60

2022-04-05 Thread Cherio
I found what the issue is. This has to do with the sequence of loading of libraries/jars AND project supplied "annotation-api.jar" which declares PostConstruct annotation. The same set of annotations are also being supplied by Tomcat in an identically named JAR. Sometime during java/Tomcat startup

Re: PostConstruct annotation in a filter since version 9.0.60

2022-04-05 Thread Cherio
I did ran the diffs between versions. With my naked eye I didn't spot anything obvious that in my mind would be directly related to this behavior change. At the same time, when I toggle between the above mentioned Tomcat versions the exact same application either starts successfully or fails on Po

Re: PostConstruct annotation in a filter since version 9.0.60

2022-04-05 Thread Rémy Maucherat
On Tue, Apr 5, 2022 at 4:02 PM Cherio wrote: > > Yes, I confirm. For this project I download Tomcat from here: > https://archive.apache.org/dist/tomcat/tomcat-$MAJOR_VER/v$VER/bin/apache-tomcat-$VER.tar.gz > > BTW @PostConstruct doesn't have to do with dependency injection. It is > about lifecycle

Re: PostConstruct annotation in a filter since version 9.0.60

2022-04-05 Thread Cherio
I forgot to mention that the Tomcat stack trace I posted earlier is from Tomcat 9.0.62. The change in behavior was observed starting Tomcat 9.0.60 On Tue, Apr 5, 2022 at 10:01 AM Cherio wrote: > Yes, I confirm. For this project I download Tomcat from here: > > https://archive.apache.org/dist/to

Re: PostConstruct annotation in a filter since version 9.0.60

2022-04-05 Thread Cherio
Yes, I confirm. For this project I download Tomcat from here: https://archive.apache.org/dist/tomcat/tomcat-$MAJOR_VER/v$VER/bin/apache-tomcat-$VER.tar.gz BTW @PostConstruct doesn't have to do with dependency injection. It is about lifecycle processing. The change in behavior was narrowed down to

Re: PostConstruct annotation in a filter since version 9.0.60

2022-04-03 Thread Konstantin Kolinko
сб, 2 апр. 2022 г. в 00:02, Cherio : > > I observed an announced change in behavior in version 9.0.60 (and later). > > My application has a Spring class loaded as a javax.servlet.Filter. It has > a method annotated with a PostConstruct annotation. Up until Tomcat 9.0.59 > the annotation was handled