[Red Hat JIRA] (ISPN-12534) CacheConfigurationException message ISPN028021 should return that it is missing an annotation in the field
by Diego Lovison (Jira)
Diego Lovison created ISPN-12534:
------------------------------------
Summary: CacheConfigurationException message ISPN028021 should return that it is missing an annotation in the field
Key: ISPN-12534
URL: https://issues.redhat.com/browse/ISPN-12534
Project: Infinispan
Issue Type: Bug
Components: Remote Querying
Reporter: Diego Lovison
Attachments: query.diff
When creating a cache with an indexed entity with the wrong configuration. Infinispan is returning the wrong message.
If the java class has the following content.
{code:java}
@Indexed
@ProtoDoc("@Indexed")
public static final class User {
@ProtoField(number = 1)
Long id;
@ProtoField(number = 2)
String name;
}
{code}
When creating a cache, the server is returning
{noformat}
Exception in thread "main" org.infinispan.client.hotrod.exceptions.HotRodClientException:Request for messageId=10 returned server error (status=0x85): org.infinispan.commons.CacheConfigurationException: ISPN028021: The configured indexed-entity type 'black_friday.User' must be indexed. Please annotate it with @Indexed or remove it from the configuration.
at org.infinispan.client.hotrod.impl.protocol.Codec20.checkForErrorsInResponseStatus(Codec20.java:335)
{noformat}
As you can see, the entity has the @Indexed annotation.
What is missing is the @ProtoDoc annotation in the field, as the following
{code:java}
@Indexed
@ProtoDoc("@Indexed")
public static final class User {
@ProtoDoc("@Field(index=Index.YES, analyze = Analyze.YES, store = Store.NO)")
@ProtoField(number = 1)
Long id;
@ProtoField(number = 2)
String name;
}
{code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
3 years, 6 months