0

I am trying to load an Applet but ended up with this error:

java.lang.ClassFormatError: Incompatible magic value 1008813135 in class file

I placed the HTML and the Test.class file in the same folder, internal.

<applet code="Test.class" align="Top" width="75%" height="25%" >

When I try to download class file myself, using the URL http://www.xxxxxxxxx.com/internal/Test.class it is successfully downloading and I am able to decompile it.

I have already tried

  • clearing Temporary Internet Files in Java Control Panel
  • clearing the browser cache

Edit:

The same applet runs fine if I we are accessing from ‘http://www.test.com’ and it’s failing to load we try to access from ‘https://www.test-1.com’ here ‘www.test.com’ and ‘www.test-1.com’ are pointing to same server and a single code base. i.e two url’s pointing to same IP in DNS.

ram
  • 11
  • 2
  • 1
    Show your Test class. – PM 77-1 Mar 16 '16 at 22:33
  • @WilliamPrice - That is definitely the same symptom, but it doesn't explain why he is getting this problem or how to diagnose it. – Stephen C Mar 16 '16 at 22:46
  • 1
    Ram - I suggest that you look at server-side logs to try to find out what URL the browser itself is using to download the class file, and what response code code is being sent. – Stephen C Mar 16 '16 at 22:48
  • @WilliamPrice - Here it’s a bit different case, where I am able to download class file from server. If I hit ‘http://www.xxxxxxxxx.com/internal/ Test.class’, Test.class is downloading and I am able to save to my local. – ram Mar 16 '16 at 23:36
  • Stephen C - I am bit lost here, how could I check what url the browser use to load applet when I loading .html, my assumption is that applet also uses the same URL. Could you correct me if I am wrong. – ram Mar 16 '16 at 23:41
  • The error gives evidence that it's trying to load *a class* from something like an HTML file beginning with a DOCTYPE declaration. `Test.class` may be your entry point but are you sure that it's the _actual class_ that Java is trying to load when that error occurs? You didn't provide server request logs or even a full stack trace. – William Price Mar 16 '16 at 23:55
  • For instance, might `Test.class` reference any other classes outside of the standard JRE, where perhaps that class (or another one that itself refers to) isn't uploaded to the server (or in the proper location)? – William Price Mar 16 '16 at 23:57

0 Answers0