bandolero
bandolero

Reputation: 21

Same DLL accessed by two applets in 2 web applications

I need a suggestion to solve the following problem.

I have two web applications (let's say WEBAPP-A and WEBAPP-B) running under the same application server. Each login page in each application page activates a specific applet (let's call them JAPP-A and JAPP-B, respectively). These two applets need to use the same DLL.

Each applet (JAPP-A or JAPP-B) works OK when accessing the application separately (in our case the browser used is Internet Explorer 8.0 and the JRE version of the client is 1.7.0_45). However, when redirecting from WEBAPP-A to WEBAPP-B, the applet JAPP-B crashes.

I get the error:

UnsatisfiedLinkError: 'DLL already loaded in another classloader'

So I have tried to use the same classloader for JAPP-A and JAPP-B by setting the same CODEBASE value inside the applet tag and deploying the JAR containing the JAPP-B code under the CODEBASE path, but we got the same error message.

Can anyone suggest an alternative approach in order to get the applet JAPP-B working correctly?

Upvotes: 0

Views: 165

Answers (1)

Andrew Thompson
Andrew Thompson

Reputation: 168845

Deploy each applet in it's own Java Virtual Machine. E.G. from Applet Deployment Parameters: separate_jvm.

<APPLET archive="my_applet.jar" code="MyApplet" width="300" height="300">
    <PARAM name="java_arguments" value="...">
    <!-- use a separate JVM for this applet! -->
    <PARAM name="separate_jvm" value="true">
</APPLET>

Upvotes: 2

Related Questions