0

geotools wfs-ng データストア プラグインを geoserver インスタンスと一緒に使用すると大きな問題が発生します (geoserver はここでは問題ではありません。wfs の実装とデータのプロバイダーにすぎません)。ユースケースは明白なようです:

  • 基礎となる wfs への一種のプロキシであるカスタム Web サービス
  • Web サービス アプリケーションの起動中に wfs データ ストアを作成します。
final URL wfsUrl = new URL(url);
final WFSConfig wfsConfig = WFSConfig.fromParams(Map.of(
    WFSDataAccessFactory.AXIS_ORDER.key, WFSDataAccessFactory.AXIS_ORDER_EAST_NORTH));
final SimpleHttpClient httpClient = new SimpleHttpClient();
return new WFSDataStore(new WFSClient(wfsUrl, httpClient, wfsConfig));
  • 基になるwfsをプロキシするための連続したカスタムAPI呼び出しでそれを再利用します。以下の呼び出しの多くは複数のスレッドで実行されています
final SimpleFeatureSource eventsSource = dataStore.getFeatureSource(typeName);
final String geometryColumn = dataStore.getSchema(typeName).getGeometryDescriptor().getLocalName();
final Filter filter = filterOf(parameters, geometryColumn);
final SimpleFeatureCollection eventsFeatures = eventsSource.getFeatures(new Query(typeName, filter));
final SimpleFeatureIterator features = eventsFeatures.features();
try {
    while (features.hasNext()) {
        final SimpleFeature next = features.next();
        //do something
    }
} finally {
    features.close();
}

geotools wfs-ng データストア プラグインの試用バージョン: 22.3、23.5

症状:

  • wfs-ng プラグインの奇妙な動作は、すべての wfs GetFeature 呼び出しが DescribeFeatureType 呼び出しを解放することです (おそらく org.geotools.xsd.impl PullParser から、失敗しているように見えるスキーマに対して)、なぜ 1 つでは不十分なのですか?
  • マルチスレッド wfs 呼び出しの数の後 (少ない場合もあれば多い場合もある)
Caused by: java.lang.ArrayIndexOutOfBoundsException: arraycopy: last source index 94 out of bounds for object array[93]
    at java.base/java.lang.System.arraycopy(Native Method) ~[na:na]
    at org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapterList.ensureSafety(BasicNotifierImpl.java:214) ~[org.eclipse.emf.common-2.15.0.jar!/:na]
    at org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapterList.remove(BasicNotifierImpl.java:244) ~[org.eclipse.emf.common-2.15.0.jar!/:na]
    at org.geotools.xsd.impl.SchemaIndexImpl.destroy(SchemaIndexImpl.java:93) ~[gt-xsd-core-22.3.jar!/:na]
    at org.geotools.xsd.Encoder.encode(Encoder.java:1119) ~[gt-xsd-core-22.3.jar!/:na]
    at org.geotools.filter.v2_0.bindings.BinarySpatialOpTypeBinding$1.encode(BinarySpatialOpTypeBinding.java:70) ~[gt-xsd-fes-22.3.jar!/:na]
    at org.geotools.xsd.Encoder.encode(Encoder.java:727) ~[gt-xsd-core-22.3.jar!/:na]
    ... 103 common frames omitted

4

0 に答える 0