3 Replies Latest reply on Feb 26, 2016 11:35 AM by franco80

    Queries on Infinispan 8.1.2.Final and HotRodClientException: ... Unknown entity name Book

    franco80 Novice

      Hi all

       

      I use cluster and remote cache to gather information from cache. Now i'm trying to use Query like here:

       

                Book f = new Book("goodBook", "description", 2016);

                cache.put("namedCacheKey", f);

                final QueryFactory<Query> qf = Search.getQueryFactory(cache);

                Query query = qf.from(Book.class).having("title").eq("goodBook").toBuilder().build();

                query.list();

       

      When last line is called I recive the error:

      Exception in thread "main" org.infinispan.client.hotrod.exceptions.HotRodClientException:Request for messageId=7 returned server error (status=0x85): java.lang.IllegalStateException: Unknown entity name Book

       

      My client configuration looks:

       

              final ConfigurationBuilder builder = new ConfigurationBuilder();

              builder.marshaller(new ProtoStreamMarshaller());

              builder.addCluster("infinispan-cluster").

           

                  addClusterNode("10.42.10.120", ConfigurationProperties.DEFAULT_HOTROD_PORT).

                  addClusterNode("10.42.10.121", ConfigurationProperties.DEFAULT_HOTROD_PORT).

       

                  addServers("10.42.10.120:11222;10.42.10.121:11222");

           

              final Configuration build = builder.build(true);

              final RemoteCacheManager cacheManager = new RemoteCacheManager(build);

              String filename = "library.proto";

              InputStream is = MarshallerRegistration.class.getResourceAsStream("/" + filename);

              FileDescriptorSource protoFile = new FileDescriptorSource();

              protoFile.addProtoFile(filename, is);

                 //ProtoStreamMarshaller.getSerializationContext(cacheManager).registerProtoFiles(protoFile);

                 SerializationContext ctx = ProtoStreamMarshaller.getSerializationContext(cacheManager);

                 ctx.registerProtoFiles(protoFile);

                 ctx.registerMarshaller(new BookMarshaller());

       

      Logs:

       

      4 [main] DEBUG org.jboss.logging  - Logging Provider: org.jboss.logging.Log4jLoggerProvider

      51 [main] DEBUG org.infinispan.protostream.impl.SerializationContextImpl  - Registering proto files : [org/infinispan/protostream/message-wrapping.proto]

      84 [main] DEBUG org.infinispan.protostream.impl.SerializationContextImpl  - Registering file descriptor : fileName=org/infinispan/protostream/message-wrapping.proto types=[org.infinispan.protostream.WrappedMessage]

      198 [main] DEBUG org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory  - Add secondary cluster: ClusterInfo{name='infinispan-cluster', addresses=[/10.42.10.120:11222]}

      200 [main] DEBUG org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory  - Statically configured servers: [/10.42.10.120:11222]

      200 [main] DEBUG org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory  - Load balancer class: org.infinispan.client.hotrod.impl.transport.tcp.RoundRobinBalancingStrategy

      200 [main] DEBUG org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory  - Tcp no delay = true; client socket timeout = 60000 ms; connect timeout = 60000 ms

      293 [main] INFO org.infinispan.client.hotrod.impl.protocol.Codec21  - ISPN004006: /10.42.10.120:11222 sent new topology view (id=0, age=0) containing 1 addresses: [/10.42.10.120:11222]

      293 [main] DEBUG org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory  - Same list of servers, not changing the pool

      298 [main] INFO org.infinispan.client.hotrod.RemoteCacheManager  - ISPN004021: Infinispan version: 8.1.2.Final

      300 [main] DEBUG org.infinispan.protostream.impl.SerializationContextImpl  - Registering proto files : [library.proto]

      300 [main] DEBUG org.infinispan.protostream.impl.SerializationContextImpl  - Registering file descriptor : fileName=library.proto types=[Book]

      300 [main] DEBUG org.infinispan.protostream.impl.SerializationContextImpl  - Registering file descriptor : fileName=org/infinispan/protostream/message-wrapping.proto types=[org.infinispan.protostream.WrappedMessage]

      311 [main] INFO org.infinispan.client.hotrod.impl.protocol.Codec21  - ISPN004006: /10.42.10.120:11222 sent new topology view (id=0, age=0) containing 1 addresses: [/10.42.10.120:11222]

      312 [main] DEBUG org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory  - Same list of servers, not changing the pool

      312 [main] DEBUG org.infinispan.client.hotrod.impl.RemoteCacheImpl  - Start called, nothing to do here(namedCache)

      353 [main] DEBUG RemoteCacheManagerTest  - namedCache.size(): 1

      377 [main] DEBUG RemoteCacheManagerTest  - Named Key: namedCacheKey / value: Book@57855c9a

      384 [main] DEBUG org.infinispan.protostream.impl.SerializationContextImpl  - Registering proto files : [org/infinispan/protostream/message-wrapping.proto, org/infinispan/query/remote/client/query.proto]

      398 [main] DEBUG org.infinispan.protostream.impl.SerializationContextImpl  - Registering file descriptor : fileName=library.proto types=[Book]

      409 [main] DEBUG org.infinispan.protostream.impl.SerializationContextImpl  - Registering file descriptor : fileName=org/infinispan/query/remote/client/query.proto types=[org.infinispan.query.remote.client.FilterResult, org.infinispan.query.remote.client.QueryRequest.NamedParameter, org.infinispan.query.remote.client.QueryResponse, org.infinispan.query.remote.client.ContinuousQueryResult, org.infinispan.query.remote.client.QueryRequest]

      421 [main] DEBUG org.infinispan.protostream.impl.SerializationContextImpl  - Registering file descriptor : fileName=org/infinispan/protostream/message-wrapping.proto types=[org.infinispan.protostream.WrappedMessage]

      488 [main] WARN org.infinispan.client.hotrod.impl.protocol.Codec21  - ISPN004005: Error received from the server: java.lang.IllegalStateException: Unknown entity name Book

      Exception in thread "main" org.infinispan.client.hotrod.exceptions.HotRodClientException:Request for messageId=7 returned server error (status=0x85): java.lang.IllegalStateException: Unknown entity name Book

          at org.infinispan.client.hotrod.impl.protocol.Codec20.checkForErrorsInResponseStatus(Codec20.java:343)

          at org.infinispan.client.hotrod.impl.protocol.Codec20.readPartialHeader(Codec20.java:132)

          at org.infinispan.client.hotrod.impl.protocol.Codec20.readHeader(Codec20.java:118)

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

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

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

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

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

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

          at RemoteCacheManagerTest.hibernateSearch(RemoteCacheManagerTest.java:91)

          at RemoteCacheManagerTest.main(RemoteCacheManagerTest.java:36)

       

      Others files are attached.

       

      Any idea what can cause this ?

       

      regards