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

PackagingDataCalculator cannot use getCallerClass() under Java 7u40

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.1.0
    • 1.0.11
    • logback-classic
    • None
    • Java 7 update 40

    Description

      PackagingDataCalculator prints the following exception during initialization when running under Java 7 update 40:

      java.lang.UnsupportedOperationException: This method is in the sun.* namespace so it is not a supported, public interface. The 7u40 release notes describe a temporary mechanism to reenable the historical functionality of this method. Update code to function properly and this method will be removed without further warning in a subsequent 7 update release.
      	at sun.reflect.Reflection.getCallerClass(Reflection.java:71)
      	at ch.qos.logback.classic.spi.PackagingDataCalculator.<clinit>(PackagingDataCalculator.java:42)
      	at ch.qos.logback.classic.spi.ThrowableProxy.getPackagingDataCalculator(ThrowableProxy.java:135)
      	at ch.qos.logback.classic.spi.ThrowableProxy.calculatePackagingData(ThrowableProxy.java:144)
      	at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:127)
      	at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:447)
      	at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:403)
      	at ch.qos.logback.classic.Logger.debug(Logger.java:526)
      

      The exception occurs in the static initializer of PackagingDataCalculator when trying to determine whether the host JVM supports Reflection#getCallerClass(). Currently, the initializer prints uncaught exceptions (in this case, UnsupportedOperationException), but logback continues to function properly.

      See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014925 for more information about the removal of Reflection#getCallerClass() from Java.

      Attachments

        Activity

          People

            tony19 Tony Trinh
            cowwoc Gili
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: