unable to initialize jawt

I run into problems with jogl 2:

Exception in thread "main" java.lang.RuntimeException: Unable to initialize JAWT at com.sun.nativewindow.impl.jawt.JAWT$1.run(JAWT.java:100) at java.security.AccessController.doPrivileged(Native Method) at com.sun.nativewindow.impl.jawt.JAWT.getJAWT(JAWT.java:95) at com.sun.nativewindow.impl.jawt.JAWTUtil.lockToolkit(JAWTUtil.java:118) at com.sun.nativewindow.impl.x11.awt.X11AWTNativeWindowFactory$1.lock(X11AWTNativeWindowFactory.java:67) at com.sun.opengl.impl.x11.glx.awt.X11AWTGLXGraphicsConfigurationFactory.chooseGraphicsConfiguration(X11AWTGLXGraphicsConfigurationFactory.java:91) at javax.media.opengl.awt.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:702) at javax.media.opengl.awt.GLCanvas.addNotify(GLCanvas.java:393) at java.awt.Container.addNotify(Container.java:2639) at javax.swing.JComponent.addNotify(JComponent.java:4687) at java.awt.Container.addNotify(Container.java:2639) at javax.swing.JComponent.addNotify(JComponent.java:4687) at java.awt.Container.addNotify(Container.java:2639) at javax.swing.JComponent.addNotify(JComponent.java:4687) at javax.swing.JRootPane.addNotify(JRootPane.java:750) at java.awt.Container.addNotify(Container.java:2639) at java.awt.Window.addNotify(Window.java:668) at java.awt.Frame.addNotify(Frame.java:486) at java.awt.Window.show(Window.java:859) at java.awt.Component.show(Component.java:1464) at java.awt.Component.setVisible(Component.java:1416) at java.awt.Window.setVisible(Window.java:842) at endrov.modelWindow.TestJOGL.main(TestJOGL.java:63)

==================

and this from the easiest test ever:


public static void main(String[] args)
		{
		
		///create a profile, in this case OpenGL 3.1 or later
		GLProfile profile = GLProfile.get(GLProfile.GL3);
		//configure context
		
		GLCapabilities capabilities = new GLCapabilities(profile);
		capabilities.setNumSamples(2); // enable anti aliasing - just as a example
		capabilities.setSampleBuffers(true);
		
		//initialize a GLDrawable of your choice
		GLCanvas canvas = new GLCanvas(capabilities);
		 
		//register GLEventListener
		canvas.addGLEventListener(new GLEventListener()
			{
				
				public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3,
						int arg4)
					{
					}
				
				public void init(GLAutoDrawable arg0)
					{
					}
				
				public void dispose(GLAutoDrawable arg0)
					{
					}
				
				public void display(GLAutoDrawable drawable)
					{
					GL3 gl = drawable.getGL().getGL3();
					gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
					}
			});
		//... (start rendering thread -> start rendering...)
		
		
		JFrame frame=new JFrame();
		frame.add(canvas);
		frame.setSize(200, 100);

		frame.add(canvas);
		frame.setVisible(true);
		
		
		
		
		
		}

but! the webstart demos work. any ideas?
ubuntu 9.10 x86

Hi!

This is a known bug. Remove these lines and it works anew:

capabilities.setNumSamples(2); // enable anti aliasing - just as a example
capabilities.setSampleBuffers(true);

hmm. not quite so easy. I just noticed I confused the webstart demos, only version 1 works.
javaws http://download.java.net/media/jogl/jsr-231-2.x-demos-webstart/Gears.jnlp net.sourceforge.jnlp.LaunchException: Fatal: Launch Error: Could not launch JNLP file. at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:447) at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:714) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:439) ... 1 more Caused by: java.lang.UnsatisfiedLinkError: no nativewindow_jvm in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1678) at java.lang.Runtime.loadLibrary0(Runtime.java:840) at java.lang.System.loadLibrary(System.java:1047) at com.sun.nativewindow.impl.NativeLibLoaderBase.loadLibraryInternal(NativeLibLoaderBase.java:199) at com.sun.nativewindow.impl.NativeLibLoaderBase.access$000(NativeLibLoaderBase.java:50) at com.sun.nativewindow.impl.NativeLibLoaderBase$DefaultAction.loadLibrary(NativeLibLoaderBase.java:88) at com.sun.nativewindow.impl.NativeLibLoaderBase.loadLibrary(NativeLibLoaderBase.java:126) at com.sun.nativewindow.impl.NativeLibLoaderBase$1.run(NativeLibLoaderBase.java:133) at java.security.AccessController.doPrivileged(Native Method) at com.sun.nativewindow.impl.NativeLibLoaderBase.loadNativeWindow(NativeLibLoaderBase.java:131) at com.sun.nativewindow.impl.jvm.JVMUtil.<clinit>(JVMUtil.java:53) at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:625) at javax.media.opengl.awt.GLCanvas.<clinit>(GLCanvas.java:78) at demos.gears.Gears.main(Gears.java:30) ... 6 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:439) at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:714) Caused by: java.lang.UnsatisfiedLinkError: no nativewindow_jvm in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1678) at java.lang.Runtime.loadLibrary0(Runtime.java:840) at java.lang.System.loadLibrary(System.java:1047) at com.sun.nativewindow.impl.NativeLibLoaderBase.loadLibraryInternal(NativeLibLoaderBase.java:199) at com.sun.nativewindow.impl.NativeLibLoaderBase.access$000(NativeLibLoaderBase.java:50) at com.sun.nativewindow.impl.NativeLibLoaderBase$DefaultAction.loadLibrary(NativeLibLoaderBase.java:88) at com.sun.nativewindow.impl.NativeLibLoaderBase.loadLibrary(NativeLibLoaderBase.java:126) at com.sun.nativewindow.impl.NativeLibLoaderBase$1.run(NativeLibLoaderBase.java:133) at java.security.AccessController.doPrivileged(Native Method) at com.sun.nativewindow.impl.NativeLibLoaderBase.loadNativeWindow(NativeLibLoaderBase.java:131) at com.sun.nativewindow.impl.jvm.JVMUtil.<clinit>(JVMUtil.java:53) at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:625) at javax.media.opengl.awt.GLCanvas.<clinit>(GLCanvas.java:78) at demos.gears.Gears.main(Gears.java:30) ... 6 more

so I tried running the demos without webstart.

java -cp .:/home/tbudev3/javaproj/endrov.git/ev/libs/bin_linux/jogl_inc/gluegen-rt-cdc.jar:/home/tbudev3/javaproj/endrov.git/ev/libs/bin_linux/jogl_inc/gluegen-rt.jar:/home/tbudev3/javaproj/endrov.git/ev/libs/bin_linux/jogl_inc/jogl.all.cdc.jar:/home/tbudev3/javaproj/endrov.git/ev/libs/bin_linux/jogl_inc/jogl.all.jar:/home/tbudev3.........snip.........../newt.x11.cdc.jar:/home/tbudev3/javaproj/endrov.git/ev/libs/bin_linux/jogl_inc/newt.x11.jar -Djava.library.path=libs/bin_linux/jogl_inc/bin_x86 demos.jgears.Gears Exception in thread "main" java.lang.RuntimeException: Unable to initialize JAWT at com.sun.nativewindow.impl.jawt.JAWT$1.run(JAWT.java:100) at java.security.AccessController.doPrivileged(Native Method) at com.sun.nativewindow.impl.jawt.JAWT.getJAWT(JAWT.java:95) at com.sun.nativewindow.impl.jawt.JAWTUtil.lockToolkit(JAWTUtil.java:118) at com.sun.nativewindow.impl.x11.awt.X11AWTNativeWindowFactory$1.lock(X11AWTNativeWindowFactory.java:67) at com.sun.opengl.impl.x11.glx.awt.X11AWTGLXGraphicsConfigurationFactory.chooseGraphicsConfiguration(X11AWTGLXGraphicsConfigurationFactory.java:91) at javax.media.opengl.awt.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:702) at javax.media.opengl.awt.GLCanvas.addNotify(GLCanvas.java:393) at java.awt.Container.addNotify(Container.java:2639) at java.awt.Window.addNotify(Window.java:668) at java.awt.Frame.addNotify(Frame.java:486) at java.awt.Window.show(Window.java:859) at java.awt.Component.show(Component.java:1464) at java.awt.Component.setVisible(Component.java:1416) at java.awt.Window.setVisible(Window.java:842) at demos.jgears.Gears.main(Gears.java:51)

but here’s something interesting:
Gears - doesn’t work at all
JGears - shows a still image of the gears but same error

does this give any clues?

Did you try my suggestion? I don’t reproduce your bugs neither with Mandriva Linux 2010 nor with Cent OS 5.3.

I see this in nativewindow-all-awt.jnlp:

[quote]











[/quote]
There is no link to nativewindow-natives-linux-i586-cdc.jar, that is why webstart does not work in your case.

Why do you mix CDC and non CDC resources? ???

yes, tested it. hence I went on to test some other things and yes, CDC was my problem. I think this needs clarification; “what jar-files should be linked and when”. where can I read about this?

neither do I know what newt is. google wasn’t helpful here?

still, thanks!

When the new website of JOGL is online, it will be better. You’re welcome. I have never used CDC, I can’t help you, sorry :s

CDC means connected device configuration and wasn’t designed to be used on the desktop :wink:

you will need jogl.all.jar, newt.all.jar, nativewindow.all.jar and gluegen-rt.jar to cover all OSes and GL versions.

expect new binaries and simplified deployment in the next weeks. (yes and even a wiki page :wink: )

if you want to play with the old JOGL2 builds you could give the NetBeans OpenGL Pack a try.
http://kenai.com/projects/netbeans-opengl-pack/downloads/directory/early-access
(ships with over 100 ready to run projects… redbook, NEHE, jogl2 demos etc)