NASAWorldWind / WorldWindJava

The NASA WorldWind Java SDK (WWJ) is for building cross-platform 3D geospatial desktop applications in Java.
712 stars 324 forks source link

Caused by: com.jogamp.opengl.GLException: Unable to determine GraphicsConfiguration #249

Open MeachamusPrime opened 1 year ago

MeachamusPrime commented 1 year ago

Prerequisites

Description

Default Worldwind setup with Java 17 runtime crashes on run. Note: "Caused by: com.jogamp.opengl.GLException: Unable to determine GraphicsConfiguration"

Steps to Reproduce

  1. Run "run-demo.bat"

Expected behavior: Beautiful demo of Worldwind displays and I interact with it in geodetic bliss.

Actual behavior: .\run-demo.bat Running gov.nasa.worldwindx.examples.ApplicationTemplate java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) at gov.nasa.worldwindx.examples.ApplicationTemplate.start(Unknown Source) at gov.nasa.worldwindx.examples.ApplicationTemplate.main(Unknown Source) Caused by: com.jogamp.opengl.GLException: Unable to determine GraphicsConfiguration: WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[obj 0xbd45969]], idx 0], pfdID 10, ARB-Choosen true, requested GLCaps[rgba 8/8/8/8, opaque, accum-rgba 0/0/0/0, dp/st/ms 24/0/0, dbl, mono , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]], chosen GLCaps[wgl vid 10 arb: rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 24/0/0, dbl, mono , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]]] at jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(WindowsAWTWGLGraphicsConfigurationFactory.java:182) at com.jogamp.nativewindow.GraphicsConfigurationFactory.chooseGraphicsConfiguration(GraphicsConfigurationFactory.java:424) at com.jogamp.opengl.awt.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:1513) at com.jogamp.opengl.awt.GLCanvas.addNotify(GLCanvas.java:609) at java.desktop/java.awt.Container.addNotify(Container.java:2804) at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4839) at java.desktop/java.awt.Container.addNotify(Container.java:2804) at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4839) at java.desktop/java.awt.Container.addNotify(Container.java:2804) at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4839) at java.desktop/java.awt.Container.addNotify(Container.java:2804) at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4839) at java.desktop/javax.swing.JRootPane.addNotify(JRootPane.java:729) at java.desktop/java.awt.Container.addNotify(Container.java:2804) at java.desktop/java.awt.Window.addNotify(Window.java:791) at java.desktop/java.awt.Frame.addNotify(Frame.java:495) at java.desktop/java.awt.Window.pack(Window.java:829) at gov.nasa.worldwindx.examples.ApplicationTemplate$AppFrame.initialize(Unknown Source) at gov.nasa.worldwindx.examples.ApplicationTemplate$AppFrame.(Unknown Source) ... 7 more

Reproduces how often: 100% of the time, it fails every time.

Operating System and Version

Windows 11, Version 10.0.22000 Build 22000

Additional Information

None

MeachamusPrime commented 1 year ago

Further investigation showed that the problem did not occur in Java 15, so I expect Java 16 introduced the change that has caused it.

Jerhamre commented 1 year ago

Think its a known bug with JOGL https://github.com/jzy3d/jogl/issues/4

running the JVM with the following arguments should fix the problem

--add-exports java.base/java.lang=ALL-UNNAMED
--add-exports java.desktop/sun.awt=ALL-UNNAMED
--add-exports java.desktop/sun.java2d=ALL-UNNAMED
tobidelbruck commented 6 months ago

this fixed it for me with jogl 2.5.0 and java 17, thanks!