solved:  bizzare issues with Java or Odejava

Hi,

I’ve hit a dead end with my implementation of an XML ODE format for Odejava.

And a dead end is about the best way to describe it. Every move I take, I run into JVM native crashes. On the weekend, I had to add in some code I had written (which didn’t work) line by line, testing and backing it up to find the issues.

In the past, libodejava.so has crashed on me - and this is understandable because it is an alpha library. What’s got me stumped here is that it appears from my crash logs that it’s NOT Odejava which is crashing Java but java itself.

The reason I think that is because supposedly the errors are occurring in libc.so and libjvm.so. Can Odejava’s native library cause errors which confuse Java into thinking they are in libc.so and libjvm.so?

My biggest problem is that Java/Odejava is behaving illogically and non-deterministically. I have never encountered such behaviour and am running out of ideas, and patience. Two things I have determined were contributing factors to the crashes were excess log statements and a recursive method (just doing some vecmath stuff).

But… Why? What’s wrong with excess log statements and a recursive method. Neither should cause Java to crash - but they do in this case.

Have I found a bug? If so I am far off narrowing it down to a reproducible test case.

I’ve tested this with all 1.4.2_0X JVM’s with little change. I’ve tested it on Windows which crashes less - but still happens. Is there anyone out there who has experience with Java crashes who can give me some advice?

The progress of my XML parser is here:
http://odejava.org/jws/jws-org.odejava.xith3d.test.RunDemo.jnlp

it’s a crude demo - but it’s loaded from an XML file (here: http://odejava.org/jws/boxsphere.xml).

About 40% of the time the demo works in linux, about 70% in Windows. So the big question is why not the remaining 60% and 30%? And where are the meaningful java error/debugging messages I am so used to and are one of Java’s largest strengths?

Please help,

Will.

solved;

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=cluebies;action=display;num=1083714114;start=0#4

such a simple fix - such a confusing problem.

Nice way to waste a day :-[

Will.

That’s a strange bug indeed. It would be good to report it to Sun, although it’s probably quite hard to fix it.

Running your demo I get “java.lang.NoClassDefFoundError: org/apache/xerces/parsers/DOMParser”, although xercesImpl.jar was downloaded correctly.

Here’s the full error message:


java.lang.NoClassDefFoundError: org/apache/xerces/parsers/DOMParser
      at org.odejava.xode.XODEParserDOM.<init>(XODEParserDOM.java:72)
      at org.odejava.test.xode.XODEExample.<init>(XODEExample.java:101)
      at org.odejava.xith3d.test.RunDemo.main(RunDemo.java:157)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at com.sun.javaws.Launcher.executeApplication(Launcher.java:837)
      at com.sun.javaws.Launcher.executeMainClass(Launcher.java:797)
      at com.sun.javaws.Launcher.continueLaunch(Launcher.java:675)
      at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:390)
      at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:199)
      at com.sun.javaws.Launcher.run(Launcher.java:167)
      at java.lang.Thread.run(Thread.java:534)

try refreshing your cache - I fixed that problem a few days ago. I had someone who doesn’t even use Java run it ok - so I’m sure it must be fine.

you should see:


Will.

Hi,

Definitely think this problem should be reported to Sun. Given a proper error message you would have spent 5 sec in this problem instead of a full day. I am sure that goes for all the rest that will encounter the same sort of thing.

When I tried to run your demo on my lap-top I got this error:


net.java.games.jogl.GLException: Unable to enumerate pixel formats of window using wglGetPixelFormatAttribivARB
      at net.java.games.jogl.impl.windows.WindowsGLContext.choosePixelFormatAndCreateContext(WindowsGLContext.java:378)
      at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.create(WindowsOnscreenGLContext.java:204)
      at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:133)
      at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:110)
      at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:203)
      at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:186)
      at net.java.games.jogl.GLCanvas.display(GLCanvas.java:74)
      at com.xith3d.render.jogl.CanvasPeerImpl.render(CanvasPeerImpl.java:1100)
      at com.xith3d.scenegraph.View.renderOnce(View.java:755)
      at com.xith3d.scenegraph.View.renderOnce(View.java:688)
      at org.odejava.xith3d.test.RunDemo.<init>(RunDemo.java:141)
      at org.odejava.xith3d.test.RunDemo.main(RunDemo.java:157)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at com.sun.javaws.Launcher.executeApplication(Unknown Source)
      at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
      at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
      at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
      at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
      at com.sun.javaws.Launcher.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

This probably has something to do with JOGL rather than ODE XML.

Keep up the good work!

/J

Looks like the error is a odejava problem which manifests itself as a JVM one.

IMHO the whole Java native stuff is messy - but that’s why we use pure java code in the first place :slight_smile:

I guess I could submit an RFE requesting better error messages - but this bug is most likely our fault to start with.

Will.

I encountered this same GLException today on a PC with Intel integrated graphics. Installing the latest Intel graphics driver (Ver# 14.8.01) downloaded from the Intel website fixed the problem.