AxonFramework / extension-kafka

Axon Framework extension for Kafka integration to publish and handle Event messages.
https://axoniq.io/
Apache License 2.0
67 stars 28 forks source link

axon-kafka-spring-boot-starter fails when spring-boot-devtools enabled #240

Closed tiger-seo closed 2 years ago

tiger-seo commented 2 years ago

Basic information

Stack Trace: Exception in thread "main" java.lang.IllegalStateException: Unable to load devtools settings from location [META-INF/spring-devtools.properties] at org.springframework.boot.devtools.settings.DevToolsSettings.load(DevToolsSettings.java:118) at org.springframework.boot.devtools.settings.DevToolsSettings.load(DevToolsSettings.java:101) at org.springframework.boot.devtools.settings.DevToolsSettings.get(DevToolsSettings.java:95) at org.springframework.boot.devtools.restart.ChangeableUrls.(ChangeableUrls.java:56) at org.springframework.boot.devtools.restart.ChangeableUrls.fromUrls(ChangeableUrls.java:187) at org.springframework.boot.devtools.restart.ChangeableUrls.fromUrls(ChangeableUrls.java:183) at org.springframework.boot.devtools.restart.ChangeableUrls.fromClassLoader(ChangeableUrls.java:101) at org.springframework.boot.devtools.restart.DefaultRestartInitializer.getUrls(DefaultRestartInitializer.java:86) at org.springframework.boot.devtools.restart.DefaultRestartInitializer.getInitialUrls(DefaultRestartInitializer.java:42) at org.springframework.boot.devtools.restart.Restarter.(Restarter.java:141) at org.springframework.boot.devtools.restart.Restarter.initialize(Restarter.java:549) at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationStartingEvent(RestartApplicationListener.java:90) at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationEvent(RestartApplicationListener.java:50) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:79) at org.springframework.boot.SpringApplicationRunListeners.lambda$starting$0(SpringApplicationRunListeners.java:56) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120) at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:56) at org.springframework.boot.SpringApplication.run(SpringApplication.java:293) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) at com.example.CoreApplication.main(CoreApplication.java:10) Caused by: java.util.regex.PatternSyntaxException: Illegal repetition near index 13 axon-kafka-${project.version}.jar ^ at java.base/java.util.regex.Pattern.error(Pattern.java:2028) at java.base/java.util.regex.Pattern.closure(Pattern.java:3309) at java.base/java.util.regex.Pattern.sequence(Pattern.java:2214) at java.base/java.util.regex.Pattern.expr(Pattern.java:2069) at java.base/java.util.regex.Pattern.compile(Pattern.java:1783) at java.base/java.util.regex.Pattern.(Pattern.java:1430) at java.base/java.util.regex.Pattern.compile(Pattern.java:1069) at org.springframework.boot.devtools.settings.DevToolsSettings.lambda$getPatterns$0(DevToolsSettings.java:69) at java.base/java.util.concurrent.ConcurrentHashMap.forEach(ConcurrentHashMap.java:1603) at java.base/java.util.Properties.forEach(Properties.java:1422) at org.springframework.boot.devtools.settings.DevToolsSettings.getPatterns(DevToolsSettings.java:66) at org.springframework.boot.devtools.settings.DevToolsSettings.add(DevToolsSettings.java:58) at org.springframework.boot.devtools.settings.DevToolsSettings.load(DevToolsSettings.java:109) ... 25 more

Steps to reproduce

run application with Axon Framework and Kafka extension

Expected behaviour

application run

Actual behaviour

application not run , because of exception

To me , this problem is similar to https://github.com/AxonFramework/extension-reactor/issues/28#issuecomment-773095972 from issue #28 , but here , from what i have found debugging , jar build plugin is configured , but version tag is missing in pom.xml, so project.version property is also missing. So , i think , this problem can be fixed by adding version tag to pom.xml.

smcvb commented 2 years ago

Thanks for bringing this to our attention, @tiger-seo! We completely missed this when we revamped the pom files of the Kafka extension.

I agree with you in that I assume the missing section to be the resources part from the build section. I'll add this and validate it right away.

smcvb commented 2 years ago

Closing this issue as commit 9bc2345 resolves it.

smcvb commented 2 years ago

By the way, I've made a 4.5.3 release containing the aforementioned fixing commit. Please give it a try, @tiger-seo, and let us know whether it resolves the predicament for you too!

tiger-seo commented 2 years ago

@smcvb thank u very much for quick actions - the issue has gone ;)