Main Menu

JRE 1.1

Started by dear_stephen, May 08, 2007, 11:19:40 AM

Previous topic - Next topic

dear_stephen

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


EgonOlsen

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.

hytparadisee

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?  ::)
Today I finally found a problem to my soluuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuution

EgonOlsen

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...

EgonOlsen

Ok, please try the jar at http://www.jpct.net/download/beta/jpct.jar and let me know if the problem is fixed now.

dear_stephen

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  ;)  ;)  ;)


EgonOlsen

Quote from: dear_stephen on May 09, 2007, 04:41:54 PM
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.

EgonOlsen

Ok, i've updated the jar. Please give it a try now.

EgonOlsen


dear_stephen

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

EgonOlsen

ARGHHH!!! But at least that one is easy to fix. I'll post a fixed version later today.

EgonOlsen

Ok, the jar has been updated (once again). I can't wait to see where i've broken 1.1 compatibility next...

dear_stephen

Yippie!

It all seems to be working supa dupa!

Thanks very much!


tooteloo,
Stephen