ge-high-assurance / RITE

DARPA's Automated Rapid Certification of Software (ARCOS) project called RITE (RACK Integrated CerTification Environment)
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

DASC2023_Prototype RITE release freezes under Linux when "DO-178C Compliance Report" button is clicked. #213

Open hnine999 opened 3 months ago

hnine999 commented 3 months ago

This is due to an issue with JavaFX under Linux, and with Eclipse in particular.

In Linux (Ubuntu 22.04), the following modifications will get the "DO-178C Compliance Report" window to appear, though outside eclipse, and not fully functional:

  1. Clone the RITE repo, and checkout the dasc23 tag.

  2. Add the following to the <RITE-repo-root>/tools/rack/pom.xml

      <dependency>
        <groupId>org.apache.jena</groupId>
        <artifactId>jena-shaded-guava</artifactId>
        <version>4.7.0</version>
      </dependency>
  3. Add the following to <RITE-repo-root>/tools/rack/rack.plugin/pom.xml

    <dependency>
      <groupId>org.apache.jena</groupId>
      <artifactId>jena-shaded-guava</artifactId>
    </dependency>
    
  4. Add the following lines to the end of the JavaFXAppLaunchManager class:

    public static void main(String[] args) {
        new Thread(() -> Application.launch(ReportViewsManager.class)).start();
    }
  5. In the ReportViewsManager.java:

    1. Comment out these lines:
      //import org.eclipse.core.runtime.FileLocator;
      //import org.eclipse.core.runtime.Path;
      //import org.eclipse.core.runtime.Platform;
      //import org.osgi.framework.Bundle;
    2. Change the beginning of the setNewFxmlToStage method to this:

          // final Bundle bundle = Platform.getBundle("rack.plugin");
          // final URL fxmlUrl =
          //         FileLocator.toFileURL(FileLocator.find(bundle, new Path(fxmlFilePath),
          // null));
      
          final URL fxmlUrl = new URL(
                  "file://<absolute-path-of-RITE-repo-root>/tools/rack/rack.plugin/resources/fxml/report/ReportMainView_new.fxml"
          );
  6. Build the linux RITE zip file with:

    mvn clean install
  7. Unzip the <RITE-repo-root>/tools/rack/rack.product/target/products/RITE-linux.gtk.x86_64.zip in the directory of your choosing. Call it <RITE-app-dir>

  8. Change to the <RITE-app-dir> directory:

    cd <RITE-app-dir>
  9. Execute the following command to make a JavaFX directory in the parent directory:

    mkdir ../JavaFX
  10. Copy the JavaFX jar files into ../JavaFX:

    cp <RITE-repo-root>/tools/rack/rack.plugin/lib/*javafx*.jar ../JavaFX/
  11. Execute the following command:

    java -cp 'plugins/*:../JavaFX/*' com.ge.research.rack.JavaFXAppLaunchManager
  12. The DO-178C Compliance Report window should appear

hnine999 commented 3 months ago

The previous comment would indicate that the freezing problem is due to an interaction between Eclipse and JavaFX in Linux.

I've tried a few code modifications for the RITE executable, but none have worked.

However, there is a e(fx)clipse project that could be investigated.

baoluomeng commented 3 months ago

The main reason we didn’t integrate with E(fx)clipse is that Eclipse stopped supporting E(fx)clipse in 2018. See here. If anything arises with the integration, we may not be able to fix it.

Also, to be able to use e(fx)clipse, we would need to use Java8, which is really old. We are currently using Java 11 or 17 now. And new JavaFX features may not be available on e(fx)clipse.

Integrating Eclipse with JavaFX is a pain. See this issue #139.

hnine999 commented 3 months ago

Didn't realize E(fx)clipse was defunct :(

I made some different, though similar, mods, to spawn DO 127C window off as a separate process as opposed to a separate thread.

Attached. git_diff_spawn_new_process.diff.txt

hnine999 commented 3 months ago

Here's a page on the latest release of E(fx)clipse: https://projects.eclipse.org/projects/technology.efxclipse

Not sure about supported java versions at this point.

hnine999 commented 3 months ago

I just asked Chatgpt:

what versions of java are supported by e(fx)clipse?

ChatGPT

e(fx)clipse supports Java versions from Java 7 to the latest Long-Term Support (LTS) version, which is currently Java 17. However, support for Java versions can change with new releases, so it's best to refer to the official e(fx)clipse documentation or the project's GitHub repository for the most up-to-date information.