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

Jandex warning at boot time about JsonString #10742

Closed
pilhuhn opened this issue Jul 15, 2020 · 1 comment · Fixed by #10751
Closed

Jandex warning at boot time about JsonString #10742

pilhuhn opened this issue Jul 15, 2020 · 1 comment · Fixed by #10751
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@pilhuhn
Copy link
Contributor

pilhuhn commented Jul 15, 2020

Describe the bug

At system start, the following warning is printed:

2020-07-15 11:54:34,465 WARN  [io.qua.dep.ste.ReflectiveHierarchyStep] (build-32) Unable to properly register the hierarchy of the following classes for reflection as they are not in the Jandex index:
        - javax.json.JsonString (source: com.redhat.cloud.policies.app.rest.PolicyCrudService[javax.ws.rs.core.Response validateName(@NotNull javax.json.JsonString policyName, java.util.UUID id)])
Consider adding them to the index either by creating a Jandex index for your dependency via the Maven plugin, an empty META-INF/beans.xml or quarkus.index-dependency properties.");.

Code looks like

  @POST
  @Path("/validate-name")
  public Response validateName(@NotNull JsonString policyName, @QueryParam("id") UUID id) {

JsonString is pulled into Quarkus via

  • io.quarkus:quarkus-resteasy-jsonb:1.6.0.Final
    ** org.jboss.resteasy:resteasy-json-binding-provider:4.5.5.Final
    *** org.glassfish:jakarta.json:1.1.6

so I would expect that this is already registered in Quarkus by default.
This warning was not printed before 1.6

Expected behavior

Print no warning, as it is already registered

@pilhuhn pilhuhn added the kind/bug Something isn't working label Jul 15, 2020
@mkouba
Copy link
Contributor

mkouba commented Jul 15, 2020

It seems that we produce the fiReflectiveHierarchyBuildItem twice. One backed by the CombinedIndexBuildItem and the other one backed by the BeanArchiveIndexBuildItem. And the one backed by CombinedIndexBuildItem results in the warning. I'll send a PR to fix this particular issue but the overall "reflection registration strategy" would probably deserve some refactoring...

@mkouba mkouba self-assigned this Jul 15, 2020
@mkouba mkouba added this to the 1.7.0 - master milestone Jul 15, 2020
mkouba added a commit to mkouba/quarkus that referenced this issue Jul 15, 2020
- do not register the ReflectiveHierarchyBuildItem twice for most
resource methods; first try the BeanArchiveIndexBuildItem and then add
methods only found in the CombinedIndexBuildItem
- resolves quarkusio#10742
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jul 16, 2020
- do not register the ReflectiveHierarchyBuildItem twice for most
resource methods; first try the BeanArchiveIndexBuildItem and then add
methods only found in the CombinedIndexBuildItem
- resolves quarkusio#10742
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants