www.jpct.net
jPCT - a 3d engine for Java => Bugs => Topic started by: dear_stephen on May 08, 2007, 11:19:40 am
-
I have just tested my applet on the microsoft jre 1.1 and I get the following error message...
java.lang.NoSuchMethodError: java/awt/Color: method getAlpha()I not found
at com/threed/jpct/FrameBuffer.clear
at com/algodes/jpct/JPCTApplet.init
at com/algodes/jpct/Earth.init
at com/ms/applet/AppletPanel.securedCall0
at com/ms/applet/AppletPanel.securedCall
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.run
at java/lang/Thread.run
It seems that an incompatible function has slipped in.
Is this a bug? Is there a work around?
thanks,
Stephen
-
This happens from time to time, because i don't test against 1.1 anymore and if the docs don't state that a method is 1.2+, we have a problem. I'll try to fix it.
-
hmmm. A post just slipped in before mine. Egon!! Ya, This is possibly because getAlpha() is a method from Java API (java.awt.Color), not from jpct. It's just that jpct makes use of this method. I do not have the source but I think Egon tries to clear the buffer with a specified color. Perhaps Microsoft VM does not support transparent color? ::)
-
Alpha for Color wasn't available in 1.1. The JavaDocs don't seem to mention this...at least i couldn't spot it, that's why this one slipped through...
-
Ok, please try the jar at http://www.jpct.net/download/beta/jpct.jar (http://www.jpct.net/download/beta/jpct.jar) and let me know if the problem is fixed now.
-
It didn't work :( I got the same error. try something like...
Color RED = new Color(255, 0, 0, 100);
Class c = RED.getClass();
try {
Method method = c.getMethod("getAlpha", new Class[] {});
System.out.println("alpha: "+method.invoke(RED, null));
} catch (Exception e) {
System.out.println("Could not getAlpha");
}
otherwise you could send me the source and I'll do it ;) ;) ;)
-
It didn't work :( I got the same error. try something like...
Color RED = new Color(255, 0, 0, 100);
Class c = RED.getClass();
try {
Method method = c.getMethod("getAlpha", new Class[] {});
System.out.println("alpha: "+method.invoke(RED, null));
} catch (Exception e) {
System.out.println("Could not getAlpha");
}
I know that...i just don't want to do this every frame. Using reflection is not very expensive on modern VMs, but it can be on older ones and that is where it counts in this case. I'll write a wrapper for Color then that does the trick.
-
Ok, i've updated the jar. Please give it a try now.
-
Is it fixed now?
-
It got past that error but has reached the next one :(
java.lang.NoSuchMethodError: java/util/Vector: method add(Ljava/lang/Object;)Z not found
at com/threed/jpct/VisListManager.getVisList
at com/threed/jpct/World.renderScene
at com/algodes/jpct/JPCTApplet.mainLoop
at com/algodes/jpct/JPCTApplet.run
at java/lang/Thread.run
cheers,
Stephen
-
ARGHHH!!! But at least that one is easy to fix. I'll post a fixed version later today.
-
Ok, the jar has been updated (once again). I can't wait to see where i've broken 1.1 compatibility next...
-
Yippie!
It all seems to be working supa dupa!
Thanks very much!
tooteloo,
Stephen