Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Eclipse Layout Kernel » Attempt to use elk+graphviz fails(Is this a path to success with elk+graphviz?)
Attempt to use elk+graphviz fails [message #1850390] Tue, 01 March 2022 05:48 Go to next message
Michael Lynott is currently offline Michael LynottFriend
Messages: 11
Registered: September 2021
Junior Member
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 73 times)
  • Attachment: pom.xml
    (Size: 2.24KB, Downloaded 80 times)
  • Attachment: ErrorReport
    (Size: 2.31KB, Downloaded 86 times)
Re: Attempt to use elk+graphviz fails [message #1850392 is a reply to message #1850390] Tue, 01 March 2022 07:22 Go to previous messageGo to next message
Sören Domrös is currently offline Sören DomrösFriend
Messages: 14
Registered: June 2021
Junior Member
Well, the error occurred because it expects that the programmatic option CoreOptions.FONT_SIZE is set, which is apparently null. I would try to set it and look at the potential new error message.
Re: Attempt to use elk+graphviz fails (3-1 reply) [message #1850408 is a reply to message #1850392] Wed, 02 March 2022 01:52 Go to previous messageGo to next message
Michael Lynott is currently offline Michael LynottFriend
Messages: 11
Registered: September 2021
Junior Member
Soren, thank you for your guidance yesterday. I have made changes to the
program elkDemo5 so it no longer fails with the font size error.
There are now error conditions in revised elkDemo5.

Attached are two new files:
elkDemo5-run2
errorlog-run2
The POM.XML file has not changed. The execution environment has not changed.

The code fails in elkDemo5 when executing line 56:
"layoutEngine.layout(top, progressMonitor);"

1. In RecursiveGraphLayoutEngine there is a reflection warning.
Illegal reflective action at line 241
"AbstractLayoutProvider layoutProvider = algorithmData.getInstancePool().fetch();"
on entry into RecursiveGraphLayoutEngine.executeAlgorithm.
Is there some code change that can be made in elkDemo5
or an environment setting to prevent this failure?

2. Error in GraphvizLayouterPreferenceStore code when no
GraphvizLayouterPlugin instance can be found.

Continuing execution of line 56 of elkDemo5-run2
after the above warning.
In GraphvizLayoutProvider on line 139:
"boolean reuseProcess = GraphvizLayouterPreferenceStoreAccess.getUISaveBoolean(
PREF_GRAPHVIZ_REUSE_PROCESS, REUSE_PROCESS_DEFAULT);"

Following that call in GraphvizLayouterPreferenceStoreAccess.getUISaveBoolean

line 73:
"return GraphvizLayouterPreferenceStore.getInstance().getPreferenceStore()
.getBoolean(name);"
GraphvizLayouterPreferenceStore.getInstance returns a null,
so getPreferenceStore() tries to create a new preference store, which fails
on line 55 because the GraphvizLayouterPlugin is also null.

Again I'm confident the error will be found in elkDemo5.
Thank you for any guidance you can provide to revise elkDemo5 to complete
the goal of displaying this simple graph using elk and graphviz.
Thank you
Mike Lynott (BoiseStateCS410)








Re: Attempt to use elk+graphviz fails (3-1 reply) [message #1850412 is a reply to message #1850408] Wed, 02 March 2022 07:39 Go to previous message
Sören Domrös is currently offline Sören DomrösFriend
Messages: 14
Registered: June 2021
Junior Member
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.

Previous Topic:Guidance on Auto-Layout w/ Semantics
Next Topic:Layout Part of Diagram (NO_LAYOUT)
Goto Forum:
  


Current Time: Sat Jul 13 14:24:12 GMT 2024

Powered by FUDForum. Page generated in 0.03758 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top