Remote Query on Hotrod client infinispan 6.0.0.CR1
rhymes_rhymes Nov 4, 2013 2:27 AMHi,
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>
//Client log:
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)
//Server log
12:53:56,881 ERROR [org.infinispan.server.hotrod.HotRodDecoder] (HotRodServerWor
ker-298) ISPN005003: Exception reported: java.lang.IllegalStateException: Unknown entity name com.example.project.model.Employee
at org.hibernate.hql.ast.spi.SingleEntityQueryRendererDelegate.setTargetType(SingleEntityQueryRendererDelegate.java:120)
at org.hibernate.hql.ast.spi.SingleEntityQueryRendererDelegate.registerPersisterSpace(SingleEntityQueryRendererDelegate.java:103)
at org.hibernate.hql.ast.render.QueryRenderer.entityName(QueryRenderer.java:12325)
at org.hibernate.hql.ast.render.QueryRenderer.persisterSpaceRoot(QueryRenderer.java:3063)
at org.hibernate.hql.ast.render.QueryRenderer.persisterSpace(QueryRenderer.java:2955)
at org.hibernate.hql.ast.render.QueryRenderer.persisterSpaces(QueryRenderer.java:2892)
at org.hibernate.hql.ast.render.QueryRenderer.fromClause(QueryRenderer.java:2802)
at org.hibernate.hql.ast.render.QueryRenderer.selectFrom(QueryRenderer.java:2703)
at org.hibernate.hql.ast.render.QueryRenderer.querySpec(QueryRenderer.java:2181)
at org.hibernate.hql.ast.render.QueryRenderer.queryExpression(QueryRenderer.java:2105)
at org.hibernate.hql.ast.render.QueryRenderer.queryStatement(QueryRenderer.java:1744)
at org.hibernate.hql.ast.render.QueryRenderer.queryStatementSet(QueryRenderer.java:1657)
at org.hibernate.hql.ast.render.QueryRenderer.statement(QueryRenderer.java:653)
at org.hibernate.hql.ast.spi.QueryRendererProcessor.process(QueryRendererProcessor.java:51)
at org.hibernate.hql.QueryParser.parseQuery(QueryParser.java:82)
at org.infinispan.query.remote.QueryFacadeImpl.executeQuery(QueryFacadeImpl.java:149)
at org.infinispan.query.remote.QueryFacadeImpl.query(QueryFacadeImpl.java:64)
at org.infinispan.server.hotrod.Decoder10$.customReadKey(Decoder10.scala:222) [infinispan-server-hotrod-6.0.0.CR1.jar:6.0.0.CR1]
at org.infinispan.server.hotrod.HotRodDecoder.customDecodeKey(HotRodDecoder.scala:138) [infinispan-server-hotrod-6.0.0.CR1.jar:6.0.0.CR1]