1 Reply Latest reply on Nov 4, 2013 4:27 AM by anistor

    Remote Query on Hotrod client infinispan 6.0.0.CR1

    rhymes_rhymes

      Hi,

      I'm trying to build sample application using Infinispan 6.0.0 CR1 release using remote query API on  hotrod client.When I tried to execute query on RemoteCacheManager using infinispan query we got below exception.

       

      Can someone kindly help for identifying the cause of below exception.

       

      Below are the steps I have followed for query using hotrod client.

      //Creating RemoteCacheManger instance

          ConfigurationBuilder builder = new ConfigurationBuilder();
         Configuration config = builder.addServer().host("localhost")
         .port(11222).marshaller(new ProtoStreamMarshaller()).build();
         delegate = new RemoteCacheManager(config);

       

      //For registration of ProtoBuff marshaller

         InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("Employee.protobin");
         ProtoStreamMarshaller.getSerializationContext(delegate).registerProtofile(is);
           ProtoStreamMarshaller.getSerializationContext(delegate)
         .registerMarshaller(Employee.class, new EmployeeMessageMarshaller());

       

      //Employee.java

      public class Employee{

       

      private int id;

       

      private String name;

       

      private String lastName;

       

      private String firstName;

      //setter and getter methods.

      }

       

      //Employee.proto file

      package com.example.project.model;

       

      message Employee {

       

         required int32 id = 1;

       

         required string name = 2;

        

         required string firstName = 3;

        

         required string lastName = 4;

      }

       

      //Cache Config

      <local-cache name="com.example.project.model.Employee" start="EAGER">

          <indexing index="LOCAL"/>

          <locking isolation="NONE" acquire-timeout="30000" concurrency-level="1000" striping="false"/>

          <transaction mode="NONE"/>

      </local-cache>

       

      Exception in thread "main" org.infinispan.client.hotrod.exceptions.HotRodClientException:Request for message id[9003] returned server error (status=0x85): java.lang.IllegalStateException: Unknown entity name com.example.project.model.Employee

          at org.infinispan.client.hotrod.impl.protocol.Codec10.checkForErrorsInResponseStatus(Codec10.java:143)

          at org.infinispan.client.hotrod.impl.protocol.Codec10.readHeader(Codec10.java:99)

          at org.infinispan.client.hotrod.impl.operations.HotRodOperation.readHeaderAndValidate(HotRodOperation.java:56)

          at org.infinispan.client.hotrod.impl.operations.QueryOperation.executeOperation(QueryOperation.java:68)

          at org.infinispan.client.hotrod.impl.operations.QueryOperation.executeOperation(QueryOperation.java:26)

          at org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation.execute(RetryOnFailureOperation.java:46)

          at org.infinispan.client.hotrod.impl.query.RemoteQuery.executeQuery(RemoteQuery.java:79)

          at org.infinispan.client.hotrod.impl.query.RemoteQuery.list(RemoteQuery.java:69)