首页 > 解决方案 > 关于 BigDecimal 反射的 Quarkus 警告

问题描述

Quarkus 在启动期间显示此警告:

2020-05-07 10:24:21,302 WARN  [io.qua.dep.ste.ReflectiveHierarchyStep] (build-13) Unable to properly register the hierarchy of the following classes for reflection as they are not in the Jandex index:
    - java.math.BigDecimal

要重现,只需创建一个仅包含以下两个类的新 Quarkus 项目。

import java.math.BigDecimal;

public class Product {

    private int id;
    private BigDecimal price;

    public int getId () {
        return id;
    }

    public void setId (int id) {
        this.id = id;
    }

    public BigDecimal getPrice () {
        return price;
    }

    public void setPrice (BigDecimal price) {
        this.price = price;
    }
}

@Path("Products CRUD")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class ProductsResource {

    @GET
    public Product get () {
        return new Product();
    }
}

警告出现在版本 1.4.2.Final 中。在版本 1.4.1.Final 中没有。Quarkus 是否改变了什么或者这是一个回归问题?

标签: quarkus

解决方案



推荐阅读