Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-7923

Nar Auto-Loader cannot recover from Throwable/Error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.12.0
    • 1.13.0
    • Extensions
    • None

    Description

      When a nar is built against an up-level JVM, a java Error is thrown while loading the nar extension. The Throwable is not handled as the code only handles sub classes of Exception. As a result the thread dies, and when a corrected nar is later installed, the nar cannot be loaded. Restart of nifi causes the updated nar to be loaded.

      2020-10-14 13:31:55,340 INFO [NAR Auto-Loader] -> org.apache.nifi.nar.NarClassLoaders -> Loaded NAR file: /opt/nifi/./work/nar/extensions/nifi-hri-nar-1.0-SNAPSHOT.nar-unpacked as class loader org.apache.nifi.nar.NarClassLoader[./work/nar/extensions/nifi-hri-nar-1.0-SNAPSHOT.nar-unpacked]
      2020-10-14 13:31:55,342 INFO [NAR Auto-Loader] -> org.apache.nifi.nar.StandardNarLoader -> Successfully created class loaders for 1 NARs, 0 were skipped
      2020-10-14 13:31:55,395 ERROR [NAR Auto-Loader] -> org.apache.nifi.NiFi -> An Unknown Error Occurred in Thread Thread[NAR Auto-Loader,5,main]: java.lang.UnsupportedClassVersionError: com/ibm/watson/health/wffh/nifi/processors/hri/GetHriIngestRecords has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
      2020-10-14 13:31:55,396 ERROR [NAR Auto-Loader] -> org.apache.nifi.NiFi ->
      java.lang.UnsupportedClassVersionError: com/ibm/watson/health/wffh/nifi/processors/hri/GetHriIngestRecords has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:348)
      at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370)
      at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
      at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
      at org.apache.nifi.nar.StandardExtensionDiscoveringManager.loadExtensions(StandardExtensionDiscoveringManager.java:156)
      at org.apache.nifi.nar.StandardExtensionDiscoveringManager.discoverExtensions(StandardExtensionDiscoveringManager.java:131)
      at org.apache.nifi.nar.StandardNarLoader.load(StandardNarLoader.java:110)
      at org.apache.nifi.nar.NarAutoLoaderTask.run(NarAutoLoaderTask.java:128)
      at java.lang.Thread.run(Thread.java:748)

      I looked at the source enough to believe that the Error is not handled anywhere between StandardExtensionDiscovingManager.loadExtensions and NarAutoLoaderTask.run.

      I see no messages in the log that suggest that the updated nar is processed after it is placed in the extensions directory.

      Attachments

        Issue Links

          Activity

            People

              bbende Bryan Bende
              ntlawrence Nick Lawrence
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h