tordanik/OSM2World

ArrayIndexOutOfBoundsException in prebuilt distributable

Closed this issue · 3 comments

The latest release downloaded from http://osm2world.org/download/ doesn't run, resulting in an index out of bounds exception.

C:\Users\jacob>java --version openjdk 16.0.2 2021-07-20 OpenJDK Runtime Environment (build 16.0.2+7-67) OpenJDK 64-Bit Server VM (build 16.0.2+7-67, mixed mode, sharing)

`
F:\Program Files (x86)\OSM2World>osm2world-windows.bat

F:\Program Files (x86)\OSM2World>java -Xmx2G -jar OSM2World.jar
No parameters, running graphical interface.
If you want to use the command line, use the --help parameter for a list of available parameters.
No --config parameter, using default style (standard.properties).

FPSAnimator P1:Thread[main-FPSAWTAnimator-Timer0,5,main]: Task[thread Thread[main-FPSAWTAnimator-Timer0,5,main], stopped false, paused false shouldRun true, shouldStop false -- started true, animating true, paused false, drawable 1, drawablesEmpty false]
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 1
at jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(WindowsAWTWGLGraphicsConfigurationFactory.java:169)
at javax.media.nativewindow.GraphicsConfigurationFactory.chooseGraphicsConfiguration(GraphicsConfigurationFactory.java:420)
at javax.media.opengl.awt.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:1186)
at javax.media.opengl.awt.GLCanvas.addNotify(GLCanvas.java:572)
at java.desktop/java.awt.Container.addNotify(Container.java:2801)
at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4792)
at java.desktop/java.awt.Container.addNotify(Container.java:2801)
at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4792)
at java.desktop/java.awt.Container.addNotify(Container.java:2801)
at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4792)
at java.desktop/javax.swing.JRootPane.addNotify(JRootPane.java:729)
at java.desktop/java.awt.Container.addNotify(Container.java:2801)
at java.desktop/java.awt.Window.addNotify(Window.java:787)
at java.desktop/java.awt.Frame.addNotify(Frame.java:493)
at java.desktop/java.awt.Window.pack(Window.java:825)
at org.osm2world.viewer.view.ViewerFrame.(ViewerFrame.java:123)
at org.osm2world.console.OSM2World.executeArgumentsGroup(OSM2World.java:210)
at org.osm2world.console.OSM2World.main(OSM2World.java:144)
`

Any help is appreciated!

hzxie commented

The same with OpenJDK 16 and Prebuilt.

same for me with OpenJDK 18. There might be a fix, if someone would be able to update maven org.jogamp dependencies to 2.4.0. Otherwise you have to stick to JDK 8.
(see https://stackoverflow.com/questions/69829677/index-out-of-bound-exception-trying-to-create-a-window-with-swing-and-jogl)

As of fbe6b37, OSM2World is now using a JOGL 2.4.0 release candidate. This makes current builds compatible with modern JDK versions.