Jddd MIGRATION to Openjdk11+: BENEFITS and PITFALLS E
Total Page:16
File Type:pdf, Size:1020Kb
17th Int. Conf. on Acc. and Large Exp. Physics Control Systems ICALEPCS2019, New York, NY, USA JACoW Publishing ISBN: 978-3-95450-209-7 ISSN: 2226-0358 doi:10.18429/JACoW-ICALEPCS2019-WESH1003 jddd MIGRATION TO OpenJDK11+: BENEFITS AND PITFALLS E. Sombrowski, K. Rehlich, G. Schlesselmann, DESY, Hamburg, Germany Abstract (GPLv2+CPE): This release is free of charge, but does not offer long term support. The Java Doocs Data Display (jddd) is a Java-based tool As an alternative to Oracle a zoo of long term support for creating and running graphical user interfaces for ac- OpenJDK distributions from different communities and celerator control systems. It is the standard graphical user vendors is available, like AdoptOpenJDK, Corretto by Am- interface for operating the European XFEL accelerator. azon or Read Hat OpenJDK. Since Java 8 Oracle introduced a number of major changes Oracle has been and will stay the reference implementa- in the Java ecosystem's legal and technical contexts that tion for Java. We decided to use Oracle OpenJDK, because significantly impact Java developers and users. The most the license model fits our needs and environment best. impactful changes for our software were the removal of Java Web Start, Oracles new licensing model and shorter Dealing with Shorter Release Cycles release cycles. To keep jddd up to date, the source code had Some months ago Oracle introduced a new release cycle to be refactored and new distribution concepts for the dif- for Java. It changed from a feature-based to a time-based ferent operating systems had to be developed. In this paper release cycle. There are now two types of releases: the benefits and pitfalls of the jddd migration from Oracle • Java8 to OpenJDK11+ will be described. Major releases for Oracle JDK and OpenJDK every 6 months, which are only supported until the next re- INTRODUCTION lease. • Commercial Oracle JDK Long Term Support (LTS) jddd [1, 2] is a common tool for designing and running releases every 3 years: The most recent LTS release is control system windows (also called panels) at DESY Java 11, which came out in September 2018 and will Hamburg and DESY Zeuthen. It has a graphical editor with be supported until 2026. The next will be Java 17 in a rich set of ready-made widgets for control panel design. September 2021. Synoptical displays can easily be created without any pro- The advantage of short release cycles is that new Java gramming knowledge. So far, more than 15000 panels have features will be usable much faster. been designed in Hamburg and Zeuthen. It also makes migration easier. The changes are smaller At DESY Hamburg statistical data about the jddd usage and more incremental, so each upgrade is easier and less of are collected. The average and maximum number of panels change. started per day, users per day and sessions started per day We started jddd migration from Java 8 to OpenJDK11+ are displayed in Table 1. In recent years usage has been in September 2018 with OpenJDK 11, which turned out to 2019). Any distribution of this work must maintain attribution to the author(s), title of the work, publisher, and DOI. steadily increasing. be quite easy. No major code changes had to be done. Since © OpenJDK11 jddd application are always compiled with the Table 1: jddd Usage Statistics 2018 at DESY Hamburg latest OpenJDK release without any problems. #started #started #started Replacement of Java Web Start panels diff. panels jddd sessions per day per day per day During the past years Java Web Start and Java Network Launching Protocol (JNLP) were used for the internal dis- av 2982 558 169 tribution of jddd to the users. To access the application the max 7221 1089 434 users had to install a current Java that contained support for JNLP. To start jddd, they would click on a JNLP link and JAVA UPGRADE the Java Web Start program would download the JNLP file, Since Java 8 Oracle made significant modifications in interpret it, download the current version of the applica- the Java ecosystem [3]. To keep jddd up to date, new solu- tion, and run it in a security sandbox. tions had to be found for the following changes: Java Web Start provided an easy and uncomplicated way to distribute a completely configured application to every- Oracles New Licensing Model one’s desktop independent of the operating system. As Java Starting with Java 11 Oracle offers two distinct Java re- Web Start is no longer part of Java, a substitution for JNLP leases with different license models: had to be found. • Oracle JDK under commercial OTN License Agree- Java 8 is the last version providing a separate Java ment for Java SE [4]: This release offers a long term Runtime Environment (JRE). Since Java 9 there is only the support, but is only free of charge for development Java Development Kit (JDK) available, which is basically and tests. For commercial use high costs incur. the JRE plus a compiler, a debugger and several other tools. • Oracle OpenJDK under the open source GNU General Instead of a separate JRE Oracle introduced the module Public License v2 with Classpath Exception system Jigsaw. The idea of Jigsaw is to modularize the Java WESH1003 Content from this work may be used under the terms of the CC BY 3.0 licence ( User Interfaces, User Perspective, and User Experience(UX) 1501 17th Int. Conf. on Acc. and Large Exp. Physics Control Systems ICALEPCS2019, New York, NY, USA JACoW Publishing ISBN: 978-3-95450-209-7 ISSN: 2226-0358 doi:10.18429/JACoW-ICALEPCS2019-WESH1003 application and to use jlink for the generation of a custom failures/exceptions and sending panel update notifications JRE that contains only the platform modules required for a within running jddd applications at DESY. given application. With the Java upgrade we decided to switch the messag- Packaging the application with this reduced JRE would ing system from JMS to the more popular MQTT protocol. be the most lightweight and performant solution for appli- The Eclipse Paho Java Client library [6] provides an open- cation deployment. Unfortunately jddd depends on many source implementation of the MQTT messaging protocol. old non-modularised libraries, which makes it impossible It is well documented and fits our needs perfectly. to use jlink. As broker we decided to use the open-source message For this reason we decided to compile and bundle all broker Eclipse Mosquitto [7] because it is lightweight and jddd jars together with the complete OpenJDK. Always the available as Debian package. latest OpenJDK version is used to ensure the best possible safety. UPGRADE OF THE Four different packages are needed at DESY (see screen- jddd WEB INTERFACE shots in Fig. 1). One for each: • For remote monitoring and expert assistance an HTML5 The jddd editor version of jddd has been developed [8]. At server side jddd • XFEL MainTaskbar is started in a Tomcat application server. A buffered image • FLASH MainTaskbar of each panel is created with an update rate of 0.5 Hz. For • SINBAD MainTaskbar client/server communication the WebSocket protocol is On Windows these packages are available via a centrally used. Images are sent from the server to the client, mouse managed software repository. On Linux packages are pro- events are sent in the opposite direction. vided for Debian, CentOS and RedHat. On Mac the jddd The web interface has been successfully tested with packages are available as Mac applications. OpenJDK11+ and Tomcat 9. The upgrade is scheduled for the end of this year. STARTING OLD JAVA APPLICATIONS VIA A jddd BUTTON CONCLUSION Figure 1 shows the jddd based control windows for For the Java update of our jddd software, the following XFEL, FLASH and SINBAD (called MainTaskbar), which decisions were made: are used as entry point to start all needed graphical user • We use Oracle OpenJDK11+. interfaces (GUIs). These are mainly jddd panels, but can • We stick to Oracles short release cycles and compile also be Matlab, Python or other Java applications. and distribute jddd always with the current OpenJDK Because it would be much effort to upgrade all old Java version. applications, we found a simple solution to start these GUIs • We deploy jddd packages including all jars, the com- without any code and JNLP start script modification: We plete JDK and the jaws software for starting old Java 2019).added Any distribution of this work must maintain attribution to the author(s), titlejaws, of the work, publisher, and DOI. a Java Web Start replacement by Cosylab [5], applications via jddd. © to our jddd packages. The jddd application now internally The migration from Java 8 to OpenJDK11+ was success- replaces all javaws calls by jaws. Because the Java Virtual ful. No major problems were observed, no matter on which Machine is backward compatible and can run older operating system. Unfortunately it has not been possible to bytecode, most old Java applications (except JavaFX ap- switch completely to the new Java module system, due to plications) can be started with the current OpenJDK from many legacy libraries. The plan is to replace these libraries the jddd package. to be able to use jlink in future. Using jaws is a suitable intermediate solution until the The concept of jddd packages containing the current transition from Java 8 to OpenJDK11+ will be finished for JDK has proven itself. Even though the packaging and de- all applications. ployment procedure is more complicated now compared to Java Web Start before, the benefit is that jddd no longer UPGRADE OF THE MESSAGING depends on the appropriate preinstalled Java version. SYSTEM - FROM JMS TO MQTT The jddd software utilizes a messaging system for col- lecting runtime statistics (as shown in table 1), evaluating Content fromWESH1003 this work may be used under the terms of the CC BY 3.0 licence ( 1502 User Interfaces, User Perspective, and User Experience(UX) 17th Int.