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

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

    XMLWordPrintable

Details

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

    Description

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

      Attachments

        Activity

          People

            gfernand@redhat.com Gustavo Fernandes (Inactive)
            dlovison@redhat.com Diego Lovison
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: