This content has been marked as final. Show 8 replies
So the problem is that an error occurs when i make an instance of JPanel that draws the image...Absolutely not. It does not get there at all. If you convert the reported magic number to hex, you obtain 4 bytes that correspond to the following 4 characters:
This indicates that what you receive instead of the class file is most likely a HTML page containing an error.
0x0D (CarriageReturn), 0x0A (LineFeed), <, !
Point your browser directly to http:://.../appletImage.class and see what you get. If it's a prompt to download the class file, I am wrong. But if I am right, you will
see the error in your browser.
Wel..,l the first time i typed http://.../appletImage.class it gave me an error but the second time it prompted to download it and the third mozzilla crashed!!
With the second applet when i typed http://.../Test.class it prompted me to download!
So what does it mean?It is a host problem or my applet's and how do u suggest this can be solved?
Thank you for the reply!!!
There is something fishy for sure. I don't know what it is, but if it prompted you at least once to download the class file, I think your applet is ok. When you had the error, what did it say?
Also try to remove ".class" from your applet tag. This is usually tolerated, but not right. Just "appletImage", not "appletImage.class".
947751 wrote:Repeat what I said for appletImage$imagePanel.class. This is another .class file resulring from the compilation of imagePanel.java. Is it there on the web server?
i did what you say and i have the same problem!!
java.lang.ClassFormatError: Incompatible magic value 218774561 in class file appletImage$imagePanel
I suggest you turn that number into hex and from there into characters. You'll probably find it is the beginning of an HTTP error page. If so, have a look at the server's access log to see what the error was and what resource was requested. If it was a class file you would be much better off using JAR files instead of directories as your codebase.
947751 wrote:Probably because you did not copy the inner class class file to the distribution directory.
Thank you very much buftos!! The error was that the class imagePanel was implemented inside appletImage class.When i made a separated file called imagePanel.class the error disappeared !!But why the server couldn't see imagePanel when it was implemented inside appletImage?