JOGL does not work on versions higher than eclipse 2021-03

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

JOGL does not work on versions higher than eclipse 2021-03

RoiArthurB
Hello,

I'm working on the GAMA Platform software ( https://github.com/gama-platform/gama ) which aims to make models and simulate them using java2D displays or OpenGL with JOGL.

On the process of release a new version of GAMA, we tried to upgrade every part of it and discovered an incompatibility of JOGL on Linux with SWT 2021-06 and above, but not below this version.

The error seems to come from the Canvas refresh. Here's the debug logs :

```
!SESSION 2021-10-01 11:06:01.916 -----------------------------------------------
eclipse.buildId=unknown
java.version=15.0.2
java.vendor=AdoptOpenJDK
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product msi.gama.application.product --launcher.defaultAction openFile --launcher.GTK_version 3
Command-line arguments:  -product msi.gama.application.product -data /home/roiarthurb/eclipse-workspace/../runtime-gama.product -dev file:/home/roiarthurb/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/gama.product/dev.properties -os linux -ws gtk -arch x86_64 -consoleLog -data @noDefault --launcher.defaultAction openFile --launcher.GTK_version 3

!ENTRY org.eclipse.e4.ui.workbench.swt 4 2 2021-10-01 11:06:38.181
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.e4.ui.workbench.swt".
!STACK 0
java.lang.ExceptionInInitializerError
        at com.jogamp.opengl.swt.GLCanvas.<init>(GLCanvas.java:348)
        at ummisco.gama.opengl.view.SWTOpenGLDisplaySurface.createCanvas(SWTOpenGLDisplaySurface.java:189)
        at ummisco.gama.opengl.view.SWTOpenGLDisplaySurface.createAnimator(SWTOpenGLDisplaySurface.java:169)
        at ummisco.gama.opengl.view.SWTOpenGLDisplaySurface.<init>(SWTOpenGLDisplaySurface.java:148)
        at gaml.additions.opengl.GamlAdditions.lambda$9(GamlAdditions.java:73)
        at msi.gama.common.interfaces.IDisplayCreator$DisplayDescription.create(IDisplayCreator.java:37)
        at msi.gama.common.interfaces.IDisplayCreator$DisplayDescription.create(IDisplayCreator.java:47)
        at ummisco.gama.ui.utils.SwtGui.createDisplaySurfaceFor(SwtGui.java:279)
        at ummisco.gama.opengl.view.OpenGLDisplayView.createSurfaceComposite(OpenGLDisplayView.java:47)
        at ummisco.gama.ui.views.displays.LayeredDisplayView.ownCreatePartControl(LayeredDisplayView.java:189)
        at ummisco.gama.ui.views.GamaViewPart.createPartControl(GamaViewPart.java:245)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:158)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityView.createPartControl(CompatibilityView.java:155)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:365)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
        at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:995)
        at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:960)
        at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:140)
        at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:403)
        at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:330)
        at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:202)
        at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:91)
        at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60)
        at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42)
        at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:994)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$1.run(PartRenderingEngine.java:543)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:527)
        at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:73)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:994)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
        at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1209)
        at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:116)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:676)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
        at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71)
        at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.subscribeTopicToBeRendered(PartRenderingEngine.java:161)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
        at org.eclipse.e4.core.di.internal.extensions.EventObjectSupplier$DIEventHandler.handleEvent(EventObjectSupplier.java:92)
        at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:205)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:203)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:228)
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
        at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:133)
        at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:75)
        at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
        at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
        at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:63)
        at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
        at org.eclipse.e4.ui.model.application.ui.impl.UIElementImpl.setToBeRendered(UIElementImpl.java:314)
        at org.eclipse.e4.ui.workbench.addons.cleanupaddon.CleanupAddon.subscribeRenderingChanged(CleanupAddon.java:334)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
        at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:236)
        at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:133)
        at org.eclipse.swt.widgets.Display.syncExec(Display.java:6001)
        at org.eclipse.e4.ui.workbench.swt.DisplayUISynchronize.syncExec(DisplayUISynchronize.java:34)
        at org.eclipse.e4.ui.internal.di.UIEventObjectSupplier$UIEventHandler.handleEvent(UIEventObjectSupplier.java:64)
        at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:205)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:203)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:228)
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
        at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:133)
        at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:75)
        at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
        at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
        at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:63)
        at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
        at org.eclipse.e4.ui.model.application.ui.impl.UIElementImpl.setToBeRendered(UIElementImpl.java:314)
        at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:655)
        at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:662)
        at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:624)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:786)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:757)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:679)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:674)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1251)
        at org.eclipse.ui.internal.WorkbenchPage.showPart(WorkbenchPage.java:1252)
        at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1240)
        at org.eclipse.ui.internal.WorkbenchPage.lambda$11(WorkbenchPage.java:4249)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:74)
        at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:4247)
        at ummisco.gama.ui.utils.SwtGui.lambda$0(SwtGui.java:209)
        at ummisco.gama.ui.utils.WorkbenchHelper.run(WorkbenchHelper.java:150)
        at ummisco.gama.ui.utils.SwtGui.internalShowView(SwtGui.java:200)
        at ummisco.gama.ui.utils.SwtGui.showView(SwtGui.java:239)
        at msi.gama.outputs.AbstractDisplayOutput.lambda$0(AbstractDisplayOutput.java:40)
        at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
        at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:5101)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4579)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
        at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
        at msi.gama.application.Application.start(Application.java:158)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1440)
Caused by: com.jogamp.nativewindow.NativeWindowException: java.lang.NoSuchMethodException: org.eclipse.swt.internal.gtk.GTK.gtk_widget_get_window(long)
        at com.jogamp.nativewindow.swt.SWTAccessor.<clinit>(SWTAccessor.java:285)
        ... 140 more
Caused by: java.lang.NoSuchMethodException: org.eclipse.swt.internal.gtk.GTK.gtk_widget_get_window(long)
        at java.base/java.lang.Class.getDeclaredMethod(Class.java:2633)
        at com.jogamp.nativewindow.swt.SWTAccessor.<clinit>(SWTAccessor.java:264)
        ... 140 more

!ENTRY org.eclipse.equinox.event 4 0 2021-10-01 11:06:38.183
!MESSAGE Exception while dispatching event org.osgi.service.event.Event [topic=org/eclipse/e4/ui/model/ui/UIElement/toBeRendered/SET] {ChangedElement=org.eclipse.e4.ui.model.application.ui.basic.impl.PartSashContainerImpl@3f937c0e (elementId: null, tags: [], contributorURI: null) (widget: Rectangle {0, 0, 0, 0}, renderer: org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer@3c6b300a, toBeRendered: true, onTop: false, visible: true, containerData: 7000, accessibilityPhrase: null) (horizontal: true), org.eclipse.e4.data={ChangedElement=org.eclipse.e4.ui.model.application.ui.basic.impl.PartSashContainerImpl@3f937c0e (elementId: null, tags: [], contributorURI: null) (widget: Rectangle {0, 0, 0, 0}, renderer: org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer@3c6b300a, toBeRendered: true, onTop: false, visible: true, containerData: 7000, accessibilityPhrase: null) (horizontal: true), AttName=toBeRendered, EventType=SET, OldValue=false, Widget=null, NewValue=true}, AttName=toBeRendered, EventType=SET, OldValue=false, Widget=null, NewValue=true} to handler org.eclipse.e4.core.di.internal.extensions.EventObjectSupplier$DIEventHandler@43bb76d0
!STACK 0
java.lang.ExceptionInInitializerError
        at com.jogamp.opengl.swt.GLCanvas.<init>(GLCanvas.java:348)
        at ummisco.gama.opengl.view.SWTOpenGLDisplaySurface.createCanvas(SWTOpenGLDisplaySurface.java:189)
        at ummisco.gama.opengl.view.SWTOpenGLDisplaySurface.createAnimator(SWTOpenGLDisplaySurface.java:169)
        at ummisco.gama.opengl.view.SWTOpenGLDisplaySurface.<init>(SWTOpenGLDisplaySurface.java:148)
        at gaml.additions.opengl.GamlAdditions.lambda$9(GamlAdditions.java:73)
        at msi.gama.common.interfaces.IDisplayCreator$DisplayDescription.create(IDisplayCreator.java:37)
        at msi.gama.common.interfaces.IDisplayCreator$DisplayDescription.create(IDisplayCreator.java:47)
        at ummisco.gama.ui.utils.SwtGui.createDisplaySurfaceFor(SwtGui.java:279)
        at ummisco.gama.opengl.view.OpenGLDisplayView.createSurfaceComposite(OpenGLDisplayView.java:47)
        at ummisco.gama.ui.views.displays.LayeredDisplayView.ownCreatePartControl(LayeredDisplayView.java:189)
        at ummisco.gama.ui.views.GamaViewPart.createPartControl(GamaViewPart.java:245)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:158)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityView.createPartControl(CompatibilityView.java:155)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:365)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
        at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:995)
        at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:960)
        at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:140)
        at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:403)
        at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:330)
        at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:202)
        at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:91)
        at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60)
        at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42)
        at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:994)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$1.run(PartRenderingEngine.java:543)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:527)
        at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:73)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:994)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
        at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1209)
        at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:116)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:676)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
        at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71)
        at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.subscribeTopicToBeRendered(PartRenderingEngine.java:161)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
        at org.eclipse.e4.core.di.internal.extensions.EventObjectSupplier$DIEventHandler.handleEvent(EventObjectSupplier.java:92)
        at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:205)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:203)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:228)
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
        at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:133)
        at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:75)
        at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
        at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
        at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:63)
        at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
        at org.eclipse.e4.ui.model.application.ui.impl.UIElementImpl.setToBeRendered(UIElementImpl.java:314)
        at org.eclipse.e4.ui.workbench.addons.cleanupaddon.CleanupAddon.subscribeRenderingChanged(CleanupAddon.java:334)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
        at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:236)
        at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:133)
        at org.eclipse.swt.widgets.Display.syncExec(Display.java:6001)
        at org.eclipse.e4.ui.workbench.swt.DisplayUISynchronize.syncExec(DisplayUISynchronize.java:34)
        at org.eclipse.e4.ui.internal.di.UIEventObjectSupplier$UIEventHandler.handleEvent(UIEventObjectSupplier.java:64)
        at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:205)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:203)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:228)
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
        at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:133)
        at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:75)
        at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
        at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
        at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:63)
        at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
        at org.eclipse.e4.ui.model.application.ui.impl.UIElementImpl.setToBeRendered(UIElementImpl.java:314)
        at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:655)
        at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:662)
        at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:624)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:786)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:757)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:679)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:674)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1251)
        at org.eclipse.ui.internal.WorkbenchPage.showPart(WorkbenchPage.java:1252)
        at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1240)
        at org.eclipse.ui.internal.WorkbenchPage.lambda$11(WorkbenchPage.java:4249)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:74)
        at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:4247)
        at ummisco.gama.ui.utils.SwtGui.lambda$0(SwtGui.java:209)
        at ummisco.gama.ui.utils.WorkbenchHelper.run(WorkbenchHelper.java:150)
        at ummisco.gama.ui.utils.SwtGui.internalShowView(SwtGui.java:200)
        at ummisco.gama.ui.utils.SwtGui.showView(SwtGui.java:239)
        at msi.gama.outputs.AbstractDisplayOutput.lambda$0(AbstractDisplayOutput.java:40)
        at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
        at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:5101)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4579)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
        at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
        at msi.gama.application.Application.start(Application.java:158)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1440)
Caused by: com.jogamp.nativewindow.NativeWindowException: java.lang.NoSuchMethodException: org.eclipse.swt.internal.gtk.GTK.gtk_widget_get_window(long)
        at com.jogamp.nativewindow.swt.SWTAccessor.<clinit>(SWTAccessor.java:285)
        ... 140 more
Caused by: java.lang.NoSuchMethodException: org.eclipse.swt.internal.gtk.GTK.gtk_widget_get_window(long)
        at java.base/java.lang.Class.getDeclaredMethod(Class.java:2633)
        at com.jogamp.nativewindow.swt.SWTAccessor.<clinit>(SWTAccessor.java:264)
        ... 140 more
```

I search before opening this issue and found very similar bugs from [JOGL and GTK in 2015](https://jogamp.org/bugzilla/show_bug.cgi?id=1170) and another one [on this forum in 2019](https://forum.jogamp.org/NewtCanvasSWT-Linux-Exception-with-GTK-VERSION-td4039442.html).

Since the problem seems to be a bad variable call on GTK versions, I checked if SWT detect properly my version, and yes it does as well on Eclipse as on GAMA :

```
$ gtk-launch --version
3.24.30

$ SWT_LIB_VERSIONS=1 ./eclipse                              
WARNING: Using incubator modules: jdk.incubator.jpackage, jdk.incubator.foreign
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized.  Will retry after the state location is initialized.
SWT_LIB_Gtk:3.24.30 (Dynamic gdbus)
SWT_LIB GDbus firing up. Implementation v1.5
[...]

$ SWT_LIB_VERSIONS=1 ./Linux-jdk15-OpenJ9-SWT_2021-09/Gama
SWT_LIB_Gtk:3.24.30 (Dynamic gdbus)
SWT_LIB GDbus firing up. Implementation v1.5
> GAMA: version 1.8.2                         loading on____ linux 5.14.7-2-MANJARO, x86_64, JDK 15.0.2
[...]
```

Finally, I'm afraid eclipse may have updated its own GTK API and JOGL needs to be updated to be compatible with future Eclipse's version... :/
Reply | Threaded
Open this post in threaded view
|

Re: JOGL does not work on versions higher than eclipse 2021-03

Martin
Hi,

Is this happening with JOGL 2.3.2? Have you tried JOGL 2.4 RC?

Julien is currently testing the latest RC.

I created a non official maven release because I could not wait the official one.

https://github.com/jzy3d/jogl-maven-deployer
Reply | Threaded
Open this post in threaded view
|

Re: JOGL does not work on versions higher than eclipse 2021-03

Alexis Drogoul
Hi Martin,

Thanks for your message. Yes, it is happening with 2.4RC. With the version of SWT used in Eclipse 2021-03, everything was running well, but 2021-06 broke this by making JOGL display this error and 2021-09 has not changed this behaviour. It seems that the SWT team has once again changed the method used to create a new GTK Window... Have you yourself succeeded in using 2.4RC with the latest SWT lib ?

Regards
Alexis

Reply | Threaded
Open this post in threaded view
|

Re: JOGL does not work on versions higher than eclipse 2021-03

Marcel
Hello Alexis,

in my RCP application Bio7 I use NewtCanvasSWT to integrate a self written OpenGL 3D simulation interface and a WorldWind integration for simulation purposes.

Sven generously fixed several SWT related bugs for the 2.4 release.

Before I used the SWT_AWT bridge. However NewtCanvasSWT is very performant and works well (with some customizations) in an RCP environment.

Have you tested this possibility, too?

Reply | Threaded
Open this post in threaded view
|

Re: JOGL does not work on versions higher than eclipse 2021-03

Alexis Drogoul
Hi Marcel,

We absolutely havent tested this possibility ! Based on your experience, would it require a lot of work to move from the SWT GLCanvas provided by JOGL to a NewtCanvasSWT ? Do you benefit from the same services, like the Animator, etc. ? Possibility to open several views with different GL contexts ?

Thanks for any tips in that direction, which sounds promising if you are able to run it w/o problems on the last SWT versions !

Alexis

Reply | Threaded
Open this post in threaded view
|

Re: JOGL does not work on versions higher than eclipse 2021-03

Marcel
Hello Alexis,

I use it succesfully in different perpsectives. However, I haven't tested it with the latest SWT release on Eclipse 4.21.
The transition isn't very hard. Yes, I benefit from the same services and it will definitely display OpenGL faster using a high performance display. I also added some workarounds for fullscreen and reparenting of detached views (on MacOSX).
I can open WorldWind and my 3D canvas side by side.

Here is an easy extracted snippet:
........
GLProfile glprofile = GLProfile.getDefault();

GLWindow glWindow = GLWindow.create(new GLCapabilities(glprofile));
               
NewtCanvasSWT canvas = new NewtCanvasSWT(composite SWT.NO_BACKGROUND, glWindow);

canvas.setSize(canvasWidth, canvasHeight);
glWindow.addGLEventListener(renderer);
canvas.setFocus();
glWindow.addKeyListener(this);
glWindow.addMouseListener(this);
.........

See:

https://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/newt/swt/NewtCanvasSWT.html#%3Cinit%3E(org.eclipse.swt.widgets.Composite,int,com.jogamp.newt.Window)
Reply | Threaded
Open this post in threaded view
|

Re: JOGL does not work on versions higher than eclipse 2021-03

Martin
Hi,

You may also wish to look at this integration of NewtCanvasSwt in Jzy3D (already available with 2.3.2).

The jogl-2.4 branch of Jzy3D use a (bit crappy) integration of JOGL 2.4 with maven that can let you try it. I haven't deployed this version of Jzy3D on my public maven repo so you would have to get the whole project and build it before running but it is easy and documented.

You can run this example that use the NewtCanvasSwt. You can also compare with a demo using the SWT_AWT bridge mentioned by Marcel.

I did not fully mastered how to cleanly handle SWT dependencies so I often comment here the SWT Jars that are not for my OS (linux and windows to run on my mac os) otherwise SWT complains about classpath.

Reply | Threaded
Open this post in threaded view
|

Re: JOGL does not work on versions higher than eclipse 2021-03

Alexis Drogoul
Hi Martin, hi Marcel,

Really appreciated your pointers. Seems like it's not going to be too complex, judging by the pieces of code you shared. I will try it and report successes or issues here !

Thanks,
Alexis

Reply | Threaded
Open this post in threaded view
|

Re: JOGL does not work on versions higher than eclipse 2021-03

gouessej
Administrator
Let us know whether you find unfixed problems in the SWT part of JOGL. I admit that I personally use it very rarely.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: JOGL does not work on versions higher than eclipse 2021-03

Alexis Drogoul
Hi,

First report on the use of the NEWTCanvasSWT for replacing the GLCanvas provided by JOGL in the GAMA platform. It is a mixed bag, probably mostly because I did not yet completely grasp the logic of NEWT surfaces and their interaction with SWT and also because I did it on my spare time this WE.

Pros:
1) With a minimal effort, I have obtained a working version that displays OpenGL contents in the same conditions as previously (no weird artefacts, no distorsion, ..). Nothing seems to be requiring to be updated in the renderer and the various GL-related operations. A good point !
2) The opening of the views is way faster than with a GLCanvas. I havent measured it yet, but what used to take 4-5 seconds (for instance, opening 4 GL views side by side) now takes less than 1. Nothing scientific, but the feeling is great.
3) The stability of the couple SWT-JOGL has considerably improved (and it works well in an Eclipse 2021-09 environment). Idem for the stability w.r.t. JDK. Everything runs now smoothly under JDK 17, while GLCanvas would regularly break in at least 3 different places (vertical resizing of the window, mix of Java2D and OpenGL displays, refreshing of the display itself).

On the cons side, however, we have what appears (for the moment) blocking points for an immediate adoption:

1) When a KeyListener is attached to the Newt surface, it seems to grab all the keystrokes, even if the view doesn't have focus (or maybe it grabs the focus as well ?); the various key listeners installed in other SWT views do not receive anything more. Has anyone experienced it also?
2) Changing perspective does not hide the NEWT surfaces of the views present in the previous perspective. They still appear above the views of the new perspective (and actually prevent the perpective to correctly change). How do you deal with such behaviour? Anything special to do? How do you "hide" a NEWT view (and come back to it after) ?
3) Fullscreen is handled in GAMA as a Shell taking up the whole surface of the screen, on which the "zoomed" display is reparented. Reparenting a GLCanvas was easy, but reparenting the Composite that holds the NEWTCanvasSWT does not seem to work. Is is possible to do this? Setting the Window to fullscreen is not an option here because, in fullscreen operations, users can still benefit from the toolbar, an interactive console or different other SWT/JFace components in side views.

So, mixed feeling here. The transition has been incredibly smooth for the main part (GL display, etc.) but promises to be a bit rough now...

Any help or comment appreciated ! Thanks in advance :)

Best regards,
Alexis
Reply | Threaded
Open this post in threaded view
|

Re: JOGL does not work on versions higher than eclipse 2021-03

Martin
Hi Alexis,

I haven't experienced the NewtCanvasSWT in a complete Eclipse RCP application so I can't help unfortunately.

Just for info, I have added a CPU renderer for Jzy3D. It works well for small surfaces and scatters in AWT. Example here.

The SWT version is on its way there. It is not fully integrated in Jzy3D yet but the pure opengl part is working as demonstrated there.

Advantage : it always work.
Disadvantage : it is limited to OpenGL 1 and a bit of 2. It won't deal with large object. There is no VBO interface (despite it would not really make sense, it could bring a bit more performance instead of invoking thousands of polygons one after the other).

Looking at GAMMA with terrain vis, I am not sure it is for you, but it was worth sharing :)
Reply | Threaded
Open this post in threaded view
|

Re: JOGL does not work on versions higher than eclipse 2021-03

Alexis Drogoul
Thanks Martin, will give it a try when I will have a bit more free time

Just to mention that the problem with the KeyListener grabbing all the keystrokes has already been reported (7 years ago !) but never answered: Post on Key Listeners and SWT (with a small test). The question behind this is that, since NEWTCanvasSWT is an SWT Canvas, why is it impossible to attach key and mouse listeners to it ?
Reply | Threaded
Open this post in threaded view
|

Re: JOGL does not work on versions higher than eclipse 2021-03

Alexis Drogoul
And the problem with NEWT views remaining open when changing RCP perspectives is indicated as solved here: https://jogamp.org/bugzilla/show_bug.cgi?id=1378 , however it still manifests itself in our implementation.

Reply | Threaded
Open this post in threaded view
|

Re: JOGL does not work on versions higher than eclipse 2021-03

Martin
In reply to this post by Alexis Drogoul
Hi,

I just verified and the SurfaceDemoSWT in Jzy3D has the mouse & key listeners working properly. So maybe it is focus problem rather than a non working event listener.

I hope I properly understood the problem.

Reply | Threaded
Open this post in threaded view
|

Re: JOGL does not work on versions higher than eclipse 2021-03

Martin
I verified on JOGL 2.3.2 and not 2.4.0
Reply | Threaded
Open this post in threaded view
|

Re: JOGL does not work on versions higher than eclipse 2021-03

Marcel
In reply to this post by Alexis Drogoul
Hello Alexis,

regarding the cons:

1. No problems that I have recognized so far, because I have one view in which I also allow a split screen but painted in OpenGL.

2. This bug should be fixed. Which version are you using? See:

https://jogamp.org/bugzilla/show_bug.cgi?id=1378

However on Mac I created a workaround with an IPartListener2 to change the visibility if needed: canvas.getNEWTChild().setVisible(false);

3. You don't need a extra shell. Newt comes with a fullsceen feature. However I also created here a Windows workaround to make it work correctly:

glWindow.setFullscreen(monitorDevices);
Reply | Threaded
Open this post in threaded view
|

Re: JOGL does not work on versions higher than eclipse 2021-03

Alexis Drogoul
Hi Marcel,

Thanks a lot. I've begun transitioning to the NEWT canvases, but the road is still a bit bumpy !

The point 1. (key listeners grabbing the focus) is an issue in that it does not apply to all the keystrokes. Some "pass through" and reach SWT (and then the Workbench), some do not. For instance, CTRL+Q (or CMD+Q) is ok, probably because it is natively listened to. However, if I declare a filter for a given keystroke on the Display, supposed to bypass all listeners, nothing happens when the Canvas has the focus, as if it was absorbing non-native keystrokes.

For point 2., glad if it is fixed on Windows and Linux, but macOS is not, you're right. I had resorted to an IPerspectiveListener (but I might give IPartListener a try) since all my openGL should be hidden in a given perspective and visible in another.

For point 3. my concern is that "fullscreen" in GAMA actually allows the user to open some companion toolboxes and toolbars  alongside the "fullscreen" display. These companion toolboxes/toolbars are SWT controls, and, unless we can somehow have them "floating" above the fullscreen NEWT window (is it possible ?), we will lose this functionality.

I'll continue digging in the coming days and report on my progresses !

Cheers
Alexis