Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.StackOverflowError: null in 1.4.0 release #830

Closed
warorc opened this issue Jul 3, 2024 · 2 comments
Closed

java.lang.StackOverflowError: null in 1.4.0 release #830

warorc opened this issue Jul 3, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@warorc
Copy link

warorc commented Jul 3, 2024

Describe the bug
During docs generation I've got error:

java.lang.StackOverflowError: null
	at java.base/java.lang.String.contains(String.java:2858) ~[na:na]
	at io.github.springwolf.asyncapi.v3.model.channel.message.MessageReference.extractRefName(MessageReference.java:54) ~[springwolf-asyncapi-1.4.0.jar:na]
	at io.github.springwolf.core.asyncapi.components.postprocessors.AvroSchemaPostProcessor.removeAvroProperties(AvroSchemaPostProcessor.java:31) ~[springwolf-core-1.4.0.jar:na]
	at io.github.springwolf.core.asyncapi.components.postprocessors.AvroSchemaPostProcessor.lambda$removeAvroProperties$0(AvroSchemaPostProcessor.java:49) ~[springwolf-core-1.4.0.jar:na]
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721) ~[na:na] 

Seems this part:

private void removeAvroProperties(Schema schema, Map<String, Schema> definitions) {
        if (schema.get$ref() != null) {
            String schemaName = MessageReference.extractRefName(schema.get$ref());
            if (definitions.containsKey(schemaName)) {
                this.removeAvroProperties((Schema)definitions.get(schemaName), definitions);
            }
        }

makes infinity recursion

Dependencies and versions used
springwolf-kafka version 1.4.0.

Stack trace and error logs

java.lang.RuntimeException: Error occured during creation of AsyncAPI
	at io.github.springwolf.core.asyncapi.DefaultAsyncApiService.getAsyncAPI(DefaultAsyncApiService.java:48) ~[springwolf-core-1.4.0.jar:na]
	at io.github.springwolf.core.SpringwolfInitApplicationListener.onApplicationEvent(SpringwolfInitApplicationListener.java:31) ~[springwolf-core-1.4.0.jar:na]
	at io.github.springwolf.core.SpringwolfInitApplicationListener.onApplicationEvent(SpringwolfInitApplicationListener.java:17) ~[springwolf-core-1.4.0.jar:na]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:178) ~[spring-context-6.1.3.jar:6.1.3]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:171) ~[spring-context-6.1.3.jar:6.1.3]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:149) ~[spring-context-6.1.3.jar:6.1.3]
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:451) ~[spring-context-6.1.3.jar:6.1.3]
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:384) ~[spring-context-6.1.3.jar:6.1.3]
	at org.springframework.boot.context.event.EventPublishingRunListener.ready(EventPublishingRunListener.java:109) ~[spring-boot-3.2.2.jar:3.2.2]
	at org.springframework.boot.SpringApplicationRunListeners.lambda$ready$6(SpringApplicationRunListeners.java:80) ~[spring-boot-3.2.2.jar:3.2.2]
	at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) ~[spring-boot-3.2.2.jar:3.2.2]
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) ~[spring-boot-3.2.2.jar:3.2.2]
	at org.springframework.boot.SpringApplicationRunListeners.ready(SpringApplicationRunListeners.java:80) ~[spring-boot-3.2.2.jar:3.2.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:348) ~[spring-boot-3.2.2.jar:3.2.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-3.2.2.jar:3.2.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-3.2.2.jar:3.2.2]
	at ru.vtb.ppcd.datahub.ul.DataHubApplicationKt.main(DataHubApplication.kt:18) ~[classes/:na]
Caused by: java.lang.StackOverflowError: null
	at java.base/java.util.HashMap.hash(HashMap.java:338) ~[na:na]
	at java.base/java.util.HashMap.getNode(HashMap.java:568) ~[na:na]
	at java.base/java.util.LinkedHashMap.getOrDefault(LinkedHashMap.java:453) ~[na:na]
	at io.github.springwolf.core.asyncapi.components.postprocessors.AvroSchemaPostProcessor.removeAvroProperties(AvroSchemaPostProcessor.java:39) ~[springwolf-core-1.4.0.jar:na]
	at io.github.springwolf.core.asyncapi.components.postprocessors.AvroSchemaPostProcessor.removeAvroProperties(AvroSchemaPostProcessor.java:33) ~[springwolf-core-1.4.0.jar:na]
	at io.github.springwolf.core.asyncapi.components.postprocessors.AvroSchemaPostProcessor.lambda$removeAvroProperties$0(AvroSchemaPostProcessor.java:49) ~[springwolf-core-1.4.0.jar:na]
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721) ~[na:na]
@warorc warorc added the bug Something isn't working label Jul 3, 2024
Copy link

github-actions bot commented Jul 3, 2024

Welcome to Springwolf. Thanks a lot for reporting your first issue. Please check out our contributors guide and feel free to join us on discord.

@warorc warorc closed this as completed Jul 3, 2024
@warorc
Copy link
Author

warorc commented Jul 3, 2024

Our generator problem, sorry guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant