This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Applets and the fly likes Singed applet issue. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Singed applet issue." Watch "Singed applet issue." New topic
Author

Singed applet issue.

nithya lakshmi
Greenhorn

Joined: Feb 25, 2010
Posts: 3
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.
Ulf Dittmer
Marshal

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


Ping & DNS - my free Android networking tools app
nithya lakshmi
Greenhorn

Joined: Feb 25, 2010
Posts: 3
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)

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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

Joined: Feb 25, 2010
Posts: 3
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
Marshal

Joined: Mar 22, 2005
Posts: 41089
    
  44
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Singed applet issue.
 
Similar Threads
standalone application question
Where do I enter environment parms ?
Where can I see JVM on my system
Exception in thread main() error
Command Prompt error- Can't run through compiler