Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-2754

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

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.0-M5
    • 2.0.0-M6
    • Core
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: