Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-12534

CacheConfigurationException message ISPN028021 should return that it is missing an annotation in the field

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 12.0.0.Final
    • 12.0.0.Final
    • Remote Querying
    • None

      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.

         @Indexed
         @ProtoDoc("@Indexed")
         public static final class User {
      
            @ProtoField(number = 1)
            Long id;
      
            @ProtoField(number = 2)
            String name;
         }
      

      When creating a cache, the server is returning

      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)
      

      As you can see, the entity has the @Indexed annotation.

      What is missing is the @ProtoDoc annotation in the field, as the following

         @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;
         }
      

              gfernand@redhat.com Gustavo Fernandes (Inactive)
              dlovison@redhat.com Diego Lovison
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: