Hi Rafael,

I check the example from the paper you mentioned, and it works for me, for
multiple clients too. Could you please provide code for your test case?
Getting NPE is definitely a bug, and we should fix it. But maybe we have a
workaround for your case.

Thanks,
Maksim



On Mon, Feb 14, 2022 at 8:12 PM Troilo, Rafael <rafael.tro...@heigit.org>
wrote:

> Hi everyone,
>
> I try to use the ignite-geospatial extension[1] for ignite 2.12.0.
>
> But as soon as I create a spatial index with
>
> - sql: CREATE spatial INDEX ...
> - or via annotated classes like the MapPoint example [2]
>
> every new client connecting to the cluster get an NullPointerException
> message. The reason for that is a not set/null `GridCacheContext`.
>
> org.apache.ignite.internal.processors.query.h2.opt.GeoSpatialUtils.createIndex(GeoSpatialUtils.java:63)
>
> The client, creating the cache with index on geometry (MapPoint example),
> can access the cache and even do a spatial query as long it stays connected
> to the cluster.
>
> I could provide a Testcase if you like.
>
> Dose anyone have a working spatial index example?
>
> Thank you for your support.
> Best,
> Rafael
>
> SEVERE: Can't initialize query structures for not started cache
> [cacheName=points]
> class org.apache.ignite.IgniteException: Failed to instantiate:
> org.apache.ignite.internal.processors.query.h2.opt.GridH2SpatialIndex
>         at
> org.apache.ignite.internal.processors.query.h2.H2Utils.createSpatialIndex(H2Utils.java:332)
>         ....
> Caused by: java.lang.NullPointerException
>         at
> org.apache.ignite.internal.processors.query.h2.opt.GeoSpatialUtils.createIndex(GeoSpatialUtils.java:63)
>
> Exception in thread "main" javax.cache.CacheException: class
> org.apache.ignite.IgniteCheckedException: Type with name 'MapPoint' already
> indexed in cache 'points'.
> Caused by: class org.apache.ignite.IgniteCheckedException: Type with name
> 'MapPoint' already indexed in cache 'points'.
>         at
> org.apache.ignite.internal.processors.query.GridQueryProcessor.registerCache0(GridQueryProcessor.java:2158)
>         at
> org.apache.ignite.internal.processors.query.GridQueryProcessor.onCacheStart0(GridQueryProcessor.java:1029)
>         at
> org.apache.ignite.internal.processors.query.GridQueryProcessor.onCacheStart(GridQueryProcessor.java:1096)
>         at
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:1994)
>         at
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.lambda$prepareStartCaches$55a0e703$1(GridCacheProcessor.java:1864)
>         at
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.lambda$prepareStartCaches$15(GridCacheProcessor.java:1816)
>         at
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareStartCaches(GridCacheProcessor.java:1861)
>         at
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareStartCaches(GridCacheProcessor.java:1815)
>         at
> org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.processClientCacheStartRequests(CacheAffinitySharedManager.java:481)
>         at
> org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.processClientCachesRequests(CacheAffinitySharedManager.java:702)
>         at
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.processCustomExchangeTask(GridCacheProcessor.java:446)
>         at
> org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.processCustomTask(GridCachePartitionExchangeManager.java:3135)
>         at
> org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body0(GridCachePartitionExchangeManager.java:3280)
>         at
> org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:3197)
>         at
> org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:125)
>         at java.base/java.lang.Thread.run(Thread.java:830)
>
>
> [1] https://github.com/apache/ignite/tree/master/modules/geospatial
> [2]
> https://www.gridgain.com/resources/blog/geospatial-queries-apache-ignite
>
>
> --
> Rafael Troilo
> HeiGIT gGmbH
> Heidelberg Institute for Geoinformation Technology at Heidelberg University
>
> https://heigit.org | rafael.tro...@heigit.org | phone +49-6221-533 484
>
> Postal address: Schloss-Wolfsbrunnenweg 33 | 69118 Heidelberg | Germany
> Offices: Berliner Str. 45 | 69120 Heidelberg | Germany
>
> Amtsgericht Mannheim | HRB 733765
> Managing Directors: Prof. Dr. Alexander Zipf | Dr. Gesa Schönberger
>

Reply via email to