From 413d9b6b5fbfce927b0a6fe211dfe6be002a8ffe Mon Sep 17 00:00:00 2001 From: Fayupable <90789180+Fayupable@users.noreply.github.com> Date: Fri, 14 Aug 2026 16:20:29 +0300 Subject: [PATCH] Fix LoggedAspect bean creation failure caused by stray @Component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove @Component from LoggedAspect. It was already correctly constructed and registered exclusively by LoggedAutoConfiguration's @Bean method, guarded by @ConditionalOnMissingBean(LoggedAspect.class). The stray @Component let component-scanning register an under-specified bean definition for the same type first whenever a consuming application's own base package overlapped com.fayupable.logged.spring.aspect, causing that guard to back off and Spring to fail resolving which of LoggedAspect's two constructors to use — a startup-time BeanCreationException: No default constructor found. Bumps version to 1.2.2. --- CHANGELOG.md | 9 ++++++++- logged-benchmarks/dependency-reduced-pom.xml | 2 +- logged-benchmarks/pom.xml | 2 +- logged-core/pom.xml | 2 +- logged-spring/pom.xml | 2 +- .../com/fayupable/logged/spring/aspect/LoggedAspect.java | 2 -- logged-test/pom.xml | 2 +- pom.xml | 2 +- 8 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f45ad7..9460539 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and ## [Unreleased] +## [1.2.2] - 2026-08-14 + +### Fixed + +- Removed a stray `@Component` annotation from `LoggedAspect`, which caused a `BeanCreationException: No default constructor found` startup failure in any consuming application whose own component-scanning happens to cover `com.fayupable.logged.spring.aspect` (for example an application with `com.fayupable` as its own base package). `LoggedAspect` was already correctly constructed and registered exclusively by `LoggedAutoConfiguration`'s `@Bean` method, guarded by `@ConditionalOnMissingBean(LoggedAspect.class)`; the stray `@Component` let component-scanning register an earlier, under-specified bean definition for the same type first, causing that guard to back off and Spring to fail resolving which of `LoggedAspect`'s two constructors to use. + ## [1.2.0] - 2026-08-04 ### Added @@ -55,7 +61,8 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and - `logged-benchmarks`: internal JMH benchmarks measuring the aspect's overhead against a direct, uninstrumented call. - Quality gates: Pitest mutation testing (`logged-core` 100%, `logged-spring` 98%) and Checkstyle (0 violations), both enforced via `mvn verify`. -[Unreleased]: https://github.com/fayupable/logged-lib/compare/v1.2.0...HEAD +[Unreleased]: https://github.com/fayupable/logged-lib/compare/v1.2.2...HEAD +[1.2.2]: https://github.com/fayupable/logged-lib/compare/v1.2.0...v1.2.2 [1.2.0]: https://github.com/fayupable/logged-lib/compare/v1.1.0...v1.2.0 [1.1.0]: https://github.com/fayupable/logged-lib/compare/v1.0.0...v1.1.0 [1.0.0]: https://github.com/fayupable/logged-lib/releases/tag/v1.0.0 diff --git a/logged-benchmarks/dependency-reduced-pom.xml b/logged-benchmarks/dependency-reduced-pom.xml index 4a3523f..1b9f8b0 100644 --- a/logged-benchmarks/dependency-reduced-pom.xml +++ b/logged-benchmarks/dependency-reduced-pom.xml @@ -3,7 +3,7 @@ logged-lib com.fayupable - 1.2.0 + 1.2.2 4.0.0 logged-benchmarks diff --git a/logged-benchmarks/pom.xml b/logged-benchmarks/pom.xml index 79695a5..7585639 100644 --- a/logged-benchmarks/pom.xml +++ b/logged-benchmarks/pom.xml @@ -7,7 +7,7 @@ com.fayupable logged-lib - 1.2.0 + 1.2.2 logged-benchmarks diff --git a/logged-core/pom.xml b/logged-core/pom.xml index 3419a78..9bf7b3a 100644 --- a/logged-core/pom.xml +++ b/logged-core/pom.xml @@ -7,7 +7,7 @@ com.fayupable logged-lib - 1.2.0 + 1.2.2 logged-core diff --git a/logged-spring/pom.xml b/logged-spring/pom.xml index c9ddec5..9a1527b 100644 --- a/logged-spring/pom.xml +++ b/logged-spring/pom.xml @@ -7,7 +7,7 @@ com.fayupable logged-lib - 1.2.0 + 1.2.2 logged-spring diff --git a/logged-spring/src/main/java/com/fayupable/logged/spring/aspect/LoggedAspect.java b/logged-spring/src/main/java/com/fayupable/logged/spring/aspect/LoggedAspect.java index eb37321..46b6f37 100644 --- a/logged-spring/src/main/java/com/fayupable/logged/spring/aspect/LoggedAspect.java +++ b/logged-spring/src/main/java/com/fayupable/logged/spring/aspect/LoggedAspect.java @@ -12,7 +12,6 @@ import org.aspectj.lang.reflect.MethodSignature; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; import java.lang.reflect.Method; import java.time.Instant; @@ -107,7 +106,6 @@ * {@code MDC.put}/{@code MDC.remove} calls on a very hot path. */ @Aspect -@Component public class LoggedAspect { private static final Logger log = LoggerFactory.getLogger(LoggedAspect.class); diff --git a/logged-test/pom.xml b/logged-test/pom.xml index 51a4c12..ad1b4a3 100644 --- a/logged-test/pom.xml +++ b/logged-test/pom.xml @@ -7,7 +7,7 @@ com.fayupable logged-lib - 1.2.0 + 1.2.2 logged-test diff --git a/pom.xml b/pom.xml index 3b063df..092ff62 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.fayupable logged-lib - 1.2.0 + 1.2.2 pom logged-lib