Chiranga Alwis
Chiranga Alwis

Reputation: 1111

Starting order of Apache Tomcat server.xml components

I have been working on creating an Apache Tomcat Lifecycle listener. This listener loads certain custom configuration data from a file which are to be used within a custom valve I have developed.

I added this listener to the server.xml but it seems that before the listener's lifecycleEvent method is executed the valve is initialized.

Hence I would be grateful if one could provide me with an idea on the startup order of Apache Tomcat components which are defined within the server.xml which I believe might be useful to my issue.

Upvotes: 1

Views: 426

Answers (1)

Stefan
Stefan

Reputation: 12462

Have you tried overriding ValveBase.initInternal() to configure the value, avoiding the listener?

"Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method."

Upvotes: 1

Related Questions