• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Copy dlls and lic files from server path to local system 32 dir in Applet init()

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a signed applet loads when user logged in application.

The init() method copy the dll and lic files from server path to the local system 32 dir .This is working file as of now with Windows XP.But with windows 7 ,got error 'Access Denied' while try to copy file to system 32. Please advise.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You probably need admin-level access for that, whereas most users only have get user-level access (in both Vista and Windows 7).

Why do you want to copy DLLs to the client machine? Isn't DLL hell bad enough as it is? You can distribute DLLs in signed jar files along with the applet without having to copy/install anything.
 
Ramakrishna Gangadas
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
accessing windows registry and for that using jniwrap.dll and jniwrap.lic.
I have the admin rights in windows 7 machine. If i do manually it asks me whether to continue as Administrator , if i say continue then files copying without issues to System 32 folder.

I embedded the dlls and lic file in the signed applet jar. But the applet is not recognizing the dll while use jniwrap
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That doesn't address why the DLLs need to be installed locally. Is the applet some kind of installer that doesn't do any work by itself, and whose whole purpose is to install those DLLs locally?
 
Ramakrishna Gangadas
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For applet purpose as the applet uses the jniwrap classes to access the registry. The applet using to add or copy or check in or chek out files.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, that means there is no need to copy any DLL files anywhere. Just distribute them in signed jar files along with the applet, and the JVM will find them just fine.
 
Ramakrishna Gangadas
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If i copied the dll to the signed jar, still got the exceptions while applet loading.
I copied the dlls first to jar then signed and also signed first and then copied dlls. Both ways same exception

Exception in thread "thread applet-com.applet.MyApplet-1" java.lang.UnsatisfiedLinkError: no jniwrap in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.jniwrapper.r.run(SourceFile:127)
at java.security.AccessController.doPrivileged(Native Method)
at com.jniwrapper.DefaultLibraryLoader.loadLibrary(SourceFile:131)
at com.jniwrapper.Library.loadNativeCode(SourceFile:41)
at com.jniwrapper.Library.loadNativeCode(SourceFile:66)
at com.jniwrapper.Library.ensureNativeCode(SourceFile:76)
at com.jniwrapper.PlatformContext.a(SourceFile:241)
at com.jniwrapper.PlatformContext.getDefaultStructureAlignment(SourceFile:182)
at com.jniwrapper.Structure.init(SourceFile:101)
at com.jniwrapper.win32.system.VersionInfo.<init>(SourceFile:43)
at com.jniwrapper.win32.system.Kernel32.isUnicode(SourceFile:44)
at com.jniwrapper.win32.FunctionName.<clinit>(SourceFile:18)
at com.jniwrapper.win32.registry.WinRegistry.<clinit>(SourceFile:17)
at com.jniwrapper.win32.registry.RegistryKey.getHandle(SourceFile:374)
at com.jniwrapper.win32.registry.RegistryKey.openSubKey(SourceFile:308)
at com.jniwrapper.win32.registry.RegistryKey.openSubKey(SourceFile:295)
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Post the APPLET tag and the location (and included files) of all jar files.
 
Ramakrishna Gangadas
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have jar files specific to my application to use for check in or copy files.

Do you think those jars will be matter here? The problem is dlls getting copied to System 32 in XP but not in windows 7 though having the administrator rights. I was able to copy these to Desktop and applet loading properly.
 
Ramakrishna Gangadas
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the code base is
<object NAME='FileViewer' " +
"classid='clsid:8AD9C840-044E-11D1-B3E9-00805F499D93' " +
"codebase='http://java.sun.com/update/1.5.0/jinstall-1_5_0_18-windows-i586.cab#Version=1,5,0,18' " +
"height='5' width='5' > <param name="java_code" value="mypackage.MyApplet"><param name"java_codebase" value="/APPCONTESTNAME/MyAPPletFolder">
<param name"java_archive" value"myapplet.jar"></object>;

This is in jsp. The MyAPPletFolder folder contains myapplet.jar. The jar contains signed applet class,JNIWrapper classes and other class files required by my file operations.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which signed jar file contains the native library?
 
Ramakrishna Gangadas
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
myapplet.jar contains JNIWrapper classes which has signed applet.

jniwrp.dll will be downloaded to loacal system32 folder while applet loading.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, my previous posts were based on the assumption that you would be using the approach I mentioned - shipping native libraries in signed jar files, and thus neatly avoiding the need to copy/install files locally. But if you insist on doing it that way, then I can't help any further.
 
Ramakrishna Gangadas
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its ok..Thanks for the help so far. Will poast if i find an approach or solution for my problem.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm curious why you choose to ignore the solution I provided, and instead insist to look for something else that is both more complicated and less likely to work.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic