Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-2754

Use @AliasFor to declare Spring's @Named from @DomainService(logicalTypeName)

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M5
    • Fix Version/s: 2.0.0-M6
    • Component/s: Isis Core
    • Labels:
      None

      Description

      attempted this, using:

      public @interface DomainService {
      
          // ...
          @AliasFor(annotation = Named.class, attribute = "value")
          String logicalTypeName() default "";
      
      } 

      however it results in:

      Caused by: org.springframework.core.annotation.AnnotationConfigurationException: @AliasFor declaration on attribute 'logicalTypeName' in annotation [org.apache.isis.applib.annotation.DomainService] declares an alias for attribute 'value' in annotation [javax.inject.Named] which is not meta-present. 
      at org.springframework.core.annotation.AnnotationTypeMapping.validateAllAliasesClaimed(AnnotationTypeMapping.java:372) 
      at org.springframework.core.annotation.AnnotationTypeMapping.afterAllMappingsSet(AnnotationTypeMapping.java:359) 
      at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) 
      at org.springframework.core.annotation.AnnotationTypeMappings.<init>(AnnotationTypeMappings.java:69) 
      at org.springframework.core.annotation.AnnotationTypeMappings.<init>(AnnotationTypeMappings.java:46) 
      at org.springframework.core.annotation.AnnotationTypeMappings$Cache.createMappings(AnnotationTypeMappings.java:245) 
      at java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330) 

      that means we need to add @Named to @DomainService

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                danhaywood Daniel Keir Haywood
                Reporter:
                danhaywood Daniel Keir Haywood
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: