You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by "16616221@qq.com" <16...@qq.com> on 2016/03/23 09:03:40 UTC

How to access the cache using rest api?

hi experts, 

I have imported data from mysql table to ignite cache using
ignite-schema-import. 
The utility has generated the cache key class as follow: 

public class Testtable1Key implements Serializable { 
    /** */ 
    private static final long serialVersionUID = 0L; 

    /** Value for id. */ 
    private String id; 

..... 

Now, I want to access the cache using rest api, like 
http://localhost:8080/ignite?cmd=get&key=1&cacheName=TestTable1Cache

I got the response: 
{"error":"javax.cache.CacheException: Failed to find mapping description
[cache=TestTable1Cache, typeId=class java.lang.String]. Please configure
JdbcType to associate cache 'TestTable1Cache' with
JdbcPojoStore.","response":null,"sessionToken":"","successStatus":1} 


It seems that rest api can only accept key with string value.Is that true? 

How can I access the cache using rest api? 

Any suggestion will be appreciated! 

Tony 




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-access-the-cache-using-rest-api-tp3632.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How to access the cache with jdbc store using rest api?

Posted by vkulichenko <va...@gmail.com>.
Hi Tony,

REST API can work with objects, it converts them to JSON format. Looks like
there is some kind of misconfiguration which caused the exception to fail on
the server side. Can you check the logs and provide the full trace?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-access-the-cache-with-jdbc-store-using-rest-api-tp3632p3643.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.