commit | 62e29cc5abe1cd5b668160ae0b3287a927fc429b | [log] [tgz] |
---|---|---|
author | brentwritescode <brentwritescode@gmail.com> | Sun Jan 24 18:17:12 2021 +0000 |
committer | Damien Diederen <ddiederen@apache.org> | Sun Jan 24 18:17:12 2021 +0000 |
tree | da50c5c9d7789368a3cd504a33b36fe6afcc1c78 | |
parent | e7d67da8d49ab0bb19ff1c2a5e5ce02f23596402 [diff] |
ZOOKEEPER-3943: Zookeeper Inspector throwing NullPointerExceptions and not displaying properly ISSUE --- See https://issues.apache.org/jira/browse/ZOOKEEPER-3943 for details on the issue. There are two main things being addressed in this PR: 1. The Maven build for ZooInspector seems to generate an invalid JAR file that is missing graphical resources that cause the application to be non-functional (UI does not render properly, NullPointerExceptions occur constantly, etc.). 2. The current Maven build instructions and run scripts for ZooInspector involve building, moving JAR files around, using relative entries on the CLASSPATH and running the scripts from the correct directory in order to use the `zooInspector.sh`/`zooInspector.cmd` launch scripts. FIXES --- For number 1, the fix is to add the `src/main/resources/*` directories to the JAR artifact built by Maven. For number 2, I've proposed changing the Maven build to use the [Maven Assembly Plugin](http://maven.apache.org/plugins/maven-assembly-plugin/) to build a single "fat jar" for ZooInspector that contains all of its dependencies. The result is that building and running the tool is easier and more straightforward (in my opinion): ``` git clone https://github.com/apache/zookeeper.git cd zookeeper mvn install -DskipTests cd zookeeper-contrib/zookeeper-contrib-zooinspector mvn install ./zooInspector.sh ``` And based on the "fat jar" style of build and updates to the run scripts, the `zooInspector.sh` and `zooInspector.cmd` commands now successfully execute from any directory (once the project is built) as opposed to requiring you to be in the same directory as the scripts. My hope is that these changes allow people like myself who are mainly interested in using ZooInspector to easily clone the repository, build and run the tool without any issues. I spent a chunk of time getting this all working for myself and I hope I can save others some trouble. TESTING --- I've tested cloning, building and running ZooInspector on Windows 10, Mac OS X Mojave (10.14.6) and Ubuntu Linux 18.04 using the steps above (on Java 8). I ran `mvn verify spotbugs:check checkstyle:check -Pfull-build -Dsurefire-forkcount=4` in the root directory (per https://cwiki.apache.org/confluence/display/ZOOKEEPER/HowToContribute#HowToContribute-FinalChecksonPullRequest) and got these results: ``` [INFO] [ERROR] Tests run: 2881, Failures: 4, Errors: 4, Skipped: 4 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for Apache ZooKeeper 3.7.0-SNAPSHOT: [INFO] [INFO] Apache ZooKeeper ................................... SUCCESS [ 7.731 s] [INFO] Apache ZooKeeper - Documentation ................... SUCCESS [ 3.223 s] [INFO] Apache ZooKeeper - Jute ............................ SUCCESS [ 32.705 s] [INFO] Apache ZooKeeper - Server .......................... FAILURE [30:28 min] [INFO] Apache ZooKeeper - Metrics Providers ............... SKIPPED [INFO] Apache ZooKeeper - Prometheus.io Metrics Provider .. SKIPPED [INFO] Apache ZooKeeper - Client .......................... SKIPPED [INFO] Apache ZooKeeper - Client - C ...................... SKIPPED [INFO] Apache ZooKeeper - Recipes ......................... SKIPPED [INFO] Apache ZooKeeper - Recipes - Election .............. SKIPPED [INFO] Apache ZooKeeper - Recipes - Lock .................. SKIPPED [INFO] Apache ZooKeeper - Recipes - Queue ................. SKIPPED [INFO] Apache ZooKeeper - Assembly ........................ SKIPPED [INFO] Apache ZooKeeper - Compatibility Tests ............. SKIPPED [INFO] Apache ZooKeeper - Compatibility Tests - Curator ... SKIPPED [INFO] Apache ZooKeeper - Tests ........................... SKIPPED [INFO] Apache ZooKeeper - Contrib ......................... SKIPPED [INFO] Apache ZooKeeper - Contrib - Fatjar ................ SKIPPED [INFO] Apache ZooKeeper - Contrib - Loggraph .............. SKIPPED [INFO] Apache ZooKeeper - Contrib - Rest .................. SKIPPED [INFO] Apache ZooKeeper - Contrib - ZooInspector .......... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 31:12 min [INFO] Finished at: 2020-12-05T01:08:27Z [INFO] ------------------------------------------------------------------------ ``` Since all of my proposed changes are in the `zookeeper-contrib` subtree, I'm assuming this doesn't have anything to do with my changes. Running the same command in the `zookeeper-contrib` directory seems to pass for those tests: ``` [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for Apache ZooKeeper - Contrib 3.7.0-SNAPSHOT: [INFO] [INFO] Apache ZooKeeper - Contrib ......................... SUCCESS [ 8.590 s] [INFO] Apache ZooKeeper - Contrib - Fatjar ................ SUCCESS [ 13.636 s] [INFO] Apache ZooKeeper - Contrib - Loggraph .............. SUCCESS [ 20.515 s] [INFO] Apache ZooKeeper - Contrib - Rest .................. SUCCESS [ 13.394 s] [INFO] Apache ZooKeeper - Contrib - ZooInspector .......... SUCCESS [ 17.056 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:14 min [INFO] Finished at: 2020-12-05T01:13:22Z [INFO] ------------------------------------------------------------------------ ``` Author: brentwritescode <brentwritescode@gmail.com> Reviewers: Enrico Olivelli <eolivelli@apache.org>, Damien Diederen <ddiederen@apache.org> Closes #1551 from brentwritescode/master
For the latest information about Apache ZooKeeper, please visit our website at:
and our wiki, at:
https://cwiki.apache.org/confluence/display/ZOOKEEPER
Either downloaded from https://zookeeper.apache.org/releases.html or found in zookeeper-assembly/target directory after building the project with maven.
apache-zookeeper-[version].tar.gz Contains all the source files which can be built by running: mvn clean install To generate an aggregated apidocs for zookeeper-server and zookeeper-jute: mvn javadoc:aggregate (generated files will be at target/site/apidocs) apache-zookeeper-[version]-bin.tar.gz Contains all the jar files required to run ZooKeeper Full documentation can also be found in the docs folder
As of version 3.5.5, the parent, zookeeper and zookeeper-jute artifacts are deployed to the central repository after the release is voted on and approved by the Apache ZooKeeper PMC:
https://repo1.maven.org/maven2/org/apache/zookeeper/zookeeper
If you are going to compile with Java 1.8, you should use a recent release at u211 or above.
We always welcome new contributors to the project! See How to Contribute for details on how to submit patch through pull request and our contribution workflow.