geomesa-input-error

文章目录

导入失败

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
ERROR java.lang.NoSuchMethodError: org.locationtech.jts.geom.Polygon.getExteriorRing()Lorg/locationtech/jts/geom/LineString;
java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: org.locationtech.jts.geom.Polygon.getExteriorRing()Lorg/locationtech/jts/geom/LineString;
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$$anonfun$runIngest$1.apply(LocalConverterIngest.scala:183)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$$anonfun$runIngest$1.apply(LocalConverterIngest.scala:183)
at scala.collection.immutable.List.foreach(List.scala:381)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest.runIngest(LocalConverterIngest.scala:183)
at org.locationtech.geomesa.tools.ingest.AbstractConverterIngest.run(AbstractConverterIngest.scala:41)
at org.locationtech.geomesa.tools.ingest.IngestCommand$$anonfun$execute$2.apply(IngestCommand.scala:106)
at org.locationtech.geomesa.tools.ingest.IngestCommand$$anonfun$execute$2.apply(IngestCommand.scala:105)
at scala.Option.foreach(Option.scala:257)
at org.locationtech.geomesa.tools.ingest.IngestCommand$class.execute(IngestCommand.scala:105)
at org.locationtech.geomesa.hbase.tools.HBaseRunner$$anon$2.execute(HBaseRunner.scala:32)
at org.locationtech.geomesa.tools.Runner$class.main(Runner.scala:30)
at org.locationtech.geomesa.hbase.tools.HBaseRunner$.main(HBaseRunner.scala:17)
at org.locationtech.geomesa.hbase.tools.HBaseRunner.main(HBaseRunner.scala)
Caused by: java.lang.NoSuchMethodError: org.locationtech.jts.geom.Polygon.getExteriorRing()Lorg/locationtech/jts/geom/LineString;
at org.locationtech.geomesa.features.serialization.WkbSerialization$class.writePolygon(WkbSerialization.scala:121)
at org.locationtech.geomesa.features.serialization.WkbSerialization$class.serializeWkb(WkbSerialization.scala:45)
at org.locationtech.geomesa.features.kryo.serialization.KryoGeometrySerialization$.serializeWkb(KryoGeometrySerialization.scala:14)
at org.locationtech.geomesa.features.serialization.WkbSerialization$class.writeGeometryCollection(WkbSerialization.scala:176)
at org.locationtech.geomesa.features.serialization.WkbSerialization$class.serializeWkb(WkbSerialization.scala:48)
at org.locationtech.geomesa.features.kryo.serialization.KryoGeometrySerialization$.serializeWkb(KryoGeometrySerialization.scala:14)
at org.locationtech.geomesa.features.kryo.impl.KryoFeatureSerialization$KryoGeometryWkbWriter$.apply(KryoFeatureSerialization.scala:228)
at org.locationtech.geomesa.features.kryo.impl.KryoFeatureSerialization$class.writeFeature(KryoFeatureSerialization.scala:70)
at org.locationtech.geomesa.features.kryo.impl.KryoFeatureSerialization$class.serialize(KryoFeatureSerialization.scala:42)
at org.locationtech.geomesa.features.kryo.KryoFeatureSerializer$MutableActiveSerializer.serialize(KryoFeatureSerializer.scala:75)
at org.locationtech.geomesa.index.api.WritableFeature$FeatureLevelWritableFeature$$anonfun$values$1$$anonfun$apply$1.apply(WritableFeature.scala:154)
at org.locationtech.geomesa.index.api.WritableFeature$FeatureLevelWritableFeature$$anonfun$values$1$$anonfun$apply$1.apply(WritableFeature.scala:154)
at org.locationtech.geomesa.index.api.package$KeyValue.value$lzycompute(package.scala:184)
at org.locationtech.geomesa.index.api.package$KeyValue.value(package.scala:184)
at org.locationtech.geomesa.hbase.data.HBaseIndexAdapter$HBaseIndexWriter$$anonfun$write$1.apply(HBaseIndexAdapter.scala:614)
at org.locationtech.geomesa.hbase.data.HBaseIndexAdapter$HBaseIndexWriter$$anonfun$write$1.apply(HBaseIndexAdapter.scala:612)
at scala.collection.Iterator$class.foreach(Iterator.scala:742)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1194)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at org.locationtech.geomesa.hbase.data.HBaseIndexAdapter$HBaseIndexWriter.write(HBaseIndexAdapter.scala:612)
at org.locationtech.geomesa.index.api.IndexAdapter$BaseIndexWriter.write(IndexAdapter.scala:149)
at org.locationtech.geomesa.index.geotools.GeoMesaFeatureWriter$class.writeFeature(GeoMesaFeatureWriter.scala:52)
at org.locationtech.geomesa.index.geotools.GeoMesaFeatureWriter$TableFeatureWriter.writeFeature(GeoMesaFeatureWriter.scala:141)
at org.locationtech.geomesa.index.geotools.GeoMesaFeatureWriter$GeoMesaAppendFeatureWriter$class.write(GeoMesaFeatureWriter.scala:227)
at org.locationtech.geomesa.index.geotools.GeoMesaFeatureWriter$$anon$3.write(GeoMesaFeatureWriter.scala:108)
at org.locationtech.geomesa.utils.geotools.FeatureUtils$.write(FeatureUtils.scala:141)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker$1$$anonfun$run$1$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(LocalConverterIngest.scala:117)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker$1$$anonfun$run$1$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(LocalConverterIngest.scala:115)
at scala.collection.Iterator$class.foreach(Iterator.scala:742)
at org.locationtech.geomesa.utils.collection.CloseableIterator$FlatMapCloseableIterator.foreach(CloseableIterator.scala:133)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker$1$$anonfun$run$1$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$4$$anonfun$apply$5.apply(LocalConverterIngest.scala:115)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker$1$$anonfun$run$1$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$4$$anonfun$apply$5.apply(LocalConverterIngest.scala:109)
at org.locationtech.geomesa.utils.io.CloseablePool$CommonsPoolPool.borrow(CloseablePool.scala:68)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker$1$$anonfun$run$1$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$4.apply(LocalConverterIngest.scala:109)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker$1$$anonfun$run$1$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$4.apply(LocalConverterIngest.scala:108)
at org.locationtech.geomesa.utils.io.package$WithClose$.apply(package.scala:64)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker$1$$anonfun$run$1$$anonfun$apply$1$$anonfun$apply$2.apply(LocalConverterIngest.scala:108)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker$1$$anonfun$run$1$$anonfun$apply$1$$anonfun$apply$2.apply(LocalConverterIngest.scala:106)
at scala.collection.Iterator$class.foreach(Iterator.scala:742)
at org.locationtech.geomesa.utils.collection.CloseableIterator$CloseableSingleIterator.foreach(CloseableIterator.scala:86)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker$1$$anonfun$run$1$$anonfun$apply$1.apply(LocalConverterIngest.scala:106)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker$1$$anonfun$run$1$$anonfun$apply$1.apply(LocalConverterIngest.scala:105)
at org.locationtech.geomesa.utils.io.package$WithClose$.apply(package.scala:64)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker$1$$anonfun$run$1.apply(LocalConverterIngest.scala:105)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker$1$$anonfun$run$1.apply(LocalConverterIngest.scala:102)
at org.locationtech.geomesa.utils.io.CloseablePool$CommonsPoolPool.borrow(CloseablePool.scala:68)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker$1.run(LocalConverterIngest.scala:102)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

这个是由于 lib下面的几个包出现问题包括 jts ,geotool的包有问题 这边操作

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
[root@node-kubeadm-250 geomesa-hbase_2.11-3.1.0]# bin/geomesa-hbase ingest --catalog china --feature-name china_1 --input-format shp "/usr/local/geomesa/china.shp"
INFO No converter defined - will attempt to detect schema from input files
INFO Inferred converter:
{
"fields" : [
{
"name" : "the_geom",
"transform" : "$1"
},
{
"name" : "adcode",
"transform" : "$2"
},
{
"name" : "name",
"transform" : "$3"
},
{
"name" : "childrenNu",
"transform" : "$4"
},
{
"name" : "level",
"transform" : "$5"
},
{
"name" : "subFeature",
"transform" : "$6"
},
{
"name" : "adchar",
"transform" : "$7"
}
],
"id-field" : "$0",
"options" : {
"encoding" : "UTF-8",
"error-mode" : "skip-bad-records",
"parse-mode" : "incremental",
"validators" : [
"index"
]
},
"type" : "shp"
}

Use inferred converter (y/n)? y
Persist this converter for future use (y/n)? y
INFO Added import in reference.conf and saved inferred converter to /usr/local/geomesa/geomesa-hbase_2.11-3.1.0/conf/china_1_4.conf
INFO In future commands, the converter may be invoked with '--converter china_1'
INFO Schema 'china_1' exists
INFO Running ingestion in local mode
INFO Ingesting 1 file with 1 thread
[============================================================] 100% complete 35 ingested 0 failed in 00:00:01
INFO Local ingestion complete in 00:00:02
INFO Ingested 35 features with no failures for file: /usr/local/geomesa/china.shp

解决方法

在geotool中依赖jts这个类但是

gt-main-23.3.jar 里面使用的是jts-17.jar

gt-main-23.0.jar 里面使用的是jts-16.jar

所以需要降级 使用gt-main-23.0.jar 否则会报错