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

EndpointController.getOpenApiAsResource breaks application #604

Closed
mcollovati opened this issue Mar 13, 2024 · 2 comments · Fixed by #622
Closed

EndpointController.getOpenApiAsResource breaks application #604

mcollovati opened this issue Mar 13, 2024 · 2 comments · Fixed by #622
Labels
bug Something isn't working hilla-24.4 released Issue has been released spring

Comments

@mcollovati
Copy link
Owner

The private getOpenApiAsResource method in EndpointController breaks the application because of an explicit cast to WebApplicationContext, that is not supported by the extension.

Possible solutions:

  • find an alternative way to implement the method and use byte-code replacement to replace it
  • import and implement WebApplicationContext interface into the extension
@mcollovati mcollovati added bug Something isn't working hilla-24.4 spring labels Mar 13, 2024
@mcollovati
Copy link
Owner Author

Method getOpenApiAsResource has been removed and the endpoint registration invocation has been moved to EndpointRegistryInitializer.
EndpointRegistryInitializer is a VaadinServiceInitListener marked with the @Component annotation. In Hilla it is automatically executed because of the logic provided by the Vaadin spring add-on.

The extension should find a way to do the same.
Registering the implementation for ServiceLoader API at build time will not work because EndpointRegistryInitializer has a constructor that requires a reference to the EndpointController.

mcollovati added a commit that referenced this issue Mar 22, 2024
Hilla endpoint registry is now eagerly initialized in a VaadinServiceInitListener.
This change introduces an custom init listener to postpone the registry initialization
in a  method, to prevent application crash because Quarkus SecurityConfiguration
required by security interceptor (e.g. for  annotation) is not yet ready.

Fixes #604
mcollovati added a commit that referenced this issue Mar 22, 2024
Hilla endpoint registry is now eagerly initialized in a VaadinServiceInitListener.
This change introduces an custom init listener to postpone the registry initialization
in a  method, to prevent application crash because Quarkus SecurityConfiguration
required by security interceptor (e.g. for  annotation) is not yet ready.

Fixes #604
@github-actions github-actions bot added the released Issue has been released label Mar 23, 2024
Copy link

This issue has been resolved in 24.0.0-alpha2 (Release Notes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hilla-24.4 released Issue has been released spring
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant