Uploaded image for project: 'CAL10N'
  1. CAL10N
  2. CAL-42

Missing @BaseName annotation in enum type when running in OSGI for version 0.8.1

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Version 0.8.1

    Description

      Let a bundle embed cal10n-api-0.8.1.jar.

      Let another bundle declare an enum annotated like this
      @BaseName(value="messages")
      @LocaleData(
      defaultCharset = "UTF-8",
      value =

      { @Locale("es"), @Locale("en") }

      )

      Maven compilation works fine. It detects missing messages_es.properties, messages_en.properties files. It even detects empty bundles.

      But when resolving a message the following exception gets thrown.

      Caused by: ch.qos.cal10n.MessageConveyorException: Missing @BaseName annotation in enum type [com.bbva.elara.instrumentation.bundle.Messages]. See also http://cal10n.qos.ch/codes.html#missingBaseNameAnnotation

      It looks like the expression
      BaseName rbnAnnotation = enumClass.getAnnotation(BaseName.class);
      from the AnnotationExtractorViaEnumClass is evaluating to null. If this is the case It might be caused by the fact that the BaseName class is loaded by the classloader of bundle A while the enumClass (which is the declaring class) is loaded by bundle's B classloader.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            rjuarez Roberto Juarez
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: