Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-3943

Zookeeper Inspector throwing NullPointerExceptions and not displaying properly

    XMLWordPrintableJSON

Details

    Description

      I tried a number of different ways to get Zookeeper Inspector running yesterday, but repeatedly ran into the same issue.  The Java Swing window will launch, but in an incomplete state (see attached images for broken and working views) and the corresponding console shows this stack trace repeatedly:

      Exception in thread "AWT-EventQueue-0" java.lang.NullPointerExceptionException in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.GrayFilter.createDisabledImage(GrayFilter.java:49) at javax.swing.LookAndFeel.getDisabledIcon(LookAndFeel.java:557) at javax.swing.AbstractButton.getDisabledIcon(AbstractButton.java:653) at com.apple.laf.AquaButtonUI.paintIcon(AquaButtonUI.java:363) at com.apple.laf.AquaButtonUI.paint(AquaButtonUI.java:304) at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161) at javax.swing.JComponent.paintComponent(JComponent.java:780) at javax.swing.JComponent.paint(JComponent.java:1056) at javax.swing.JComponent.paintChildren(JComponent.java:889) at javax.swing.JComponent.paint(JComponent.java:1065) at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210) at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579) at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502) at javax.swing.RepaintManager.paint(RepaintManager.java:1272) at javax.swing.JComponent._paintImmediately(JComponent.java:5158) at javax.swing.JComponent.paintImmediately(JComponent.java:4969) at javax.swing.RepaintManager$4.run(RepaintManager.java:831) at javax.swing.RepaintManager$4.run(RepaintManager.java:814) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789) at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738) at javax.swing.RepaintManager.access$1200(RepaintManager.java:64) at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

      I was able to narrow this down to the icons in the zookeeper/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/resources/icons folder not making it into the built JAR for the subproject and being unable to be found dynamically in most scenarios.  I tried running from a number of different directories and messing with my classpath, but it didn't seem consistent and the zooInspector.sh script would not work either.

      I found that if I added this to zookeeper/zookeeper-contrib/zookeeper-contrib-zooinspector/pom.xml, the tool will display and run correctly (this forces the resources folder to get packed into the built JAR): {{}}

      <build>
          <resources>
              <resource>
                  <directory>src/main/resources</directory>
                  <includes>
                      <include>**/*</include>
                  </includes>
              </resource>
          </resources>
      </build>

      As far as I can tell, this issue still exists on the master branch and in release 3.6.2.

      Is this something that I could help by contributing a PR for?

      I might also suggest leveraging maven-assembly-plugin for this particular project to build one single "fat jar" that includes all the required dependencies so there's only a single jar necessary to make Zookeeper Inspector run if no one has a major issue with that.

      Either way, happy to help, just let me know.

      Attachments

        1. zoo-inspector-working.png
          125 kB
          Brent
        2. zoo-inspector-broken.png
          104 kB
          Brent

        Issue Links

          Activity

            People

              Unassigned Unassigned
              brentwritescode Brent
              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 - 3h 40m
                  3h 40m