Previous Next        Current Page: NeXtMidas User's Guide / WebSwing to deploy NeXtMidas as a Web App
back
FAQs   
Release Information   
Getting Help   
Basic Concepts   
Result Parameters   
XML Support   
Files   
System Operation   
Macros   
Java WebStart   
Graphics   
X-Midas Interoperability   
Third-Party Compatibility   
Installation and Customization   
Running NeXtMidas Independently   
Timelines - Keywords, Updating, Known Issues   
WebSwing to deploy NeXtMidas as a Web App   
Glossary   
Installing and Using Docker   


Deploying NeXtMidas as a Web Application using WebSwing

WebSwing is an Open Source application that allows Java Swing applications to run a Web App.

We, as well as a number of users, are looking into WebSwing being at least a partial solution for Java removing WebStart from JDK 11+ and having deprecated Applets (most browsers no longer support these anyhow).

Though this is in the EXPERIMENTAL phase, we are providing some quick start instructions. We encourage users to see if WebSwing might meet their needs, and wanted to get at least this level of information out to users in the NeXtMidas 3.9.2 release.

You are welcome to contact us with questions or for information on how to see a basic demo of NeXtMidas running as a web app via WebSwing.

For typing in a Shell GUI brought up via WebSwing to work properly, NextMidas 3.9.2+ is required.

Topics covered in this page

Basic steps to install WebSwing and run NextMidas (from jar files) as a Web App
Adjustments to bring up the Shell GUI from class files
Adjustments to run percent macros from class files, by specifying them as the args in the URL
Known Issues
Residual graphics on popups - solved with refresh
Sizing and resizing browser window issues
Early Firefox (pre 53.0) with certain configuration is stealing right-clicks


Basic steps to install WebSwing and run NextMidas (from jar files) as a Web App


  1. download WebSwing zip file
  2. copy and extract it where desired
  3. make sure JAVA_HOME is pointing to correct Java
  4. may need to run dos2unix on the on the webswing.sh file
    • may need to sudo yum install dos2unix if not on your box
  5. when not running from a Dockerfile (Dockerfile would generally install dependencies and run webswing.sh:
    • may need to install some dependencies
      • xorg-x11-server-Xvfb-1.20.4-7.el7.x86_64
      • libXi-1.7.9-1.el7.x86_64
      • libXtst-1.2.3-1.el7.x86_64
      • xorg-x11-server-Xorg
      • xorg-x11-xauth
      • xorg-x11-apps
      • which
    • cd into webswing folder
    • ./webswing.sh start
  6. on your browser got to localhost:8080
  7. enter the following:
    • for username: admin
    • for password: pwd
  8. click "manage"
  9. click "create new app"
  10. enter path for the url where you want your application to be hosted
  11. click "configure"
  12. in the Configuration Menu we set:
    • under Security
      • Security Module Name
        • INHERITED for user name and password
        • NONE for immediate access
    • under Application General
      • name: ... whatever you want .../li>
      • font
        • point to where your font is:
          • ex: /usr/share/fonts/dejavu/DejavuSansMono.tff
          • if need to yum install font for DejavuSansMono.tff: yum install dejavu-fonts-common
        • add name for the font
      • turn OFF DirectDraw Rendering
    • under Application Java
      • Working Directory
        • build your code first
          • (if using Docker, move code to Docker container)
        • enter the path to your Java project
      • Classpath: should point to folder containing your jars
        • ex: /jars/*
      • JVM Arguments
        • set as you need
        • ours were: -DNONATIVE=FALSE -DNMPID=1234 -DNMROOT="classpath"
    • under Launcher Configuration
      • Main class
        • put yours
        • we put: nxm.sys.lib.NeXtMidas
      • Main Arguments
        • put your path and command arguments - follow NXM docs
          • for demo we put:
              path="SYS,DSP,UCL,NET,AUDIO,DATABASE,HWC" -cmd="demo"
          • for the percent macro test_panel_menubar we put:
              path="SYS,DSP,UCL,NET,AUDIO,DATABASE,HWC" aux.homepath="/nxm/sys/test" -cmd="%test_panel_menubar"
          • to pass in the percent macro name in the url
            • URL could be: https://nextmidas.techma.com:8443/nxm-percent-macro/?args=test_plot_latloncontinuous
            • and just updated the -cmd to be: -cmd="%${customArgs}"
    • under Application - Session
      • Max Connections - set to what desired
      • Session Mode - 3 options are:
        • CONTINUE_FOR_BROWSER
        • CONTINUE_FOR_USER
        • ALWAYS_NEW_SESSION
    • otherwise we used the defaults
  13. when done, click "Apply"
  14. "Enable" this application if not already enabled
  15. go to the url and it will start the application

Adjustments to bring up the Shell GUI from class files:


  1. in the Configuration Menu we set:
    • under Application Java
      • Classpath: should point to nextmidas tools folder
        • ex: /tools
      • JVM Arguments
        • set as you need:
        • ours were: -DNONATIVE=FALSE -DNMPID=1234 -DNMROOT= -DHOME=
          • i.e. -DNONATIVE=FALSE -DNMPID=1234 -DNMROOT=${webswing.rootDir}/release/nextmidas/ -DHOME=${webswing.rootDir}/release/nextmidas/nxm/sys/test
    • under Launcher Configuration
      • Main class: NmClassLoader
      • Main Arguments: shell

Adjustments to run percent macros from class files, by specifying them as the args in the URL:


  1. in the Configuration Menu we set:
    • under Application Java
      • Classpath: should point to nextmidas tools folder
        • ex: /tools
      • JVM Arguments
        • set as you need:
        • ours were: -DNONATIVE=FALSE -DNMPID=1234 -DNMROOT=
    • under Launcher Configuration
      • Main class: NmClassLoader
      • Main Arguments: %${customArgs}

Known Issues:


  1. Residual graphics on popups - solved with refresh
  2. Sizing and resizing browser window issues
    • resizing the browser window can cause Midas panel based GUIs to allow panes to be dragged beyond panel bounds
    • Java Sing based GUIs may need preferred size adjustments
  3. Early Firefox (pre 53.0) with certain configuration is stealing right-clicks
    • Chrome, Firefox 53, and Edge have not seemd to ever have this issue
    • Firefox versions earlier then 53.0 have a known issue with stealing right clicks, but even then we have not been able to replicate this issue seen by users


back