ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Magda <dma...@apache.org>
Subject Re: Rest API not working for GET
Date Thu, 07 Dec 2017 06:46:52 GMT
Did you create the SQL table using CREATE TABLE command? If it’s so then a cache name won’t
be equal to “Person” by default.

Pass “Person” as a cache name directly via CACHE_NAME parameter of CREATE TABLE as explained
here:
https://apacheignite-sql.readme.io/docs/create-table

—
Denis

> On Dec 1, 2017, at 4:48 AM, Naveen <naveen.bandaru@gmail.com> wrote:
> 
> I have another case where REST APi is not working. 
> 
> Here is the use case.
> I am using 2.3, have 4 nodes running as server and one node running as
> client and rest api is exposed only in the client. 
> 
> I was trying to access the client node which is exposing the rest API
> 
> Rest API does not seems to be working for the below. 
> 
> http://10.144.114.115:8080/ignite?cmd=get&key=1&cacheName=Person
> 
> {"successStatus":1,"sessionToken":null,"error":"Failed to handle request:
> [req=CACHE_GET, err=Failed to find cache for given cache name:
> Person]","response":null}
> 
>        at java.lang.Thread.run(Thread.java:748)
> [16:06:26,203][SEVERE][rest-#74%IgnitePOC%][GridCacheCommandHandler] Failed
> to execute cache command: GridRestCacheRequest [cacheName=Person,
> cacheFlags=0, ttl=null, super=GridRestRequest [destId=null, clientId=null,
> addr=/10.139.68.42:55810, cmd=CACHE_GET]]
> class org.apache.ignite.IgniteCheckedException: Failed to find cache for
> given cache name: Person
>        at
> org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler.localCache(GridCacheCommandHandler.java:815)
>        at
> org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler.executeCommand(GridCacheCommandHandler.java:738)
>        at
> org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler.handleAsync(GridCacheCommandHandler.java:440)
>        at
> org.apache.ignite.internal.processors.rest.GridRestProcessor.handleRequest(GridRestProcessor.java:266)
>        at
> org.apache.ignite.internal.processors.rest.GridRestProcessor.access$100(GridRestProcessor.java:89)
>        at
> org.apache.ignite.internal.processors.rest.GridRestProcessor$2.body(GridRestProcessor.java:155)
>        at
> org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
>        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)
> 
> 0: jdbc:ignite:thin://10.144.114.113> select * from person;
> +--------------------------------+--------------------------------+--------------------------------+
> |               ID               |              NAME              |           
> CITY_ID             |
> +--------------------------------+--------------------------------+--------------------------------+
> | 3                              | Mary Major                     | 1               
             
> |
> | 1                              | John Doe                       | 3               
             
> |
> | 2                              | Jane Roe                       | 2               
             
> |
> | 4                              | Richard Miles                  | 2               
             
> |
> +--------------------------------+--------------------------------+--------------------------------+
> 
> However, for another cache, rest api is working fine. 
> 
> http://10.144.114.115:8080/ignite?cmd=get&key=P100000007&cacheName=Customer
> 
> Here is the list of tables we have in the cluster.
> 
> 0: jdbc:ignite:thin://10.144.114.113> !tables
> +--------------------------------+--------------------------------+--------------------------------+--------------------------------+-------------------------------+
> |           TABLE_CAT            |          TABLE_SCHEM           |          
> TABLE_NAME           |           TABLE_TYPE           |            REMARKS          

> |
> +--------------------------------+--------------------------------+--------------------------------+--------------------------------+-------------------------------+
> |                                | PUBLIC                         | CITY            
             
> | TABLE                          |                               |
> |                                | Account                        | ACCOUNT         
             
> | TABLE                          |                               |
> |                                | Customer                       | CUSTOMER        
             
> | TABLE                          |                               |
> |                                | PUBLIC                         | PERSON          
             
> | TABLE                          |                               |
> +--------------------------------+--------------------------------+--------------------------------+--------------------------------+-------------------------------+
> 
> 
> Thanks
> Naveen
> 
> 
> 
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Mime
View raw message