Hi Maureen, Make sure that at cfg.setIndexedTypes(GeoCoordinate.class, SurveyImage.class) you are specifying key-value pairs for each type you want to register. I mean it should be cfg.setIndexedTypes(SomeGeoCoordinateKey.class, GeoCoordinate.class, SomeSurveyImageKey.class, SurveyImage.class)
Kind regards, Alex. On Wed, Jul 19, 2017 at 2:44 PM, Maureen Lawless [via Apache Ignite Users] < [email protected]> wrote: > Hi, > > Now i can see the cache and see the objects created in it using > cache.iterator(). > > I would like to use a query to search the cache, so i have set indexed > types on the cache configuration. > > Server configuration: > > public void initCache() { > Ignite ignite = Ignition.start(igniteConfiguration. > getIgniteConfigurationFilename()); > > CacheConfiguration cfg = new CacheConfiguration("IMAGE_CACHE"); > cfg.setIndexedTypes(GeoCoordinate.class, SurveyImage.class); > cache = ignite.getOrCreateCache(cfg); > } > > Client configuration: > > public void initCache() { > > Ignition.setClientMode(true); > Ignite ignite = Ignition.start(igniteConfiguration. > getIgniteConfigurationFilename()); > > CacheConfiguration cfg = new > CacheConfiguration("IMAGE_CACHE"); > > cfg.setIndexedTypes(GeoCoordinate.class, > SurveyImage.class); > > // cfg.setCacheMode(CacheMode.PARTITIONED); > cache = ignite.getOrCreateCache(cfg); > > } > > But when initCache() is called on the client i get the following > exception: > > >>> +----------------------------------------------------------------------+ > > >>> Ignite ver. 2.0.0#20170430-sha1:d4eef3c68ff116ee34bc13648cd82c640b3ea072 > > >>> +----------------------------------------------------------------------+ > > >>> OS name: Windows 10 10.0 amd64 > >>> CPU(s): 4 > >>> Heap: 1.8GB > >>> VM name: 5544@mlawlessJMLW742 > >>> Local node [ID=D05F35DD-5899-452C-B74B-819FB3318E11, order=4, > clientMode=true] > >>> Local node addresses: [mlawlessJMLW742.ammeon.com/0:0:0:0:0:0:0:1, / > 127.0.0.1, /172.19.29.194] > >>> Local ports: TCP:47101 > > [12:36:59] Topology snapshot [ver=4, servers=1, clients=1, CPUs=4, > heap=2.8GB] > 2017-07-19 12:36:59.488 INFO 5544 --- [ main] > o.a.i.i.m.d.GridDiscoveryManager > : Topology snapshot [ver=4, servers=1, clients=1, CPUs=4, > heap=2.8GB] > 2017-07-19 12:36:59.754 ERROR 5544 --- [orker-#24%null%] .c.d.d.p. > GridDhtPartitionsExchangeFuture : Failed to reinitialize local partitions > (preloading will be stopped): GridDhtPartitionExchangeId > [topVer=AffinityTopologyVersion > [topVer=4, minorTopVer=1], nodeId=d05f35dd, evt=DISCOVERY_CUSTOM_EVT] > > org.apache.ignite.IgniteCheckedException: Failed to register query type: > QueryTypeDescriptorImpl [space=IMAGE_CACHE, name=SurveyImage, tblName=null, > fields={latitude=class java.lang.Float, longitude=class java.lang.Float, > gasCompany=class java.lang.String, surveyCompany=class java.lang.String, > survey=class java.lang.String, session=class java.lang.String, camera=class > java.lang.String, fileName=class java.lang.String, fileLocation=class > java.lang.String, geoCoordinate=class > com.cathx.fileloader.model.GeoCoordinate}, > idxs={SurveyImage_geoCoordinate_idx=QueryIndexDescriptorImpl > [name=SurveyImage_geoCoordinate_idx, type=SORTED, inlineSize=-1]}, > fullTextIdx=null, keyCls=class java.lang.Object, valCls=class > java.lang.Object, keyTypeName=com.cathx.fileloader.model.GeoCoordinate, > valTypeName=com.cathx.fileloader.model.SurveyImage, valTextIdx=false, > typeId=0, affKey=null, keyFieldName=null, valFieldName=null, > obsolete=false] > at org.apache.ignite.internal.processors.query.h2. > IgniteH2Indexing.registerType(IgniteH2Indexing.java:1866) > ~[ignite-indexing-2.0.0.jar!/:2.0.0] > at org.apache.ignite.internal.processors.query.GridQueryProcessor. > registerCache0(GridQueryProcessor.java:1306) > ~[ignite-core-2.0.0.jar!/:2.0.0] > at org.apache.ignite.internal.processors.query.GridQueryProcessor. > onCacheStart0(GridQueryProcessor.java:756) ~[ignite-core-2.0.0.jar!/:2.0.0] > > at org.apache.ignite.internal.processors.query.GridQueryProcessor. > onCacheStart(GridQueryProcessor.java:817) ~[ignite-core-2.0.0.jar!/:2.0.0] > > at org.apache.ignite.internal.processors.cache. > GridCacheProcessor.startCache(GridCacheProcessor.java:1265) > ~[ignite-core-2.0.0.jar!/:2.0.0] > at org.apache.ignite.internal.processors.cache.GridCacheProcessor. > prepareCacheStart(GridCacheProcessor.java:1943) > ~[ignite-core-2.0.0.jar!/:2.0.0] > at org.apache.ignite.internal.processors.cache.GridCacheProcessor. > prepareCacheStart(GridCacheProcessor.java:1833) > ~[ignite-core-2.0.0.jar!/:2.0.0] > at org.apache.ignite.internal.processors.cache. > CacheAffinitySharedManager.onCacheChangeRequest( > CacheAffinitySharedManager.java:379) ~[ignite-core-2.0.0.jar!/:2.0.0] > at org.apache.ignite.internal.processors.cache.distributed. > dht.preloader.GridDhtPartitionsExchangeFuture.onCacheChangeRequest( > GridDhtPartitionsExchangeFuture.java:688) ~[ignite-core-2.0.0.jar!/:2.0.0] > > at org.apache.ignite.internal.processors.cache.distributed. > dht.preloader.GridDhtPartitionsExchangeFuture.init( > GridDhtPartitionsExchangeFuture.java:529) ~[ignite-core-2.0.0.jar!/:2.0.0] > > at org.apache.ignite.internal.processors.cache. > GridCachePartitionExchangeManager$ExchangeWorker.body( > GridCachePartitionExchangeManager.java:1806) [ignite-core-2.0.0.jar!/:2.0.0] > > at > org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110) > [ignite-core-2.0.0.jar!/:2.0.0] > at java.lang.Thread.run(Unknown Source) [na:1.8.0_131] > Caused by: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement > "CREATE TABLE ""IMAGE_CACHE"".SURVEYIMAGE (_KEY OTHER INVISIBLE[*] NOT > NULL,_VAL OTHER INVISIBLE,_VER OTHER INVISIBLE,LATITUDE REAL,LONGITUDE > REAL,GASCOMPANY VARCHAR,SURVEYCOMPANY VARCHAR,SURVEY VARCHAR,SESSION > VARCHAR,CAMERA VARCHAR,FILENAME VARCHAR,FILELOCATION VARCHAR,GEOCOORDINATE > OTHER) ENGINE ""org.apache.ignite.internal.processors.query.h2. > IgniteH2Indexing$H2TableEngine"" "; expected "(, FOR, UNSIGNED, NOT, > NULL, AS, DEFAULT, GENERATED, NOT, NULL, AUTO_INCREMENT, BIGSERIAL, SERIAL, > IDENTITY, NULL_TO_DEFAULT, SEQUENCE, SELECTIVITY, COMMENT, CONSTRAINT, > PRIMARY, UNIQUE, NOT, NULL, CHECK, REFERENCES, ,, )"; SQL statement: > CREATE TABLE "IMAGE_CACHE".SurveyImage (_key OTHER INVISIBLE NOT NULL,_val > OTHER INVISIBLE,_ver OTHER INVISIBLE,latitude REAL,longitude > REAL,gasCompany VARCHAR,surveyCompany VARCHAR,survey VARCHAR,session > VARCHAR,camera VARCHAR,fileName VARCHAR,fileLocation VARCHAR,geoCoordinate > OTHER) engine "org.apache.ignite.internal.processors.query.h2. > IgniteH2Indexing$H2TableEngine" [42001-194] > at > org.h2.message.DbException.getJdbcSQLException(DbException.java:345) > ~[h2-1.4.194.jar!/:na] > at org.h2.message.DbException.getSyntaxError(DbException.java:205) > ~[h2-1.4.194.jar!/:na] > at org.h2.command.Parser.getSyntaxError(Parser.java:539) > ~[h2-1.4.194.jar!/:na] > at org.h2.command.Parser.read(Parser.java:3242) > ~[h2-1.4.194.jar!/:na] > at org.h2.command.Parser.readIfMore(Parser.java:887) > ~[h2-1.4.194.jar!/:na] > > Any idea what might be causing the problem? > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://apache-ignite-users.70518.x6.nabble.com/Ignite- > client-not-seeing-cache-created-by-server-tp15070p15117.html > To start a new topic under Apache Ignite Users, email > [email protected] > To unsubscribe from Apache Ignite Users, click here > <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=YWxleGFuZGVyLmZlZG90b2ZmQGdtYWlsLmNvbXwxfC0xMzYxNTU0NTg=> > . > NAML > <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-client-not-seeing-cache-created-by-server-tp15070p15136.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
