Bad magic number error
Hi,
Whenever I try to preview my applet, I keep getting a couple FileNotFoundExceptions then it dies with a ClassFormatError.
Java Plug-in 1.6.0_25
Using JRE version 1.6.0_25-b06 Java HotSpot(TM) Client VM
User home directory = C:\Users\Roi Atalla
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to
----------------------------------------------------
sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@578ceb
basic: Plugin2ClassLoader.addURL parent called for http://compilr.com/IDE/download/27505/download.jar?r=10575
network: Cache entry not found [url: http://compilr.com/IDE/download/27505/download.jar?r=10575, version: null]
network: Connecting http://compilr.com/IDE/download/27505/download.jar?r=10575 with proxy=DIRECT
network: Connecting http://compilr.com:80/ with proxy=DIRECT
network: Connecting http://compilr.com/IDE/download/27505/download.jar?r=10575 with cookie "__utmz=126781087.1305761713.1.1.utmcsr=youtube.com|utmccn=(referral)|utmcmd=referral|utmcct=/watch; SESS92e7e447ad723f13d468aef1d514011b=lk8nb6danghla4sb5t1o8grv51; ys-south=o%3Acolumns%3Da%253Ao%25253Aid%25253Dn%2525253A0%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Dn%2525253A1%25255Ewidth%25253Dn%2525253A120%255Eo%25253Aid%25253Dn%2525253A2%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Dn%2525253A3%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Ds%2525253Adescription%25255Ewidth%25253Dn%2525253A989%5Eheight%3Dn%253A100; has_js=1; __utma=126781087.1697975763.1305761713.1305761713.1305761713.1; __utmc=126781087; __utmb=126781087.28.10.1305761713"
basic: Loading Java Applet ...
java.io.FileNotFoundException: http://compilr.com/IDE/download/27505/download.jar?r=10575
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.plugin.PluginURLJarFileCallBack.downloadJAR(Unknown Source)
at sun.plugin.PluginURLJarFileCallBack.access$000(Unknown Source)
at sun.plugin.PluginURLJarFileCallBack$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFileInternal(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$800(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
network: Cache entry not found [url: http://compilr.com/IDE/download/27505/download.jar?r=10575, version: null]
network: Connecting http://compilr.com/IDE/download/27505/download.jar?r=10575 with proxy=DIRECT
network: Connecting http://compilr.com/IDE/download/27505/download.jar?r=10575 with cookie "__utmz=126781087.1305761713.1.1.utmcsr=youtube.com|utmccn=(referral)|utmcmd=referral|utmcct=/watch; SESS92e7e447ad723f13d468aef1d514011b=lk8nb6danghla4sb5t1o8grv51; ys-south=o%3Acolumns%3Da%253Ao%25253Aid%25253Dn%2525253A0%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Dn%2525253A1%25255Ewidth%25253Dn%2525253A120%255Eo%25253Aid%25253Dn%2525253A2%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Dn%2525253A3%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Ds%2525253Adescription%25255Ewidth%25253Dn%2525253A989%5Eheight%3Dn%253A100; has_js=1; __utma=126781087.1697975763.1305761713.1305761713.1305761713.1; __utmc=126781087; __utmb=126781087.28.10.1305761713"
network: Cache entry not found [url: http://compilr.com/IDE/download/27505/download.jar?r=10575, version: null]
network: Connecting http://compilr.com/IDE/download/27505/download.jar?r=10575 with proxy=DIRECT
network: Connecting http://compilr.com/IDE/download/27505/download.jar?r=10575 with cookie "__utmz=126781087.1305761713.1.1.utmcsr=youtube.com|utmccn=(referral)|utmcmd=referral|utmcct=/watch; SESS92e7e447ad723f13d468aef1d514011b=lk8nb6danghla4sb5t1o8grv51; ys-south=o%3Acolumns%3Da%253Ao%25253Aid%25253Dn%2525253A0%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Dn%2525253A1%25255Ewidth%25253Dn%2525253A120%255Eo%25253Aid%25253Dn%2525253A2%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Dn%2525253A3%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Ds%2525253Adescription%25255Ewidth%25253Dn%2525253A989%5Eheight%3Dn%253A100; has_js=1; __utma=126781087.1697975763.1305761713.1305761713.1305761713.1; __utmc=126781087; __utmb=126781087.28.10.1305761713"
java.io.FileNotFoundException: http://compilr.com/IDE/download/27505/download.jar?r=10575
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.plugin.PluginURLJarFileCallBack.downloadJAR(Unknown Source)
at sun.plugin.PluginURLJarFileCallBack.access$000(Unknown Source)
at sun.plugin.PluginURLJarFileCallBack$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFileInternal(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$800(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
network: Cache entry not found [url: http://compilr.com/IDE/download/27505/download.jar?r=10575, version: null]
network: Connecting http://compilr.com/IDE/download/27505/download.jar?r=10575 with proxy=DIRECT
network: Connecting http://compilr.com/IDE/download/27505/download.jar?r=10575 with cookie "__utmz=126781087.1305761713.1.1.utmcsr=youtube.com|utmccn=(referral)|utmcmd=referral|utmcct=/watch; SESS92e7e447ad723f13d468aef1d514011b=lk8nb6danghla4sb5t1o8grv51; ys-south=o%3Acolumns%3Da%253Ao%25253Aid%25253Dn%2525253A0%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Dn%2525253A1%25255Ewidth%25253Dn%2525253A120%255Eo%25253Aid%25253Dn%2525253A2%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Dn%2525253A3%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Ds%2525253Adescription%25255Ewidth%25253Dn%2525253A989%5Eheight%3Dn%253A100; has_js=1; __utma=126781087.1697975763.1305761713.1305761713.1305761713.1; __utmc=126781087; __utmb=126781087.28.10.1305761713"
network: Cache entry not found [url: http://compilr.com/IDE/, version: null]
network: Cache entry found [url: http://compilr.com/IDE/Project.class, version: null] prevalidated=false/0
network: Connecting http://compilr.com/IDE/Project.class with proxy=DIRECT
network: Connecting http://compilr.com/IDE/Project.class with cookie "__utmz=126781087.1305761713.1.1.utmcsr=youtube.com|utmccn=(referral)|utmcmd=referral|utmcct=/watch; SESS92e7e447ad723f13d468aef1d514011b=lk8nb6danghla4sb5t1o8grv51; ys-south=o%3Acolumns%3Da%253Ao%25253Aid%25253Dn%2525253A0%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Dn%2525253A1%25255Ewidth%25253Dn%2525253A120%255Eo%25253Aid%25253Dn%2525253A2%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Dn%2525253A3%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Ds%2525253Adescription%25255Ewidth%25253Dn%2525253A989%5Eheight%3Dn%253A100; has_js=1; __utma=126781087.1697975763.1305761713.1305761713.1305761713.1; __utmc=126781087; __utmb=126781087.28.10.1305761713"
network: ResponseCode for http://compilr.com/IDE/Project.class : 200
network: Encoding for http://compilr.com/IDE/Project.class : null
network: Disconnect connection to http://compilr.com/IDE/Project.class
network: Connecting http://compilr.com/IDE/Project.class with proxy=DIRECT
network: Connecting http://compilr.com:80/ with proxy=DIRECT
network: Connecting http://compilr.com/IDE/Project.class with cookie "__utmz=126781087.1305761713.1.1.utmcsr=youtube.com|utmccn=(referral)|utmcmd=referral|utmcct=/watch; SESS92e7e447ad723f13d468aef1d514011b=lk8nb6danghla4sb5t1o8grv51; ys-south=o%3Acolumns%3Da%253Ao%25253Aid%25253Dn%2525253A0%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Dn%2525253A1%25255Ewidth%25253Dn%2525253A120%255Eo%25253Aid%25253Dn%2525253A2%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Dn%2525253A3%25255Ewidth%25253Dn%2525253A50%255Eo%25253Aid%25253Ds%2525253Adescription%25255Ewidth%25253Dn%2525253A989%5Eheight%3Dn%253A100; has_js=1; __utma=126781087.1697975763.1305761713.1305761713.1305761713.1; __utmc=126781087; __utmb=126781087.28.10.1305761713"
network: Downloading resource: http://compilr.com/IDE/Project.class
Content-Length: 51
Content-Encoding: null
network: Wrote URL http://compilr.com/IDE/Project.class to File C:\Users\Roi Atalla\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\36\24a3a624-1c00ac99-temp
cache: Replacing MemoryCache entry (cnt=0) for http://compilr.com/IDE/Project.classwas=com.sun.deploy.cache.CacheEntry (813251) now=com.sun.deploy.cache.CacheEntry (11665455)
network: Cache entry not found [url: http://compilr.com/IDE/, version: null]
basic: error: Incompatible magic value 1181314149 in class file Project.
java.lang.ClassFormatError: Incompatible magic value 1181314149 in class file Project
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassFormatError: Incompatible magic value 1181314149 in class file Project
Ignored exception: java.lang.ClassFormatError: Incompatible magic value 1181314149 in class file Project
security: Blacklist revocation check is enabled
security: Trusted libraries list check is enabled
network: CleanupThread used 611646 us
security: Accessing keys and certificate in Mozilla user profile: null
@ra4king:
You will need to build before previewing, we still need to automate this :)
@Dahu:
Click settings at the top of the IDE and make sure Main Class and Applet Class are set to the correct classes, build, and preview again.
Thank you for the tip Tim.
But I have double check the applet and main class, even tried to change the package: the sample applet that Compilr provide still doesn't work for me after building and changing settings.
I just tried to download and run the applet locally and it works like a charm ... I think this might be a firewall related issue. Too bad I have to download the applet to test it ... I'll have to stick to Eclipse for the time being unless we can work around this problem ;o)
Created a new java console project. It automatically creates the hello world code. Clicked build and then preview. Got this magic number error. it's borken.
Hey I've been having the same problem... I've been trying to make a console application, and I get a magic number error even if I make a new project, click build, let it build and then preview (all without TOUCHING the default code). To be fair I get the same error after touching it... even pasting source that works on my native IDE
Is this still an issue?
I think it should be fixed now.
Sorry for the long reply
I was just testing the default Java applet code and getting the same issue.
I don't know how correct this is but I added the following to the default applet code and the preview worked.
public static void main(String[] args) {
new blah();
}
Also you need to change the default file name and folder name (I believe) to the name of your main class and it seemed like the names needed to be lowercase which isn't correct Java style.
Something strange is happening because I commented out that addition, save, build, clear Java cache, and the preview still worked.
I just discovered Compilr today and I'm a little disapointed as I have the same kind of problem with the sample applet. (Build, preview and nothing :/ )
Sorry for poluting your post but I think the problem is global ..
Java Plug-in 1.6.0_24
Utilisation de la version JRE 1.6.0_24-b07 Java HotSpot(TM) Client VM
Répertoire d'accueil de l'utilisateur = D:\Documents and Settings\nremy
----------------------------------------------------
c: effacer la fenêtre de la console
f: finaliser les objets de la file d'attente de finalisation
g: libérer la mémoire
h: afficher ce message d'aide
l: vider la liste des chargeurs de classes
m: imprimer le relevé d'utilisation de la mémoire
o: déclencher la consignation
q: masquer la console
r: recharger la configuration des politiques
s: vider les propriétés système et déploiement
t: vider la liste des threads
v: vider la pile des threads
x: effacer le cache de chargeurs de classes
0-5: fixer le niveau de traçage à
----------------------------------------------------
java.lang.ClassFormatError: Incompatible magic value 1181314149 in class file Project
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception : java.lang.ClassFormatError: Incompatible magic value 1181314149 in class file Project