Problem with com.xith3d.test.CubeTest

Hello,
I am new and I have just discovered Xith3D.
Unfortunatly, despite I followed the instruction of installing.php.html, when I tryed to run the first test command, I had the following problem :

[nico@Nico xith3d]$ java -cp libs/xith3d.jar com.xith3d.test.CubeTest
Exception in thread “main” java.lang.NoClassDefFoundError: while resolving class: com.xith3d.test.CubeTest
at java.lang.ClassLoader.resolveClass0(java.lang.Class) (/usr/lib/libgcj.so.4.0.0)
at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.4.0.0)
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.4.0.0)
at java.lang.Class.forName(java.lang.String) (/usr/lib/libgcj.so.4.0.0)
at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.4.0.0)
at _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.4.0.0)
at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.4.0.0)
at __libc_start_main (/lib/i686/libc-2.3.2.so)
Caused by: java.lang.ClassNotFoundException: javax.vecmath.Vector3f not found in [file:libs/xith3d.jar, file:/usr/share/java/libgcj-3.3.1.jar, file:./, core:/]
at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.4.0.0)
at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.4.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.4.0.0)
at _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib/libgcj.so.4.0.0)
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.4.0.0)
at _Jv_BytecodeVerifier.verify_instructions_0() (/usr/lib/libgcj.so.4.0.0)
at _Jv_VerifyMethod(_Jv_InterpMethod) (/usr/lib/libgcj.so.4.0.0)
at _Jv_PrepareClass(java.lang.Class) (/usr/lib/libgcj.so.4.0.0)
at java.lang.ClassLoader.linkClass0(java.lang.Class) (/usr/lib/libgcj.so.4.0.0)
at java.lang.ClassLoader.resolveClass0(java.lang.Class) (/usr/lib/libgcj.so.4.0.0)
…7 more

I am working under Linux Mandrake 9.2.
Is here somebody to help me?
Thank you in advance.

Nico

What is your Java library path (use the small script in the troubleshooting section of the install tutorial to find this out)? Usually it’s $JRE/lib/ext on Linux. Are you sure you placed vecmath.jar there?

Hello Jens,
Thanks a lot for your answer.
I installed again Xith3d in order to be sure not to forget anything, but, unfortunately, I still have the same problem.
I tried the Prop.java program, but it doesn’t give me any information :

nico@Nico nico]$ javac Prop.java
[nico@Nico nico]$ java Prop

[nico@Nico nico]$

I don’t know what to do now.
For information, I installed Java3d to see what’s happen and, when I want to test its installation, I have quiet the same message than the one above.
If I don’t find where it comes from, I will probably install Red Hat 8.3 instead of Mandrake 9.2 (I expect the “libgcj.so.4.0.0” and the “libc-2.3.2.so” to be responsible).
Just a last question ; are there any environment variable to update ?
Thanks for your patience.

Nico

I just noticed I mixed things up. The Java library path is where the native libs have to be copied and is usually $JRE/lib/i386. The jar files have to be copied to $JRE/lib/ext. Futhermore the exceptions indicate that you are using gcj. I don’t know much about gcj, but try to install Java from Blackdown or Sun and see if that works.

You are all right.

I noticed this intervention of “gcj” to and I expected it was in relation with the gcc-java package I installed with Mandrake 9.2.
Uninstalling it didn’t solve the problem properly, so I decided to install again Mandrake without gcc-java.

An other point was that I installed java using the .rpm setup and I begin to think this was not really a very good idea.

Currently, I am working on mynew Mandrake, without gcc-java and with java installed from the .bin setup. It seems to work better, but I have a new problem with the test.

I give you my way :

[nico@localhost xith3d]$ /usr/java/j2sdk1.4.2_03/bin/java -cp libs/xith3d.jar com.xith3d.test.CubeTest
starting frame speed test
Exception in thread “main” net.java.games.jogl.GLException: Error making context current
at net.java.games.jogl.impl.x11.X11GLContext.makeCurrent(X11GLContext.java:141)
at net.java.games.jogl.impl.x11.X11OnscreenGLContext.makeCurrent(X11OnscreenGLContext.java:111)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:162)
at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:182)
at net.java.games.jogl.GLCanvas.display(GLCanvas.java:82)
at com.xith3d.render.jogl.CanvasPeerImpl.render(CanvasPeerImpl.java:950)
at com.xith3d.scenegraph.View.renderOnce(View.java:732)
at com.xith3d.scenegraph.View.renderOnce(View.java:665)
at com.xith3d.test.CubeTest.(CubeTest.java:181)
at com.xith3d.test.CubeTest.main(CubeTest.java:201)
[nico@localhost xith3d]$ /usr/java/j2sdk1.4.2_03/bin/javac Prop.java
[nico@localhost xith3d]$ /usr/java/j2sdk1.4.2_03/bin/java Prop
/usr/java/j2sdk1.4.2_03/jre/lib/i386/client:/usr/java/j2sdk1.4.2_03/jre/lib/i386:/usr/java/j2sdk1.4.2_03/jre/…/lib/i386

I think this is not a big problem but I am new with the java and xith3d world but I hope I will learn quickly.

Nevertheless, it would be great if you could just explain me what this error mean and how I can solve it.
Thank you very much for your answers.

Nico

That’s a Jogl bug, somehow related to the choosing of GLCapabilites (the format of the pixels). If your default bit depth is 16 please change it to 24. You can check this by looking in the file XF86Config-4 in the section “Screen” (or simply execute “fgrep DefaultDepth /etc/X11/XF86Config-4”). If it still doesn’t work, post the relevant sections of XF86Config-4, the output of “glxinfo” and more system information.

Hello Jens,
I am sorry but it still does not work.
As you suggested me, here is the section “Screen” of XF86Config-4 :

Section “Screen”
Identifier “screen1”
Device “device1”
Monitor “monitor1”
DefaultColorDepth 24

Subsection "Display"
    Depth 8
    Virtual 1024 768
EndSubsection

Subsection "Display"
    Depth 15
    Virtual 1024 768
EndSubsection

Subsection "Display"
    Depth 16
    Virtual 1024 768
EndSubsection

Subsection "Display"
    Depth 24
    Virtual 1024 768
EndSubsection

EndSection

Now, the the output of “glxinfo” :

[nico@localhost xith3d]$ glxinfo
name of display: :0.0
Xlib: extension “XFree86-DRI” missing on display “:0.0”.
display: :0 screen: 0
direct rendering: No
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
client glx vendor string: SGI
client glx version string: 1.2
client glx extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
GLX extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
OpenGL vendor string: Mesa project: www.mesa3d.org
OpenGL renderer string: Mesa GLX Indirect
OpenGL version string: 1.3 Mesa 4.0.4
OpenGL extensions:
GL_ARB_imaging, GL_ARB_multitexture, GL_ARB_texture_border_clamp,
GL_ARB_texture_cube_map, GL_ARB_texture_env_add,
GL_ARB_texture_env_combine, GL_ARB_texture_env_dot3,
GL_ARB_transpose_matrix, GL_EXT_abgr, GL_EXT_blend_color,
GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_texture_env_add,
GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3,
GL_EXT_texture_lod_bias
glu version: 1.3
glu extensions:
GLU_EXT_nurbs_tessellator, GLU_EXT_object_space_tess

visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat

0x23 24 tc 1 24 0 r y . 8 8 8 0 0 16 0 0 0 0 0 0 0 None
0x24 24 tc 1 24 0 r y . 8 8 8 0 0 16 8 16 16 16 0 0 0 None
0x25 24 tc 1 24 0 r y . 8 8 8 8 0 16 8 16 16 16 16 0 0 None
0x26 24 tc 1 24 0 r . . 8 8 8 8 0 16 8 16 16 16 16 0 0 None
0x27 24 dc 1 24 0 r y . 8 8 8 0 0 16 0 0 0 0 0 0 0 None
0x28 24 dc 1 24 0 r y . 8 8 8 0 0 16 8 16 16 16 0 0 0 None
0x29 24 dc 1 24 0 r y . 8 8 8 8 0 16 8 16 16 16 16 0 0 None
0x2a 24 dc 1 24 0 r . . 8 8 8 8 0 16 8 16 16 16 16 0 0 None

and more system information :

Intel Pentium II 266 MHz
Intel i740 (graphic card)
old station (isn’t it?)
Thanks again

Nico

Did you have to change the DefaultColorDepth or was it already 24? (If you changed it, you have to restart the X-Server of course.)

The information messages tell me that your buffer size is only 24, but it should be 32. Updating to a recent Mesa release may solve your problem. Xith3D is known to work with Mesa 5 (and probably higher). Mesa 4 doesn’t seem to support the “right” display modes.

Hello,
I didn’t resolve the problem, but I am now going to install mandrake 9.2 with mesa 5.0 and xith3d on a brand new computer I am building (that’s why I couldn’t answer earlier) and I will tell you if it works better.
Thanks a lot for your answers.
Please keep an eye on this subject.

Nico