Search code examples
geotoolsgeomesa

Geotools dependencies version mix


I am using Geotools to write a Java program to ingest data in Geomesa 2.0.2 but I am having this error when i try to run . the probleme is this

SimpleFeatureType simpleFeatureType=dataStore.getSchema("schemaname");


[WARNING]
java.lang.NoSuchMethodError: tec.uom.se.format.SimpleUnitFormat.getInstance()Lte                                                                                        c/uom/se/format/SimpleUnitFormat$FinalDefaultFormat;
    at si.uom.NonSI.addUnit (NonSI.java:642)
    at si.uom.NonSI.addUnit (NonSI.java:665)
    at si.uom.NonSI.<clinit> (NonSI.java:109)
    at org.geotools.referencing.datum.DefaultPrimeMeridian.<clinit> (DefaultPrim                                                                                        eMeridian.java:47)
    at org.geotools.referencing.datum.DefaultGeodeticDatum.<clinit> (DefaultGeod                                                                                        eticDatum.java:73)
    at org.geotools.referencing.crs.DefaultGeographicCRS.<clinit> (DefaultGeogra                                                                                        phicCRS.java:89)
    at org.locationtech.geomesa.utils.geotools.package$.liftedTree1$1 (package.s                                                                                        cala:27)
    at org.locationtech.geomesa.utils.geotools.package$.<init> (package.scala:27                                                                                        )
    at org.locationtech.geomesa.utils.geotools.package$.<clinit> (package.scala)
    at org.locationtech.geomesa.utils.geotools.AttributeSpec$GeomAttributeSpec.b                                                                                        uilderHook (SimpleFeatureSpec.scala:165)
    at org.locationtech.geomesa.utils.geotools.AttributeSpec$class.toDescriptor                                                                                         (SimpleFeatureSpec.scala:76)
    at org.locationtech.geomesa.utils.geotools.AttributeSpec$GeomAttributeSpec.t                                                                                        oDescriptor (SimpleFeatureSpec.scala:156)
    at org.locationtech.geomesa.utils.geotools.SimpleFeatureTypes$$anonfun$creat                                                                                        eFeatureType$1.apply (SimpleFeatureTypes.scala:233)
    at org.locationtech.geomesa.utils.geotools.SimpleFeatureTypes$$anonfun$creat                                                                                        eFeatureType$1.apply (SimpleFeatureTypes.scala:233)

In the beginning I was having classNotFound then I added the SI units dependencies

    <dependency>
    <groupId>javax.measure</groupId>
    <artifactId>unit-api</artifactId>
    <version>0.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/tec.uom/uom-se -->
<dependency>
    <groupId>tec.uom</groupId>
    <artifactId>uom-se</artifactId>
    <version>1.0.8</version>
</dependency>
<!-- https://mvnrepository.com/artifact/tec.uom.lib/uom-lib-common -->
<dependency>
    <groupId>tec.uom.lib</groupId>
    <artifactId>uom-lib-common</artifactId>
    <version>1.0.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/si.uom/si-units-java8 -->
<dependency>
    <groupId>si.uom</groupId>
    <artifactId>si-units-java8</artifactId>
    <version>0.9</version>
</dependency>

can anyone help me find the exact version of the dependencies specially Units Dependencies knowing that i'm using geomesa 2.0.2 and geotools 20-snapshot thanks


Solution

  • GeoMesa 2.0.2 isn't compatible with geotools 20. Geotools 20 introduced a new version of JTS that renames all the packages from com.vividsolutions.jts to org.locationtech.jts. For now, you should use geotools 19. GeoMesa is currently planning to update to geotools 20 for version 2.2.0, which should be released in the next few months.