Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JNI, applets and ClassLoader re-use



also
take a look at ClassLoader.java code
it will clarify that you got that exception not because your library wasn't found

did you think about writing your own ClassLoader?
no actually it's not good because you don't have access
to loadedLibraryNames vector (it's private) :-(

as Adrian Sutton mentioned it's known bug and that's why it's impossible to use JNI from applets
and that's unfortunate because I thought to use gl4java for applets

On Mar 17, 2004, at 4:57 PM, Beau Burke wrote:

This is causing me to pull my hair out. Any insight would be appreciated.

So, I've got a signed applet that makes use of a JNI library. I can load this applet once just fine, in any browser (tried IE 5.2.3, Firefox 0.8, Safari 1.21 - all on 10.3.3) and everything will work fine. If I close the applet-containing page, but not the entire browser, then try and reload the exact same page, I get UnsatisfiedLinkError, like so:

java.lang.UnsatisfiedLinkError: Native Library /Users/beau/Library/Application Support/myfolder/blahblahblah.jnilib already loaded in another classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1378)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1309)
at java.lang.Runtime.load0(Runtime.java:693)
at java.lang.System.load(System.java:792)
...(my static code)..
at sun.applet.AppletPanel.run(AppletPanel.java:339)
at java.lang.Thread.run(Thread.java:491)

Am I doing something stupid or is Apple? Java documentation seems to imply this error should be thrown only when the library can't be found. Also, fiddling with the plugin settings (re-cycle classloader, clearing jar cache, etc) doesn't help at all.

-Beau
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.


Dmitry Markman
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >JNI, applets and ClassLoader re-use (From: Beau Burke <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.