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

TypeToClassConverter is unable to handle types ? extends <other> #792

Closed
timonback opened this issue Jun 7, 2024 · 3 comments
Closed

TypeToClassConverter is unable to handle types ? extends <other> #792

timonback opened this issue Jun 7, 2024 · 3 comments
Assignees
Labels
bug Something isn't working staged for release

Comments

@timonback
Copy link
Member

Describe the bug
There is an exception during startup

Dependencies and versions used
For example, springwolf-kafka version 1.3.0.

Stack trace and error logs

java.lang.NullPointerException: Cannot invoke "io.github.springwolf.asyncapi.v3.model.schema.SchemaObject.getTitle()" because the return value of "io.github.springwolf.core.asyncapi.scanners.common.payload.NamedSchemaObject.schema()" is null 
at io.github.springwolf.plugins.kafka.asyncapi.scanners.common.header.AsyncHeadersForKafkaBuilder.buildHeaders(AsyncHeadersForKafkaBuilder.java:13) 	
at io.github.springwolf.core.asyncapi.scanners.common.MethodLevelAnnotationScanner.buildMessage(MethodLevelAnnotationScanner.java:33) 	
at io.github.springwolf.core.asyncapi.scanners.operations.annotations.SpringAnnotationMethodLevelOperationsScanner.buildOperation(SpringAnnotationMethodLevelOperationsScanner.java:72) 	
at io.github.springwolf.core.asyncapi.scanners.operations.annotations.SpringAnnotationMethodLevelOperationsScanner.mapMethodToOperation(SpringAnnotationMethodLevelOperationsScanner.java:67)

Previous error:

2024-06-07T08:31:09.669+02:00 DEBUG 23132 --- [<replaced>] [  restartedMain] i.g.s.c.a.s.c.p.TypeToClassConverter     : Unable to find class for type ? extends <replaced>

java.lang.ClassNotFoundException: ? extends <replaced>
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:421)
	at java.base/java.lang.Class.forName(Class.java:412)
	at io.github.springwolf.core.asyncapi.scanners.common.payload.TypeToClassConverter.extractActualGenericClass(TypeToClassConverter.java:64)
	at io.github.springwolf.core.asyncapi.scanners.common.payload.TypeToClassConverter.extractClass(TypeToClassConverter.java:31)
	at io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadClassExtractor.lambda$extractFrom$0(PayloadClassExtractor.java:24)
	at java.base/java.util.Optional.map(Optional.java:260)
	at io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadClassExtractor.extractFrom(PayloadClassExtractor.java:23)
	at io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadService.extractSchema(PayloadService.java:32)
	at io.github.springwolf.core.asyncapi.scanners.channels.annotations.SpringAnnotationMethodLevelChannelsScanner.mapMethodToChannel(SpringAnnotationMethodLevelChannelsScanner.java:60)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
	at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1715)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
	at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
	at io.github.springwolf.core.asyncapi.scanners.channels.SpringAnnotationChannelsScanner.mapToChannels(SpringAnnotationChannelsScanner.java:33)
	at io.github.springwolf.core.asyncapi.scanners.channels.SpringAnnotationChannelsScanner.scan(SpringAnnotationChannelsScanner.java:25)
	at io.github.springwolf.core.asyncapi.channels.DefaultChannelsService.findChannels(DefaultChannelsService.java:34)
	at io.github.springwolf.core.asyncapi.DefaultAsyncApiService.initAsyncAPI(DefaultAsyncApiService.java:69)
	at io.github.springwolf.core.asyncapi.DefaultAsyncApiService.getAsyncAPI(DefaultAsyncApiService.java:42)
@ismail-bertalfilali
Copy link

ismail-bertalfilali commented Jun 20, 2024

Hello,

  We have the same issue in both versions 1.2.0 and 1.3.0 but not in 1.1.0, any update ?

Thx

Copy link

The change is staged for release and will be part of the next release.

If you want to try and verify it in your application today,
use the latest 1.X.0-SNAPSHOT build as described in our README.md > Testing SNAPSHOT version

Thank you for the report/contribution!

Copy link

The change is available in the latest release. 🎉

Thank you for the report/contribution and making Springwolf better!

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

No branches or pull requests

2 participants