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



there is 2 flavors of jnilib:

1. bundle: could be unloaded
2. dynamic library: no way to be unloaded

what kind of jnilib do you have?

take a look at that thread:

http://forum.java.sun.com/thread.jsp? forum=52&thread=495718&tstart=15&trange=15

especially related to running gc twice
and removing all active references to your library related object

or try google:
already loaded in another classloader

you'll find many discussions related to that issue

and I don't think it's an Apple's problem


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.