File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes signed applet issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "signed applet issue" Watch "signed applet issue" New topic

signed applet issue

Aparna Sree

Joined: Jul 21, 2010
Posts: 28

I need to copy dlls from server to client and execute it in client machine.

For this, I have used signed applet and JNI.

Everything works fine. On click of my jsp button; it calls applet ; the applet copies the dll in client machine and executes it.

One problem thats really eating my head now. If I click on the button again it throws Exception.

The reason : its unable to copy the second time. My browser and JRE have somehow locked the dll.
Something like.. trying to delete an already opened file.

Any idea how to overcome this? Any javascript or something to kill the JRE instance? or may be free or unload dll. How do i achieve this?

I also tried to do a check before downloading. i.e if file exists. SOme how thats also not working.
Swastik Dey

Joined: Jan 08, 2009
Posts: 1584

Whats the exception stack trace?

Aparna Sree

Joined: Jul 21, 2010
Posts: 28 "path" ... cannot access the file because it is being used by another process.

The dll is in use. If I try to delete the folder, it wont allow.

But, if I close the browser and then click the button , it works fine.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
It is not possible to replace a DLL that's used by a JVM without shutting down the JVM. And -for obvious reasons, really- a web app can't shut down the client-side JVM. You'll need to come up with some other approach, or ask the user to restart the browser.
I agree. Here's the link:
subject: signed applet issue
jQuery in Action, 3rd edition