InaccessibleObjectException

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

InaccessibleObjectException

malcolmryan
I've just started using JOGL and I'm seeing some errors I don't understand.

Caught AppContextInfo(Bug 1004) InaccessibleObjectException: Unable to make public static sun.awt.AppContext sun.awt.AppContext.getAppContext() accessible: module java.desktop does not "exports sun.awt" to module jogl.all on thread main 

The program seems to run OK even with this error. Can I just ignore it?

Details:
* I'm running OS X 10.14.6
* Oracle JDK 13
* The latest autobuild of Gluegen (gluegen-2.4-b931-20200113-macosx-universal) and JOGL (jogl-2.4-b1502-20200116-macosx-universal)
* Eclipse 4.14.0
 
The code is very simple:

import javax.swing.JFrame;

import com.jogamp.opengl.GLAutoDrawable;
import com.jogamp.opengl.GLEventListener;
import com.jogamp.opengl.awt.GLCanvas;

public class Example1 extends JFrame implements GLEventListener {

        private GLCanvas myCanvas;
       
        public Example1() {
                super("Example 1");
               
                setSize(600,400);
                myCanvas = new GLCanvas();
                myCanvas.addGLEventListener(this);
               
                this.add(myCanvas);
                this.setVisible(true);
        }

        @Override
        public void init(GLAutoDrawable drawable) {
        }

        @Override
        public void dispose(GLAutoDrawable drawable) {
        }

        @Override
        public void display(GLAutoDrawable drawable) {
        }

        @Override
        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
        }

        public static void main(String[] args) {
                new Example1();
        }

}

Reply | Threaded
Open this post in threaded view
|

Re: InaccessibleObjectException

malcolmryan
Trying to run the same code on Windows 10, I get the error:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 1
        at jogl.all/jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(WindowsAWTWGLGraphicsConfigurationFactory.java:171)
        at jogl.all/com.jogamp.nativewindow.GraphicsConfigurationFactory.chooseGraphicsConfiguration(GraphicsConfigurationFactory.java:424)
        at jogl.all/com.jogamp.opengl.awt.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:1507)
        at jogl.all/com.jogamp.opengl.awt.GLCanvas.addNotify(GLCanvas.java:609)
        at java.desktop/java.awt.Container.addNotify(Container.java:2800)
        at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4783)
        at java.desktop/java.awt.Container.addNotify(Container.java:2800)
        at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4783)
        at java.desktop/java.awt.Container.addNotify(Container.java:2800)
        at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4783)
        at java.desktop/javax.swing.JRootPane.addNotify(JRootPane.java:733)
        at java.desktop/java.awt.Container.addNotify(Container.java:2800)
        at java.desktop/java.awt.Window.addNotify(Window.java:776)
        at java.desktop/java.awt.Frame.addNotify(Frame.java:490)
        at java.desktop/java.awt.Window.show(Window.java:1038)
        at java.desktop/java.awt.Component.show(Component.java:1716)
        at java.desktop/java.awt.Component.setVisible(Component.java:1663)
        at java.desktop/java.awt.Window.setVisible(Window.java:1021)
        at comp3170/comp3170.Example1.<init>(Example1.java:22)
        at comp3170/comp3170.Example1.main(Example1.java:50)


Reply | Threaded
Open this post in threaded view
|

Re: InaccessibleObjectException

malcolmryan
In reply to this post by malcolmryan
I solved the InaccessibleOjectException by setting the JRE to 1.8.
Reply | Threaded
Open this post in threaded view
|

Re: InaccessibleObjectException

gouessej
Administrator
Hello

Have you looked at my suggestions here?
https://jogamp.org/bugzilla/show_bug.cgi?id=1317#c21

Do you use "--permit-illegal-access" or "--add-exports"?
Julien Gouesse | Personal blog | Website