Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

signed applet issue

 
Greenhorn
Posts: 28
  • 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.
 
Bartender
Posts: 2265
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whats the exception stack trace?
 
Aparna Sree
Greenhorn
Posts: 28
  • 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.
 
Rancher
Posts: 43016
76
  • 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.
 
That which doesn't kill us makes us stronger. I think a piece of pie wouldn't kill me. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic