Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-361

Missing Import-Package declaration in logback-classic causes problem with RollingFileAppender

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.0.0
    • 0.9.15
    • None
    • None
    • OSGi Service Platform Release 4

    Description

      In OSGi environment logback-core will correctly try to use the class-loader of logback-classic bundle to load classes of the selected Appenders. This however means that logback-classic needs to have visibility to the requested Appender classes. Since RollingFileAppender is located in a separate package "ch.qos.logback.core.rolling" and not explicitly referenced from logback-classic code, the respective Import-Package declaration will not be generated automatically by the BND tool (embedded in maven-bundle-plugin).

      In order to avoid ClassNotFound exceptions when trying to use RollingFileAppender the appropriate Import-Package declarations have to be added explicitly to the configuration of maven-bundle-plugin in logback-classic POM.

      The current <Import-Package> settings in maven-bundle-plugin configuration:

      <Import-Package>sun.reflect;resolution:=optional,
      javax.jms;resolution:=optional,
      *
      </Import-Package>

      Suggested update:

      <Import-Package>sun.reflect;resolution:=optional,
      javax.jms;resolution:=optional,
      ch.qos.logback.core.rolling,
      ch.qos.logback.core.rolling.helper,
      *
      </Import-Package>

      Please consider also to implement the related issue LBCLASSIC-121 when fixing this defect.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            pjuhos Pavol Juhos
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: