unitsofmeasurement / uom-systems

Units of Measurement Systems
http://www.uom.systems
Other
36 stars 17 forks source link

NoSuchFieldError when used in a project with a UOM-SI dependancy. #109

Closed ejberry closed 7 years ago

ejberry commented 7 years ago
Exception in thread "main" java.lang.NoSuchFieldError: KELVIN
    at systems.uom.ucum.UCUM.<clinit>(UCUM.java:102)
    at MainKt.main(Main.kt:13)

Error is thrown at runtime when both a uom-systems library is required as a dependency and a uom-si library is required. Is this expected given the structure of the library's own dependencies?

keilw commented 7 years ago

Have you tested or found this with the latest version of each module uom-si 0.7 and uom-systems 0.7.1?

There was a known issue in 0.6 or 0.7 of the systems module, but nothing in the latest version so far. So please confirm the version of each module (uom-se, si-units and uom-systems) you are using with your main app, thanks.

ejberry commented 7 years ago

I was using the 0.7 of uom-systems. it looks like its resolved itself with 0.7.1

keilw commented 7 years ago

Thanks for the confirmation. Glad the new version resolved it. Let us know if you find anything else or have suggestions e.g. regarding UCUM and ongoing items like formatting.

cacsar commented 7 years ago

I'm hitting this after adding

            <groupId>com.opower.unitsofmeasure</groupId>
            <artifactId>jackson-module-unitsofmeasure</artifactId>
            <version>1.3.4</version>
        </dependency>
        <dependency>
            <groupId>systems.uom</groupId>
            <artifactId>systems-ucum-java8</artifactId>
            <version>0.7.1</version>
        </dependency>

to a pom.xml on the line where I try and access UCUM.JOULE for the first time. It looks likely that the cause is that I've ended up with assorted versions of systems-ucum-java8's dependencies (including some as old as 0.4). I imagine this might be best solved with a change to either the pom.xml to reflect the requirements or at minimum the readme.

Yes, the jackson module seems to specify requirements more strongly and is requesting things that are now further out of date.

keilw commented 7 years ago

I created https://github.com/unitsofmeasurement/jackson-module-unitsofmeasure/issues/6, see above. The 1.3.5-SNAPSHOT should not have this problem any more. We plan to publish 1.3.5 after some tests. If you need it faster, please take the latest snapshot in the meantime.