Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1014

Message about missing or wrong retention policy of a marker annotation is misleading

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 5.1.0.5
    • 5.2.0
    • tapestry-ioc
    • None

    Description

      Using another renetion policy policy than RUNTIME for a marker annotation leads to the following exception

      Caused by: java.lang.IllegalArgumentException: Marker annotation class org.example.Blue is not valid because it is not visible at runtime. Add a @RetentionPolicy(RUNTIME) to the class.
      at org.apache.tapestry5.ioc.internal.util.InternalUtils.validateMarkerAnnotation(InternalUtils.java:698)
      at org.apache.tapestry5.ioc.internal.util.InternalUtils.validateMarkerAnnotations(InternalUtils.java:703)
      at org.apache.tapestry5.ioc.internal.ServiceBinderImpl.withMarker(ServiceBinderImpl.java:292)

      A proper mesage is:

      Add a @Retention(RetentionPolicy.RUNTIME) to the class.

      Attachments

        Activity

          People

            igor.drobiazko Igor Drobiazko
            igor.drobiazko Igor Drobiazko
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: