Create an applet
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2008 04:01 AM
Hi!
I'm trying to insert an applet in login.jsp. I've written the .class, and added to login.jsp the following:
<APPLET CODE="Mouse1.class" WIDTH=150 HEIGHT=25></APPLET>
However, the applet isn't loaded, and an error appears:
java.lang.ClassFormatError: Incompatible magic value 218762506 in class file Mouse1
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Can anyone help me? If I do the same outside Alfresco, it works fine.
Thank you!
I'm trying to insert an applet in login.jsp. I've written the .class, and added to login.jsp the following:
<APPLET CODE="Mouse1.class" WIDTH=150 HEIGHT=25></APPLET>
However, the applet isn't loaded, and an error appears:
java.lang.ClassFormatError: Incompatible magic value 218762506 in class file Mouse1
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Can anyone help me? If I do the same outside Alfresco, it works fine.
Thank you!
Labels:
- Labels:
-
Archive
6 REPLIES 6

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2008 05:03 AM
This is more than likely a compilation issue with your class, was it compiled with an older JDK?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2008 05:17 AM
Thank you for your answer.
It was compiled with jdk1.5.0_08, but I don't think it has nothing to do with the version, because the same applet works if I use it outside Alfresco.
Anyway, do you think I should use another version?
It was compiled with jdk1.5.0_08, but I don't think it has nothing to do with the version, because the same applet works if I use it outside Alfresco.
Anyway, do you think I should use another version?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2008 12:50 PM
I'm not sure to be honest, just googling your error message seemed to suggest a compatibility question. It is strange that you say it worked outside Alfresco as an applets evironment is governed by the browser.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2008 02:45 AM
I've found the problem:
The applet doesn't work in login.jsp, but however, it works in any other .jsp which is situated in another level, for example dialog/delete.jsp.
It's strange, isn't it? So, as I need the applet in login.jsp, I'm trying to redirect this page to another situated under jsp/dialog. I hope it works.
Thank you for your help!
The applet doesn't work in login.jsp, but however, it works in any other .jsp which is situated in another level, for example dialog/delete.jsp.
It's strange, isn't it? So, as I need the applet in login.jsp, I'm trying to redirect this page to another situated under jsp/dialog. I hope it works.
Thank you for your help!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2008 07:35 AM
I tried that and it's impossible: login.jsp can't redirect to another page, so there's a big problem, as I need to execute the applet in the login page.
Can anyone help me? It's really important.
Can anyone help me? It's really important.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2008 09:25 AM
I wonder whether it has anything to do with authentication, as you are trying to put it on your login page you won't have authenticated, the browser will make a request for the applet class files which is probably going through one of the authentication filters, that is probably doing a redirect to the login page, hence the weird error about "Incompatible magic value".
Where are the class files stored? Try putting them on the root of your server or outside the "/faces" URL.
Where are the class files stored? Try putting them on the root of your server or outside the "/faces" URL.
