dgarijo / Widoco

Wizard for documenting ontologies. WIDOCO is a step by step generator of HTML templates with the documentation of your ontology. It uses the LODE environment to create part of the template.
Apache License 2.0
284 stars 88 forks source link

Command line error when GUI required #605

Closed stefanogermano closed 1 year ago

stefanogermano commented 1 year ago

Describe the bug

When you run WIDOCO through the command line, but an operation requires the GUI (and it cannot be executed), it throws an exception:

[main] ERROR widoco.gui.GuiController - Error while generating the documentation: 
No X11 DISPLAY variable was set,
but this program performed an operation which requires it.
java.awt.HeadlessException: 
No X11 DISPLAY variable was set,
but this program performed an operation which requires it.
        at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:166)
        at java.desktop/java.awt.Window.<init>(Window.java:553)
        at java.desktop/java.awt.Frame.<init>(Frame.java:428)
        at java.desktop/java.awt.Frame.<init>(Frame.java:393)
        at java.desktop/javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1919)
        at java.desktop/javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1995)
        at java.desktop/javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1695)
        at java.desktop/javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:874)
        at widoco.CreateResources.saveDocument(CreateResources.java:394)
        at widoco.CreateResources.createAbstractSection(CreateResources.java:228)
        at widoco.CreateResources.generateDocumentation(CreateResources.java:90)
        at widoco.gui.GuiController.<init>(GuiController.java:275)
        at widoco.gui.GuiController.main(GuiController.java:501)

To Reproduce

Steps to reproduce the behavior:

  1. Run WIDOCO through the command line on a machine where the GUI cannot be executed
  2. Use an behaviour that requires the GUI (for instance, running on a previously generated folder without the -rewriteAll option)
  3. See the error shown above

Expected behavior

I see two possibilities: