Author Topic: JRE 1.1  (Read 6420 times)

Offline dear_stephen

  • byte
  • *
  • Posts: 32
  • 'day mate
    • View Profile
    • Fluidforms ~ Individual Design
JRE 1.1
« 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...
Code: [Select]
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


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: JRE 1.1
« Reply #1 on: May 08, 2007, 11:36:45 am »
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.

Offline hytparadisee

  • int
  • **
  • Posts: 86
    • View Profile
    • http://peterhi.com
Re: JRE 1.1
« Reply #2 on: May 08, 2007, 11:44:41 am »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: JRE 1.1
« Reply #3 on: May 08, 2007, 02:40:23 pm »
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...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: JRE 1.1
« Reply #4 on: May 08, 2007, 06:00:33 pm »
Ok, please try the jar at http://www.jpct.net/download/beta/jpct.jar and let me know if the problem is fixed now.

Offline dear_stephen

  • byte
  • *
  • Posts: 32
  • 'day mate
    • View Profile
    • Fluidforms ~ Individual Design
Re: JRE 1.1
« Reply #5 on: May 09, 2007, 04:41:54 pm »
It didn't work  :( I got the same error. try something like...

Code: [Select]
            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  ;)  ;)  ;)


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: JRE 1.1
« Reply #6 on: May 09, 2007, 05:35:23 pm »
It didn't work  :( I got the same error. try something like...

Code: [Select]
            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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: JRE 1.1
« Reply #7 on: May 09, 2007, 06:10:00 pm »
Ok, i've updated the jar. Please give it a try now.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: JRE 1.1
« Reply #8 on: May 11, 2007, 12:28:08 am »
Is it fixed now?

Offline dear_stephen

  • byte
  • *
  • Posts: 32
  • 'day mate
    • View Profile
    • Fluidforms ~ Individual Design
Re: JRE 1.1
« Reply #9 on: May 11, 2007, 02:20:52 pm »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: JRE 1.1
« Reply #10 on: May 11, 2007, 02:47:43 pm »
ARGHHH!!! But at least that one is easy to fix. I'll post a fixed version later today.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: JRE 1.1
« Reply #11 on: May 11, 2007, 04:59:43 pm »
Ok, the jar has been updated (once again). I can't wait to see where i've broken 1.1 compatibility next...

Offline dear_stephen

  • byte
  • *
  • Posts: 32
  • 'day mate
    • View Profile
    • Fluidforms ~ Individual Design
Re: JRE 1.1
« Reply #12 on: May 14, 2007, 11:08:19 am »
Yippie!

It all seems to be working supa dupa!

Thanks very much!


tooteloo,
Stephen