Newbie: Why 'UnsatisfiedLinkError & Access is denied' over network drive?

R

Rachel

Hi,

I have 2 jar files (packageA.jar & packageB.jar) + 1 DLL (used by
packageB.jar) in the follow hierarchy:

folder1/app/packageA.jar (with main-class packA.classA)
folder1/app/dllC.DLL
folder1/lib/packageB.jar (classes packaged in packB)

folder1/app/run.bat has the following:
java -Djava.library.path=. -classpath
...;.;../lib/packageB.jar;../app/packageA.jar packA.classA

1. When folder 1 is located in a local drive, the program runs successfully.

2. But when folder1 is located in a network drive, I get the following
ERROR:
Z:\folder1\app>java -Djava.library.path=. -classpath
...;.;../lib/packageB.jar;../app/packageA.jar packA.classA
java.lang.UnsatisfiedLinkError: Z:\folder1\app\dllC.DLL: Access is denied:
Check that native library dllC is in proper directory
Exception in thread "main" java.lang.UnsatisfiedLinkError: GetVoice
at packB.Voice.GetVoice(Native Method)
at packB.Voice.GetVoiceList(VoiceLocal.java:1003)
at packA.Display.<init>(DisplayApp.java:31)
at packA.Display.main(DisplayApp.java:60)

3. Then I changing my run.bat to the following & ran from Z and it WORKS!:
Z:\folder1\app>java -Djava.library.path="C:/folder1/app" -classpath
...;.;../lib/packageB.jar;../app/packageA.jar packA.classA

Why is it so that my application fails to run when I try to invoke it from
Z? Is it because DLLs cannot be loaded from network drives? Why does it say
Access is denied? Is there some permission that I need to set on Z drive?

Thanks much,
Rach
 
R

Rach

2. But when folder1 is located in a network drive, I get the
following
As long as you have at least read access to the share, it should
work. For example, if you copy the JVM to a network drive, it
works just fine and has no trouble finding its own native
libraries and using them.

Got it working now. Seems like the file permission for that DDL is set
to r--. Changing the DDL's file permission to r-x solves this problem
:)

-Rach-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top