unitsofmeasurement / uom-lib

Units of Measurement Libraries
Other
14 stars 13 forks source link

Jackson Serialization fails on 2.2 #80

Open fref opened 1 year ago

fref commented 1 year ago
java.lang.NoSuchFieldException: DEKA
    at java.base/java.lang.Class.getField(Class.java:1999)
    at tech.units.indriya.format.SymbolMap.<init>(SymbolMap.java:117)
    at tech.units.indriya.format.SymbolMap.of(SymbolMap.java:143)
    at systems.uom.ucum.format.UCUMFormat$Parsing.<clinit>(UCUMFormat.java:432)
    at systems.uom.ucum.format.UCUMFormat.getInstance(UCUMFormat.java:110)
    at tech.uom.lib.jackson.UnitJacksonModule$UnitJsonSerializer.serialize(UnitJacksonModule.java:128)
    at tech.uom.lib.jackson.UnitJacksonModule$UnitJsonSerializer.serialize(UnitJacksonModule.java:105)

this comes from (javax.measure.MetricPrefix from unit-api-2.2)

    /**
     * US alias for <code>DECA</code>.
     *
     * @param <Q>
     *          type of the quantity measured by the unit.
     * @param unit
     *          any unit.
     * @return <code>unit.times(1e1)</code>.
     * @see #DECA
     */
    public static <Q extends Quantity<Q>> Unit<Q> DEKA(Unit<Q> unit) {
        return unit.prefix(DECA);
    }
keilw commented 1 year ago

This needs uom-systems #200 to be done first. As there are no other critical issues in the 2.2 milestone, it should be possible to release it relatively soon, but please give it a few more days. Then the Jackson library also needs a 2.2 based on the 2.2 stack. In the meantime, please use 2.2-SNAPSHOT of uom-lib-jackson from the snapshot repository. The latest snapshot builds already use the 2.2 final API and RI.

fref commented 1 year ago

Ok. Anything I can do to help?

hypersonik commented 8 months ago

This needs uom-systems #200 to be done first. As there are no other critical issues in the 2.2 milestone, it should be possible to release it relatively soon, but please give it a few more days. Then the Jackson library also needs a 2.2 based on the 2.2 stack. In the meantime, please use 2.2-SNAPSHOT of uom-lib-jackson from the snapshot repository. The latest snapshot builds already use the 2.2 final API and RI.

Where can I find the snapshot?, it is not available in maven repository, AFAIK. I don't want to rush you, please take your time, but if there is a snapshot elsewhere I'd like to use it meanwhile.

keilw commented 8 months ago

It is available in its own SNAPSHOT Repository:

<repository>
      <snapshots>
           <enabled>true</enabled>
       </snapshots>
       <id>ossrh-snapshot</id>
       <name>OSSRH Snapshots</name>
       <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>

You have to add that to your POM.

lucasvc commented 1 month ago

This needs uom-systems #200 to be done first. As there are no other critical issues in the 2.2 milestone, it should be possible to release it relatively soon, but please give it a few more days. Then the Jackson library also needs a 2.2 based on the 2.2 stack. In the meantime, please use 2.2-SNAPSHOT of uom-lib-jackson from the snapshot repository. The latest snapshot builds already use the 2.2 final API and RI.

Has been a year, would be possible to do the milestone release? Thanks.

keilw commented 4 weeks ago

The issue uom-systems #200 is still open, but hope we can deal with it soon. As the active ressources are a bit small, help is always appreciated.

keilw commented 3 weeks ago

There have been issues with MavenCentral, but we can deploy there again. Hopefully that'll get SI Units first released. After that UOM-Systems can follow, and then a new release of uom-libs like Jackson will be possible.

lucasvc commented 2 weeks ago

The issue uom-systems #200 is still open, but hope we can deal with it soon. As the active ressources are a bit small, help is always appreciated.

Oh sorry, I wrongly understood that this issue could be solved without the other one.

Thanks for taking care anyway <3