File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

signed applet issue

 
Aparna Sree
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1601
5
Android Java Java ME
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whats the exception stack trace?
 
Aparna Sree
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic