0 Replies Latest reply on Oct 27, 2011 8:49 AM by Pedro Igor

    Hot Rod Client using a Indexed Cache

    Pedro Igor Master



          I'm using a Hot Rod client to put a entry in a cache configured with <indexing/> configuration. The entry has a long type as key and it's value is a serializable class.


          When I try to put a entry on the cache it throws the following exception:


                     java.lang.IllegalArgumentException: Indexing only works with entries keyed on Strings, primitives and classes that have the @Transformable annotation - you passed in a class org.infinispan.util.ByteArrayKey

          at org.infinispan.query.backend.KeyTransformationHandler.keyToString(KeyTransformationHandler.java:149)

          at org.infinispan.query.backend.QueryInterceptor.addToIndexes(QueryInterceptor.java:197)

          at org.infinispan.query.backend.QueryInterceptor.visitPutKeyValueCommand(QueryInterceptor.java:103)


          If I remove the <indexing/> configuration the put works perfectly. Looking at the code I realize that what is passed to the method KeyTransformationHandler.keyToString is a instance of org.infinispan.util.ByteArrayKey and threre is no way to convert it to a String.


          This is a bug or there is another way to put a entry on a indexed cache using Hot Rod ?


      Thanks in advance.