• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

weblogic 10.3 + jdk6.0.14 = java applet problem?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, we are trying to upgrade our system from old weblogic 10 to weblogic 10.3 and having a problem with java applet.
It simply won't run. It acts as if the applet doesn't exist. The applet runs fine without weblogic.

The applet works with Safari and the old version firefox. But IE and the latest firefox return the following error:

java.lang.ClassFormatError: Incompatible magic value 1008813135 in class file FirstApplet
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.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 1008813135 in class file FirstApplet

Any idea?
I appreciate any help and suggestions in advance.

Best,
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is unlikely that the change will cause an applet to go gaga. The ClassFormatError occurs when the class format is corrupted / unrecognizable for some reason. It is hard to say what is causing it until you debug the problem

Google seems to be of help

http://www.google.com/#hl=en&q=Incompatible+magic+value

You can also try debugging the request / response data to check if the jar is being returned correctly (instead of a 404 page for example)
 
Rom Rox
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your reply.
Not sure.
I'm not using any jar. Just a very simple applet class that prints out 'hello world'. The applet works by itself outside the weblogic server so no corruption is suspected.

The html file:


The java applet code is:

Are there any weblogic server settings that I should check out?

Regards.
 
Deepak Bala
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It probably has to do with the JRE installed on the browser. Applets are a pain to manage on browsers

Try setting the debug params on the applet (available on the sun java console ). Try to debug the requests and responses from the browser. Does a change of JRE / JDK on the browsers help ?
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey, we are facing the same problem as mentioned above. The applet loading works fine in weblogic 9x. But it fails in weblogic 10.3.2 with the following error message in java console,

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

Have also sniffed the request and response in fiddler and the reponse status shows '200'.

Have done enough googling with no concrete solution yet. Any help is greatly appreciated.

Regards,
G
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After some days of trying and quite some search on many different pages on the net i found the solution to the problem
on the java/oracle/weblogic forum:

https://forums.oracle.com/forums/thread.jspa?threadID=989216

It's not a problem of the java version nor any apache problem or browser problem.
The core problem is a change to security issues in weblogic .

With 10.3.5 you need a special setting in the weblogic.xml
of your webapplication (WAR) otherwise when trying to display an applet you always get the "Incompatible magic value" message.
When accessing the applet-jar weblogic isn't relying anymore on your cookie based login and makes a redirect
(to your authentication page). You can see that in the internal weblogic-apache-log under
opt/weblogic/user_projects/domains/MyDomainName/servers/AdminServer

[09/Nov/2011:18:31:23 +0100] "GET /myapp/commons/client/wapplet.jar HTTP/1.1" 302 465

The JVM gets the html of the redirect page, thinks it's a class file and checks for the magic number of every class file.
There it gets the "magic number" retrieved of a html page (which has no magic number) and therefore displays an error.

Weblogic has restricted the cookie base authentication only to http in 10.3.5 (and not to jar/class-Files/Applets)

Therefore after adding
<session-descriptor>
<cookie-http-only>false</cookie-http-only>
</session-descriptor>


to our weblogic.xml the problem was solved:
The already existing cookie based authentication is accepted and the class file of the applet is loaded.
 
N.Gandhi Rajan
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Michael Mann,

You are absolutely right. Adding the following entry in weblogic.xml resolves all the issues,

<session-descriptor>
<cookie-http-only>false</cookie-http-only>
</session-descriptor>

Thanks a lot for posting it which i missed out. Thanks again.

Regards,
Gandhi
reply
    Bookmark Topic Watch Topic
  • New Topic