Lucas_Santos
Lucas_Santos

Reputation: 4740

Open Applet twice

My applet run when I open my web application and works fine. Inside this web application, I have a button, that if my user click in this button, the applet will open in a pop up, and load the sames .dll files.

A got the error that the .dll files was loaded in another classloader, and googling it, I saw that I can't load the .dll again. So I cut the <archive> tag in my <applet> like this

<applet code="com.griaule.fingerprintsdk.appletsample.FormMain" height="550" width="550">
        <param name="Cliente" value="<%= Cliente_Id %>" />

But I got a new error,

ClassFormatError: Incompatible magic value 218774561 in class files FormMain

In details of this error, appears the following stack

plugin2manager.parentwindowDispose
Exception in thread "thread applet-com.griaule.fingerprintsdk.appletsample.FormMain-1" java.lang.NullPointerException
    at java.awt.EventQueue.isDispatchThread(Unknown Source)
    at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.runOnEDT(Unknown Source)
    at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.doClearAppletArea(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
plugin2manager.parentwindowDispose

UPDATE

The OnClick event of the button on my web application, open a pop up calling the Applet.aspx page.

Applet.ASPX code

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Applet.aspx.cs" Inherits="Ui.San.Chaves.Applet" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../Java/jquery-1.6.2.min.js" type="text/javascript"></script>
    <script src="../Java/jquery.base64.min.js" type="text/javascript"></script>
    <script src="../Java/preloadCssImages.js" type="text/javascript"></script>
    <script src="../Java/jquery-1.4.4.min.js" type="text/javascript"></script>
</head>
<body>
    <applet code="com.griaule.fingerprintsdk.appletsample.FormMain" 
        archive="http://www.netimoveis.com/SignedFingerprintSDKJava.jar, http://www.netimoveis.com/SignedFingerprintSDKJavaAppletSample.jar, http://www.netimoveis.com/sqljdbc4.jar"
        height="550" width="550">
        <param name="Cliente" value="<%= Cliente_Id %>" />
    </applet>
</body>
</html>

Someone can Help me ? I need to call the applet in the load of my web application and when my user click on my button in the same web application.

Maybe a way t unload the applet .dll of the application and load in the another pop up.

Upvotes: 1

Views: 1210

Answers (1)

Andrew Thompson
Andrew Thompson

Reputation: 168815

..the applet will open in a pop up..

Open the applet free-floating using Java Web Start. The applet will have a new JVM for each launch, and the DLL problem will disappear. As a bonus, JWS will allow you to partition the download of natives for OS X & *nix.


As far as theClassFormatError goes, see this answer, which suggests that value adds up to CR, LF, < and !. Such characters might be typical of the start of a server generated '404' page.

Upvotes: 2

Related Questions