File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

signed applet issue

Aparna Sree
Greenhorn

Joined: Jul 21, 2010
Posts: 28
Hi,

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
Rancher

Joined: Jan 08, 2009
Posts: 1398
    
    6

Whats the exception stack trace?


Swastik
Aparna Sree
Greenhorn

Joined: Jul 21, 2010
Posts: 28

java.io.FileNotFoundException: "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
Marshal

Joined: Mar 22, 2005
Posts: 39549
    
  27
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.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: signed applet issue
 
Similar Threads
Call DLL file signed applet
steps to run an applet
Singed applet issue.
to automatically install jre 1.4 plugin
.dll access problem in client machine