…ewServlet and WebStatFilter
Move auto-configuration exclusions from conditional GenAutoConfig to
@SpringBootApplication to ensure they are always applied reliably.
Add DruidMonitorConfig to manually register the Jakarta-based
StatViewServlet and WebStatFilter when gen.isdb=true, bypassing
the excluded DruidDataSourceAutoConfigure.
Fix RemoveDruidAdConfig by removing @AutoConfigureAfter and
@ConditionalOnBean which don't work for non-auto-configuration classes.
Co-authored-by: unknowIfGuestInDream <57802425+unknowIfGuestInDream@users.noreply.github.com>
Druid monitoring page returns 404 because
GenAutoConfigused@EnableAutoConfiguration(exclude=...)on a@ConditionalOnPropertyclass. Auto-configuration exclusions can be processed regardless of whether the bean condition passes, soDruidDataSourceAutoConfigure(and its@ImportofDruidStatViewServletConfiguration) was always excluded—the monitoring servlet was never registered.Proposed Changes
GenApplication— MoveDataSourceAutoConfigurationandDruidDataSourceAutoConfigureexclusions to@SpringBootApplication(exclude=...)for unconditional, reliable exclusion. Both are unnecessary:DataSourceConfighandles manual DataSource creation whengen.isdb=true.GenAutoConfig— Its only purpose was the exclusion, which is now on the main class.DruidMonitorConfig— Manually registers Jakarta-basedStatViewServletandWebStatFilterwhengen.isdb=true, reading config fromDruidStatProperties. This replaces the registration that was previously expected from the now-excluded auto-configuration.RemoveDruidAdConfig— Remove@AutoConfigureAfterand@ConditionalOnBean(no-ops on non-auto-config classes); add@EnableConfigurationProperties(DruidStatProperties.class)for direct property access.Readiness Checklist
Author/Contributor
Reviewing Maintainer
enhancement,bug,documentation,styleordependenciesWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
checkstyle.org/opt/hostedtoolcache/CodeQL/2.24.2/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.24.2/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.24.2/x64/codeql/xml/tools/xml-extractor.jar --fileList=/tmp/codeql-scratch-e937359de4103e32/dbs/java/working/files-to-index13432678823468386474.list --sourceArchiveDir=/tmp/codeql-scratch-e937359de4103e32/dbs/java/src --outputDir=/tmp/codeql-scratch-e937359de4103e32/dbs/java/trap/java(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.