spring-projects / spring-projects/spring-modulith
EventListener in DelegatingEventExternalizer could not be created - Similar To Issue 973
Open
@odrotbohm is already working on this.
Since Apr 24, 2025.
meta: waiting for feedback
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Description
When using Spring Modulith 1.3.3 (starter + events-core + NATS Event) with Spring Boot 3.4.3, the auto-configured DelegatingEventExternalizer instance 'natsEventExternalizer' , continuously receiving EventListenerMethodProcessor can not find the @ApplicationModuleListener annotated method on, resulting in the following stacktrace:
org.springframework.beans.factory.BeanInitializationException: Failed to process @EventListener annotation on bean with name 'natsEventExternalizer': Need to invoke method 'externalize' declared on target class 'DelegatingEventExternalizer', but not found in any interface(s) of the exposed proxy type. Either pull the method up to an interface or switch to CGLIB proxies by enforcing proxy-target-class mode in your configuration.
at org.springframework.context.event.EventListenerMethodProcessor.afterSingletonsInstantiated(EventListenerMethodProcessor.java:149) ~[spring-context-6.2.3.jar:6.2.3]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:1083) ~[spring-beans-6.2.3.jar:6.2.3]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:987) ~[spring-context-6.2.3.jar:6.2.3]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:627) ~[spring-context-6.2.3.jar:6.2.3]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.4.3.jar:3.4.3]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752) ~[spring-boot-3.4.3.jar:3.4.3]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439) ~[spring-boot-3.4.3.jar:3.4.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:318) ~[spring-boot-3.4.3.jar:3.4.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1361) ~[spring-boot-3.4.3.jar:3.4.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1350) ~[spring-boot-3.4.3.jar:3.4.3]
at org.rockwell.publishermodulith.main(publishermodulith.java:14) ~[classes/:na]
Caused by: java.lang.IllegalStateException: Need to invoke method 'externalize' declared on target class 'DelegatingEventExternalizer', but not found in any interface(s) of the exposed proxy type. Either pull the method up to an interface or switch to CGLIB proxies by enforcing proxy-target-class mode in your configuration.
at org.springframework.core.MethodIntrospector.selectInvocableMethod(MethodIntrospector.java:135) ~[spring-core-6.2.3.jar:6.2.3]
at org.springframework.aop.support.AopUtils.selectInvocableMethod(AopUtils.java:150) ~[spring-aop-6.2.3.jar:6.2.3]
at org.springframework.context.event.EventListenerMethodProcessor.processBean(EventListenerMethodProcessor.java:189) ~[spring-context-6.2.3.jar:6.2.3]
at org.springframework.context.event.EventListenerMethodProcessor.afterSingletonsInstantiated(EventListenerMethodProcessor.java:145) ~[spring-context-6.2.3.jar:6.2.3]
... 10 common frames omitted
Process finished with exit code 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.