• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Singed applet issue.

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a signed applet that loads the native libraries to the applet client machine(java library path, C:\Program Files\Java\jre6\bin). When i have admin rights on the client machine, it copies the dll files without any issue. But when i dont have admin rights, the applet failed to copy the files in the location C:\Program Files\Java\jre6\bin. Is it possible for a singed applet to load the dll files on the java libaray path when the enduser executing the applet dont have admin rights?.

I thought the singed applet will do anything as it is trusted regardless of the admin rights. Please clarify me.
 
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the applet is signed anyway, why do you want to copy the DLLs to the client machine? It would be much easier to ship them in a signed jar file along with the applet jar file.
 
nithya lakshmi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a third party jar that actually looks for the DLL file in the location C:\Program Files\Java\jre6\bin and performs some action. So my applet basically loads the DLL files into that location. The DLL files are placed inside the applet jar file and the applet jar is signed. I have also singed the third party jars.

The applet copies the DLL file if the enduser running the applet(applet is embedded in the webapplication) had the adminstrative rights on that directory. Else it does not cpy it gives the error:

java.io.FileNotFoundException: C:\Program Files\Java\jre6\bin\SigUsb.dll(Access is denied)

 
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

nithya lakshmi wrote:I have a third party jar that actually looks for the DLL file in the location C:\Program Files\Java\jre6\bin



Then you're the victim of bad software. (Hard-coding. Bad. Don't do that.) My recommendation would be to get that problem fixed. If you can't, then perhaps you're going to have to ask the users of your applet to make sure they are signed on as an administrator when they run it.
 
nithya lakshmi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply,

I could able to copy the the DLLs to the temporary location for each and every user (java.io.tmpdir) and then set the java.libarary.path pointing to java.io.tmpdir.

In this way i can download the DLLs from the applet and then use it. Do you think is this the good approach to follow?.

 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Do you think is this the good approach to follow?.


Absolutely not. You should not mess with the client machine unless necessary, and in this case it's not necessary. You can easily package the DLL file(s) as jar files, sign those, and ship them along with the applet jars - no need to copy files around at all - that's a much better approach. A helper class like JNLPAppletLauncher makes this a snap to use.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!