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

AnnotationScannerFactory is hard coded to load AnnotationScanner instances from the TCCL. #404

Closed
pferraro opened this issue Jul 16, 2020 · 2 comments · Fixed by #413 or #419
Closed
Assignees
Milestone

Comments

@pferraro
Copy link
Contributor

OpenApiProcessor.modelFromAnnotations(...) creates a new OpenApiAnnotationScanner instance which currently loads AnnotationScanner instances from the TCCL. Given that smallrye has no control which thread will call this method, it cannot assume that the intended annotation scanner instances (or indeed, if any) will be loadable from the TCCL.

Ideally OpenApiProcessor.modelFromAnnotations(...) should accept a ClassLoader instance from which to load AnnotationScanner instances.

@pferraro
Copy link
Contributor Author

@phillip-kruger I don't think this fix is sufficient. AnnotationScannerFactory still loads AnnotationScanner instances using the TCCL, instead of the classloader passed to the OpenApiProcessor.modelFromAnnotations(...) method. See:
https://github.com/smallrye/smallrye-open-api/blob/master/core/src/main/java/io/smallrye/openapi/runtime/scanner/spi/AnnotationScannerFactory.java#L19

@phillip-kruger
Copy link
Member

Thanks, I'll look again in the morning

@phillip-kruger phillip-kruger modified the milestones: 2.0.5, 2.0.6 Jul 29, 2020
pferraro added a commit to pferraro/wildfly that referenced this issue Jul 31, 2020
pferraro added a commit to pferraro/wildfly that referenced this issue Jul 31, 2020
pferraro added a commit to pferraro/wildfly that referenced this issue Aug 5, 2020
pferraro added a commit to pferraro/wildfly that referenced this issue Aug 6, 2020
jamezp added a commit to jamezp/wildfly that referenced this issue Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants