aspose file tools*
The moose likes BEA/Weblogic and the fly likes weblogic 10.3 + jdk6.0.14 = java applet problem? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "weblogic 10.3 + jdk6.0.14 = java applet problem?" Watch "weblogic 10.3 + jdk6.0.14 = java applet problem?" New topic
Author

weblogic 10.3 + jdk6.0.14 = java applet problem?

Rom Rox
Greenhorn

Joined: Aug 03, 2009
Posts: 2
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,
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6657
    
    5

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)


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Rom Rox
Greenhorn

Joined: Aug 03, 2009
Posts: 2
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

Joined: Feb 24, 2006
Posts: 6657
    
    5

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 ?
g raj
Greenhorn

Joined: Sep 25, 2007
Posts: 4
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
Michael Mann
Greenhorn

Joined: Nov 10, 2011
Posts: 3
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.
g raj
Greenhorn

Joined: Sep 25, 2007
Posts: 4
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: weblogic 10.3 + jdk6.0.14 = java applet problem?
 
Similar Threads
why can't some people play my game
Applet not inited
getting the <APPLET> tag to work
Applet in JSP
Incompatible magic value