jogl 1.1.0-b07 missing some methods

Hi, I am using jogl 1.1.0-b07 and get some errors when calling glu.gluUnProject(int sx, int sy, int sz, double[] model, double[]proj, int[] viewport, double[] objX, double[] objY, double[]objZ);

java.lang.NoSuchMethodError: net.java.games.jogl.GLU.gluUnProject(DDD[D[D[I[D[D[D)I

I’ve included the type of the parameters above so that you can see what I’m passing to it. Does anybody know if the method changed or is it missing.

John

Sorry about this. We fixed some problems during the Java port of these routines. The original C headers used the wrong return type, so when the accessor methods used to be autogenerated, the Java versions had an int as the return type. During the pure Java port we changed this to a boolean. This means that your source code will need to change and that you’ll need to recompile to work with 1.1 b07 and later. Sorry again about this and we’ll continue to try to keep incompatible changes like this to a minimum.

When I look in the jar, I see this:

public boolean gluProject(double,double,double,double[]);
public boolean gluProject(double,double,double,double[]);
public boolean gluUnProject(double,double,double,double[]);
public boolean gluUnProject(double,double,double,double[]);
public boolean gluUnProject4(double,double,double,double,double[]);
public boolean gluUnProject4(double,double,double,double,double[]);

These do not take sufficient arguments to work correctly- these functions take more arguments. Is there something I’m doing wrong?

It looks like you’ve run into a bug in the 1.4.2 version of javap. Thanks for catching it. I’ve filed 6205502 to track it. Unfortunately, I’m not optimistic about it getting fixed in a 1.4.2 update release since it’s already fixed in 1.5 and isn’t a major bug (usually we require a customer escalation in order to backport bug fixes). However, please feel free to add comments on the Java Developer Connection and vote for the bug.

That’s funny, because my compiler and runtime don’t find it either, so I don’t think it’s just javap. When I run the app, the functions aren’t found- i get a no such method error. And this is after a clean rebuild.

Er, excuse me. My compiler seems to find the right method- the app compiles. Then, when running, I get the awesome error the original poster did.

Could you please post a complete stack trace? Are you 100% sure you don’t have any old JOGL jars lying around in various JREs in your system? Calling this method works fine for me with the 1.1 b07 jar off the web.

I redownloaded the 1.1b7 jar again, just to be sure. I get this message:

apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoSuchMethodError: net.java.games.jogl.GLU.gluUnProject(DDD[D[D[I[D[D[D)I
java.lang.NoSuchMethodError: net.java.games.jogl.GLU.gluUnProject(DDD[D[D[I[D[D[D)I

at net.java.games.jogl.impl.GLDrawableHelper.display(GLDrawableHelper.java:74)
at net.java.games.jogl.GLCanvas$DisplayAction.run(GLCanvas.java:221)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:287)
at net.java.games.jogl.impl.macosx.MacOSXOnscreenGLContext.invokeGL(MacOSXOnscreenGLContext.java:84)
at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:208)
at net.java.games.jogl.GLCanvas.display(GLCanvas.java:75)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:170)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

I’ve removed the parts of the stack trace that are in my code- since they are of no use to you, since they just refer to line numbers in my code.

I don’t believe I have any other jogl jars that this could be referring to- I have one, far away from this directory. Nevertheless, I got rid of them, and it didn’t make a difference.

Since two of us are having the same problem, is it possible that there’s actually a problem? I’ve been using JOGL for months and months now, and never had this problem, until coincidentally I download the build that you changed the methods in, and it doesn’t work.

Thanks for your help.

Oh, and just for convenience, here are the actual lines it fails on:

    glu.gluUnProject(winWidth / 2, winHeight / 2, 0, mvmatrix, projmatrix, viewport, p1X, p1Y, p1Z);

This worked before I updated to 1.1.0-b07.

A copy-paste from the latest JOGL source distribution shows that the method signature differs from the earlier one:

public boolean gluUnProject(double winx,
double winy,
double winz,
double[] modelMatrix,
double[] projMatrix,
int[] viewport,
double[] obj_pos)

…See the last parameter obj_pos

We added overloadings of gluProject, gluUnProject and gluUnProject4 in 1.1 b07 that optionally take the resulting position as a single array instead of three separate arrays. The original functions’ signatures are there.

It is definitely possible there is a problem with the 1.1 b07 jar; these methods were missing in the first 1.1 b07 shipment and I patched the jars by hand. However, given the nature of the error you’re seeing I think it’s more likely that some of your sources haven’t been recompiled. The signature being reported for the missing gluUnProject has an I (integer) return value which is now Z (boolean). If you recompile your sources the new method should be referenced instead.

[quote]We added overloadings of gluProject, gluUnProject and gluUnProject4 in 1.1 b07 that optionally take the resulting position as a single array instead of three separate arrays. The original functions’ signatures are there.
[/quote]
Hmmm… That’s weird. I just downloaded the 1.1 b07 src from the JOGL site. The only occurrences of word “gluUnProject” (in the whole source zip) were found in the Project class:

public boolean gluUnProject(…
public boolean gluUnProject4(…

…Where did the original methods go?

Edit: Aha! You mentioned that the jars were hand-patched, so could it be that the source distribution is missing that patch?

Edit2: Doh, nevermind, those methods are generated ones…