Attempt to use elk+graphviz fails [message #1850390] |
Tue, 01 March 2022 00:48  |
Eclipse User |
|
|
|
The attached file elkDemo5.java is an attempt to use elk+graphviz.
Also attached are the pom.xml for this java project, and the error report from running the code using maven goal "exec:java" on eclipse.
The code was written and executed using:
eclipse 4.22 (2021-12)
openjdk 14.0.2
windows 10 home build 19044.1526
elk v. 0.7.1
maven via the M2E version available on Eclipse Marketplace (11/2021)
Two major events occur in the elkDemo5 java code at line 50 :
"layoutEngine.layout(top,progressMonitor)"
1. at line 241 of RecursiveGraphLayoutEngine
" AbstractLayoutProvider layoutProvider = algorithmData.getInstancePool().fetch();"
an "illegal reflective access operation has occurred." which is treated as a warning in openjdk14.
2. at line 250 of RecursiveGraphLayoutEngine.executeAlgorithm:
" layoutProvider.layout(layoutNode, progressMonitor);" a fatal error occurs. As the in-line comment indicates: "The layout provider has failed -
destroy it slowly and painfully". The actual failure is in "graphviz.dot.transformlDotExporter.setEdgeLabels".
It is assumed that the elk code is executing correctly, and the fault is in the elkDemo5 code. It would be helpful if you would provide guidance to help correct any mistakes.
NOTE re pom.xml: An exclusion has been added to the org.eclipse.elk.core.service dependency. Without this exclusion, maven issues an error because it cannot match the version constraint specified for javax.annotation-api (1.35-2.0.0). When the dependency hierarchy is displayed, it is clear that the jakarta.annotation-api has been included.
Thanks,
Mike Lynott (BoiseStateCS410)
Attachment: elkDemo5.java
(Size: 1.93KB, Downloaded 103 times)
Attachment: pom.xml
(Size: 2.24KB, Downloaded 115 times)
Attachment: ErrorReport
(Size: 2.31KB, Downloaded 115 times)
|
|
|
|
|
Re: Attempt to use elk+graphviz fails (3-1 reply) [message #1850412 is a reply to message #1850408] |
Wed, 02 March 2022 02:39  |
Eclipse User |
|
|
|
The problem is that this was developed to run in an Eclipse application that starts this bundle, which is not happening. At some point it was migrated to run as an OSGi application but I guess it was not in use at this point.
The following exception happens because of this since the bundle context is not initialized.
java.lang.NullPointerException: Cannot invoke "org.eclipse.elk.alg.graphviz.layouter.GraphvizLayouterPlugin.getBundle()" because the return value of "org.eclipse.elk.alg.graphviz.layouter.GraphvizLayouterPlugin.getDefault()" is null
2. seems to also happen because of this. I guess you cannot really execute it without initializing the bundles.
I frankly don't know what the exact problem is. We get the same problem if I include it in our language server and try to call the dot algorithm.
I guess pull requests are welcome to fix this issue but I currently don't have time to look into this.
|
|
|
Powered by
FUDForum. Page generated in 0.03766 seconds