Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

issue using Load Library

Thread view: 
Jothi - 18 Oct 2005 15:18 GMT
Hi,

I am using MAC OSX 10.4 (imac G5).
I am trying to load a JNI library libxxx.jnilib through an applet.
The code is as follows...

System.loadLibrary("xxx");

I compiled, created jar & signed the same. I have placed the
libxxx.jnilib in the /Library/Java/Extensions/ also set
DYLD_LIBRARY_PATH to /Library/Java/Extensions.

I also tried by putting the libxxx.jnilib in
1)
/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Libraries/
2) same folder where the java class & html files are present.
3) /usr/lib/java

For all the above cases I am getting following exception..
iMac:/Library/Java/Extensions root# appletviewer Test.htm
JNINetDirect instance created
java.lang.UnsatisfiedLinkError:
/Library/Java/Extensions/libNetDirect.jnilib:
       at java.lang.ClassLoader$NativeLibrary.load(Native Method)
       at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586)
       at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1495)
       at java.lang.Runtime.loadLibrary0(Runtime.java:788)
       at java.lang.System.loadLibrary(System.java:834)
       at JNINetDirect.init(JNINetDirect.java:32)
       at sun.applet.AppletPanel.run(AppletPanel.java:353)
       at java.lang.Thread.run(Thread.java:552)

The same code if I make it as Java Application it is running
fine....Any idea?
Please help me regarding this...

Regards,
Jothi
Gordon Beaton - 18 Oct 2005 15:50 GMT
> I am using MAC OSX 10.4 (imac G5).

[...]

> System.loadLibrary("xxx");

[...]

> For all the above cases I am getting following exception..
> iMac:/Library/Java/Extensions root# appletviewer Test.htm
> JNINetDirect instance created
> java.lang.UnsatisfiedLinkError:
> /Library/Java/Extensions/libNetDirect.jnilib:
>         at java.lang.ClassLoader$NativeLibrary.load(Native Method)

[...]

> The same code if I make it as Java Application it is running
> fine....Any idea?

Was it really necessary to post this to 5 newgroups? Any why do you
think it belongs in an advocacy group? If you really think you need to
post to more than one group, at least learn to *crosspost* properly
and try to show some restraint.

Some questions for you:

1. Is the name of the library really libxxx.jnilib, or is it
  actually libNetDirect.jnilib? Please don't obfuscate the
  library name if that's what you're doing, it makes it harder
  to interpret the error message. Which library is failing?

2. What is the value of java.library.path
  a: when it works
  b: when it doesn't

3. Does it work if you use

  System.load("/actual/path/to/library/libxxx.jnilib");

  instead? (I don't suggest this as a solution, but the answer
  may help to find out why it's failing)

4. Does the library have runtime dependencies on other libraries?

/gordon

Signature

[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e

Roedy Green - 19 Oct 2005 04:47 GMT
>Was it really necessary to post this to 5 newgroups? Any why do you
>think it belongs in an advocacy group? If you really think you need to
>post to more than one group, at least learn to *crosspost* properly
>and try to show some restraint.

see http://mindprod.com/jgloss/multipost.html
http://mindprod.com/jgloss/crosspost.html
to understand the sins you are being accused of.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.

Andrew Thompson - 18 Oct 2005 15:57 GMT
> I am using MAC OSX 10.4 (imac G5).
> I am trying to load a JNI library libxxx.jnilib through an applet.
...
> For all the above cases I am getting following exception..
> iMac:/Library/Java/Extensions root# appletviewer Test.htm
> JNINetDirect instance created
> java.lang.UnsatisfiedLinkError:
...
> The same code if I make it as Java Application it is running
> fine....Any idea?

Security?  What security environment does the Macintosh
Applet Viewer impose?

Do you swallow exceptions?
<http://www.physci.org/codes/javafaq.jsp#stacktrace>

I suspect you have a SecurityException/AccessControlException
causing the UnsatisfiedLinkError, hidden somewhere in the code
you did not show..


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.