We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › MagicNumberException in OPENgl Applet - Solution!
Page Index Toggle Pages: 1
MagicNumberException in OPENgl Applet - Solution! (Read 778 times)
MagicNumberException in OPENgl Applet - Solution!
Dec 15th, 2009, 2:43pm
 
If you are receiving magicnumberexceptions whenever you host your opengl applets (which work locally) on an external site, try this solution:

1) Visit a page on the website that does NOT exist.
(Ie., index12398470847.html, or something silly)
2) You should receive a simple 404 - page not found page.
3) If you are redirected to another page, that's no good.

My solution was to change the 404 handling on my website so that an actual 404 page was returned.
(add <? header("HTTP/1.0 404 Not Found"); ?> to the top of the error page)

Why does this solution work?

The joglAppletLoader does a query for some JOAL libraries by actually just testing whether the URL exists. It got a page instead of a 404 error, and so it assumed that the applet used JOAL. It tries to load JOAL, and crashes.
Re: MagicNumberException in OPENgl Applet - Solution!
Reply #1 - Dec 17th, 2009, 5:43am
 
Wow man!...
I had that once, it was esoteric...

Thanks for the explanation here, I'd never figured out...
BTW: Is this related only to OpenGL emulation mode?
Re: MagicNumberException in OPENgl Applet - Solution!
Reply #2 - Dec 17th, 2009, 8:52am
 
thanks for the info.
reading the source the are aware of the problem:
Code:

..
// See whether JOAL is present
try {
Class alClass = Class.forName("net.java.games.joal.AL", false, this.getClass().getClassLoader());
haveJOAL = true;
// Note: it seems that some JRE implementations can throw
// SecurityException as well as ClassNotFoundException, at least
// if the OpenAL classes are not present and the web server
// redirects elsewhere
} catch (Exception e) {
}
..


do not understand why i would crash though..
Page Index Toggle Pages: 1