Unloading Native Libraries in java

Hi all,
This is what i have read from a document.
The VM calls JNI_OnUnload when the class loader containing the native library is garbage collected.
When the class loader containing the native library is garbage collected, will the native library gets unloaded.

Well it should be unloaded:
"The benefits of the new approach are:
1. Name space separation based on class loaders is preserved in native libraries. A native library cannot easily mix classes from different class loaders.
2. In addition, native libraries can be unloaded when their corresponding class loaders are garbage collected"
As stated in the same document.

Similar Messages

  • How to unload native libraries?

    Hi,
    we have written a J2EE application which needs native libraries (DLL's). Every time that we redeploy the ear file the DLL does not get unloaded and reloaded 'coz it seems 2 B loaded by a classloader which is not a child of the ear classloader. Is there a way we can unload and reload native libraries (DLL's)? Right now, the only way 2 get around this problem is 2 restart the application server (Weblogic 7.0) which is a pain!
    Thanx in advance
    Sid

    Is there a way we can
    unload and reload native libraries (DLL's)?Yes and no.
    There is no way to doit in java.
    There is a way in C/C++.
    You create two dlls. One with the code and one that just proxies to the other dll. The proxy also loads and unloads the dll as it changes and keeps track of the methods.
    If the actual interface to the dll changes then it is somewhat more problematic. If the proxy uses va_args then it can handle that as well.
    Obviously care must be taken in what is being done in the dll. For instance static values would have to be re-initialized with the correct values. That is going to be difficult if a method in java drove the initialization.

  • The struggle of creating a Custom ClassLoader for Native libraries

    Hello Everyone,
    I'm having a really hard time writing and using my own ClassLoader in a Java Applet.
    Context :
    As the this link shows - http://codethesis.com/tutorial.php?id=1 - loading and especially unloading native libraries through Java requires defining our own ClassLoader, and use it to instantiate a class loading a library. When the class using native libraries has finished execution, setting all references to the classloader and calling the garbage collector will cause the native library to be unloaded. The class to load within the custom classloader is thus read byte after byte from the jar and defined using the Classloader.defineClass(..) function. So that's what I did. But I've got two problems.
    Problem 1 :
    On one single machine over 15 tested, the magic number of a given class read from the Jar using Applet.class.getResourceAsStream(classname) takes a value different from CAFEBABE and the defineClass function then throws an "Incompatible magic value" exception (see below). The workaround I found is to force the first 4 bytes of the byte array read from the class with CAFEBABE. But I still would like to understand why it takes a different value on this machine.
    Exception in thread "thread applet-MyApplet.class-1" java.lang.ClassFormatError: Incompatible magic value 409165630 in class file Reader
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at NativeClassLoader.findClass(Unknown Source)
    Problem 2 :
    On windows, the NativeClassLoader works perfectly, but on Linux, I'm getting a java.lang.VerifyError (see below).
    Code is compiled with java 1.6.0_06 on windows XP. I tried to remove everything related to native code (remove .so load), the same error is raised.
    java.lang.VerifyError: (class: Reader, method: <clinit> signature: ()V) Illegal instruction found at offset 1
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.newInstance0(Class.java:326)
    at java.lang.Class.newInstance(Class.java:308)
    Code :
    NativeClassReader (custom) :
    public class NativeClassLoader extends ClassLoader {
        //the unique instance of the NativeClassLoader
        private static NativeClassLoader instance;
        private NativeClassLoader () {
            super(NativeClassLoader.class.getClassLoader());
         * Get the Singleton instance of the class
        public static NativeClassLoader getInstance () {
            if (instance == null)
                instance = new NativeClassLoader();
            return instance;
        public static void dispose () {
            instance = null;
         * Load a class using its full java name (prefixed with package)
        public Class findClass (String theName) {
            byte[] b = null;
            try {
                b = loadClassDataFromJar(theName);
                Class clazz = defineClass(theName, b, 0, b.length);
                resolveClass(clazz);
                return clazz;
            } catch (Exception e) {
                return null;
         * Gets the bytes of a class file stored in the current jar using
         * its full class name
        public byte[] loadClassDataFromJar (String theName)
                                     throws Exception {
            String filename = "/" + theName.replace('.', '/') + ".class";
            InputStream is = SawsApplet.class.getResourceAsStream(filename);
            BufferedReader br = new BufferedReader(new InputStreamReader(is));
            //compute file size
            Vector vChars = new Vector();
            int c;
            while ((c = br.read()) != -1)
                vChars.add(new Byte((byte) c));
            //fill in byte array with chars read from the buffer
            byte[] buff = new byte[vChars.size()];
            //workaround for a bug on one (some) Vista machine(s)
            //force magic number to CAFEBABE instead of 18635F3E
            if (vChars.size() > 3) {
                buff[0] = (byte) 0xCA;
                buff[1] = (byte) 0xFE;
                buff[2] = (byte) 0xBA;
                buff[3] = (byte) 0xBE;
            for (int i = 4; i < vChars.size(); ++i)
                buff[i] = ((Byte) vChars.get(i)).byteValue();
            return buff;
    }Reader (loading native libary) :
    public class Reader {
       static {
         System.loadLibrary("myLib");
        public static native String getData();
    }Main :
        NativeClassLoader cLoader = NativeClassLoader.getInstance();
        Class clazz = cLoader.findClass("Reader"); // ClassFormatError thrown here
        Object reader = clazz.newInstance(); // VerifyError thrown here
        Method m = clazz.getMethod("getData");
        String s = m.invoke(reader);
        print(s);
        s = null;
        m = null;
        reader = null;
        clazz = null;
        cLoader = null;
        NativeClassLoader.dispose();
        System.gcAny ideas would be really appreciated :-)
    Guillaume

    Are you using the executable exe file and the filename as a parameter in the custom task?
    Andreas Baumgarten | H&D International Group

  • [Java 3D] Wich OpenGL versions are supported by natives libraries ?

    Hi,
    anyone could tell me which OpenGL specifications are supported by Java 3D natives libraries ?
    Thanks in advance.

    Hi,
    Java 3D requires at least OpenGL 1.2. It runs on all newer releases up to the current release 4.1 and will run on future versions. Java 3D creates an OpenGL compatibility profile context supporting the (legacy) fixed function pipeline as well as the OpenGL Shading Language GLSL.
    Java 3D's on-screen and off-screen rendering capabilities correspond to OpenGL 2.0 and support vertex and fragment shaders inclusive newest shading language features. On my OpenGL 3.2/DirectX 10 capable graphics device I successfully ran GLSL 1.5 features, see http://www.java.net/forum/topic/javadesktop/java-desktop-technologies/java-3d/shaders-java-3d-0 .
    August

  • Native libraries in ABAP runtime

    Hello
    I have a question. Im developing application which is doing lots of XML processing (quite complicated and time consuming). Since XML support in ABAP itself its very poor we decided to use Java libraries on external server. Comunication between java and abap is done via Jco. But ... the best solution could be if we could use native libraries (java or C JNI wrapper to java) in ABAP. Is there a method or approach to expose interface in ABAP OO and then code implementation to use native library. How to deploy such library in R3.
    I saw that all classes from iXML are connected somehow to native runtime.
    Does anybody know how to do that, or just can point me to any documentation or example ?
    Best regards
    Marcin

    Can you make sure this native library is in the PATH(Windows) or LD_LIBRARY_PATH
    (UNIX)?
    Cameron Purdy wrote:
    That has nothing to do with it being an EJB. It just means it can't find the
    code to call.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "marc claeys" <[email protected]> wrote in message
    news:3cd7e60a$[email protected]..
    Everywhere I read not to use (load) native libraries in a bean.
    However I couldn't find a reason for not doing so I tried.
    The loading of the lib. is successful but when trying to call
    a function of it I receive:
    java.lang.UnsatisfiedLinkError: beanHelloWorld
    Could someone explain why this happens?
    Thanks in advance
    Marc
    Rajesh Mirchandani
    Developer Relations Engineer
    BEA Support

  • Using native libraries in web application (weblogic on linux)

    I have a problem with loading native libraries for use with my web application. Where do I have to put them in order for the server to see them? The same app on windows runs perfectly fine, because it has no problems finding the dll files.
              So far I have tried modifying the weblogic startup scripts, to include the library in LD_LIBRARY_PATH environment variable. I've also tried modifying the security policy just in case, but I don't think it's the case, because like I said, the app ran fine on windows without messing with the policies. So, any ideas, how I could load the libraries?
              The system is a WebLogic 8.1SP4 installed on Linux i386 using JRockit JVM, the native library in question is JAI 1.1.3-alpha native acceleration library.
              PS. if it's in the wrong group, please direct me to the correct one.

    <p>Fukiku,</p>
              <p>Did you get this working?</p>
              <p>You can also try setting the environment variable java.library.path.</p>
              <p>Please post your stack trace to the forum as well.</p>
              <p>
              Hussein Badakhchani</br>
              </p>

  • JMF with Native Libraries as Signed Applet

    Hello
    After spending a few days hunting through forums, digging into JMF source code and hacking in the dark I'm about to give up, but thought I'd start yet another thread on this. It's a long, sad story...
    Problem: Deploying a JMF based program that relies on native libraries (in this case the FOBS4JMF bindings) as an applet: how to get jmf.properties and the native libraries loaded properly.
    Partial Solution: the native libraries packaged in a signed jar file, added to the applet's archive property, extracted using getResourceAsStream(), and loaded using System.load(). This is how FOBS4JMF loads it's native library anyway (via the com.moesol.NativeLibraryFinder):
    Class classInApplet; // name of a class loaded by the applet
    File outputFile; // location for extracted library
    InputStream is = classInApplet.getResourceAsStream(resource);
    copyStream(is, outputFile);
    System.load(outputFile.getAbsolutePath());Why this doesn't really work:
    (a) JMF (com.media.util.Registry) only searches for jmf.properties (which contains the instructions to use the FOBS4JMF plugin) in real folders (i.e. not jars) on the classpath of the local machine. I could extract the jmf.properties to a folder on the local machine, but have no way of making sure that folder would be on the classpath. Calls to "System.getProperty("java.class.path") give varying results - including an empty string on FF/OSX. Even if i could get the classpath somehow, chances are that it wouldn't contain any folders writable under Vista's UAC, which would leave me out of luck.
    JMF also looks for a file called ".jmfdir" in various platform specific locations, and appends the contents of this file to the classpath, so if i could write to that file i'd be golden. This seems like it would work on non windows platforms, because JMF looks for that in "user.home"). However, from what i can tell, on windows, JMF uses a native call to a function called nGetUserHome() to determine where to find .jmfdir - which leads to the second problem...
    (b) the JMF native libraries are loaded through calls to System.loadLibrary(), not System.load(), which means that they have to be on the "java.library.path" in order to be found - and again, I have no way of extracting the libraries to a directory on that path (at least not one writable under Vista UAC). This wouldn't be a problem, as I could pre-load the libraries myself with System.load(), except that JMF throws an exception if it can't find one, and stops trying to do whatever it thinks it needs the library for. Again, not a problem if I use only the FOBS4JMF native code (though i would like to use the DirectAudio renderer on windows) - except that the nGetUserHome() function described above is in a native library (jmutil.dll). So, when com.media.util.Registry.getJMFDir() tries to find ".jmfdir" it first tries to load "jmutil.dll" using System.loadLibrary(). This throws an exception inf "jmutil.dll" is not on the "java.library.path", and com.media.util.Registry.getJMFDir() returns null. Here's the relevant code from com.media.util.Registry.getJMFDir() - with my annotations
    All of these problems are fixable by relatively minor tweaks to the JMF source - but I don't think that's allowed under the SCSL. So if anyone has any, i mean ANY other suggestions, please BRING 'EM ON.
    thanks
    -chris
    EDIT: just for kicks, i checked to see where JMF expects to find .jmfdir on windows - ie the result of nGetUserHome(). At least on XP this seems to be c:\WINDOWS. if it's the same on Vista, then fixing the loadLibrary problem won't help bc I still won't be able to write to this file.
    Edited by: wodenx on May 7, 2010 9:46 AM

    Hi-
    Thanks for responding so quickly.
    As far as the natives go, you might try using the new JNLP embedded applet ability in the plugin2 architecture.I was going to look into that, but decided it wasn't necessary since I can get the FOBS native code to link properly. It's really the registry that's the problem, since without solving that I can't get JMF to USE the FOBS code.
    Can you get it all to work if the JMF installer is invoked? If so, perhaps if you add an installer-desc that calls the normal JMF setup.exe (though that final warning to reboot is both unnecessary and odious).I don't think it would work even with the JMF installer, bc I need to point JMF at the FOBS specific jmf.properties. I might be get it to work by invoking my own installer though, to place my jmf.properties somewhere in the native class path, so that's worth looking at. Thank you. Problem there is that on Vista users would have to elevate to run the applet, which is not ideal.necessary and odious).
    Why do you particularly want to embed media in a web page?The customer may want it. I might be able to convince them to go with JNLP/WebStart, but I think I might have the same problem there. Please correct me if I'm wrong...
    I've also read that there are problems with JMF and JNLP owing to the fact that JMF doesn't recognize the security manager invoked by JNLP, and so gives your program no permissions. Haven't tried it myself yet.
    Thanks again!
    Edited by: wodenx on May 7, 2010 12:07 PM

  • Attaching/Detaching libraries with Java API

    Hello,
    In my forms (Forms10g), sometimes, libraries had been attached in lower case although files are in upper case. This causes compilation errors on UNIX systems.
    I'm trying to detach these libraries with Java APIs and then reattach them in upper case.
    But I get an error when I want to save the module.
    Here is my code :
    public class UpperPll {
         public UpperPll (String formName) {
              try
                   FormModule form = FormModule.open("C:/AttachPll/" + formName);
                   System.out.println("Form Name is " + form.getName());
                   JdapiIterator AttachPll = form.getAttachedLibraries();
                   while(AttachPll.hasNext())
                        try
                             JdapiObject jo = (JdapiObject)AttachPll.next();
                             System.out.println(jo.getName());
                             if (jo.getName().toLowerCase().equals(jo.getName()))
                                  AttachedLibrary.find(form,jo.getName().toUpperCase()).detach();
                                  System.out.println(jo.getName().toUpperCase());
                                  new AttachedLibrary(form,jo.getName().toUpperCase());
                        catch (JdapiIllegalStateException jdise)
                             jdise.printStackTrace();
                   form.save("C:/AttachPll/New/" + form.getName() + ".fmb");
                   Jdapi.shutdown();
              catch (JdapiException jde)
                   jde.printStackTrace();
         public static void main (String[] args) {
              try {
                   FileReader r = new FileReader( "C:/AttachPll/listemodule.txt" );
                   BufferedReader br = new BufferedReader( r );
                   try {
                        String module;
                        while ( ( module = br.readLine() ) != null ) {
                             new UpperPll(module);
                   } finally {
                        r.close();
              } catch (FileNotFoundException fnfe) {
                   fnfe.printStackTrace();
              } catch (IOException ioe) {
                   ioe.printStackTrace();
    And here are the errors I get :
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x2FBBDCB
    Function=icobad+0xB
    Library=C:\DevSuiteHome_1\bin\frmcom.dll
    Current Java thread:
         at oracle.forms.jdapi.BaseAPI._jni_save_form(Native Method)
         at oracle.forms.jdapi.FormModule.save(Unknown Source)
         at UpperPll.<init>(UpperPll.java:39)
         at UpperPll.main(UpperPll.java:55)
    Dynamic libraries:
    0x00400000 - 0x0040B000      C:\DevSuiteHome_1\jdk\bin\javaw.exe
    0x7C910000 - 0x7C9C7000      C:\WINDOWS\system32\ntdll.dll
    0x7C800000 - 0x7C904000      C:\WINDOWS\system32\kernel32.dll
    0x77DA0000 - 0x77E4C000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77E50000 - 0x77EE1000      C:\WINDOWS\system32\RPCRT4.dll
    0x77D10000 - 0x77DA0000      C:\WINDOWS\system32\USER32.dll
    0x77EF0000 - 0x77F37000      C:\WINDOWS\system32\GDI32.dll
    0x77BE0000 - 0x77C38000      C:\WINDOWS\system32\MSVCRT.dll
    0x62DC0000 - 0x62DC9000      C:\WINDOWS\system32\LPK.DLL
    0x753C0000 - 0x7542B000      C:\WINDOWS\system32\USP10.dll
    0x08000000 - 0x08139000      C:\DevSuiteHome_1\jdk\jre\bin\client\jvm.dll
    0x76AE0000 - 0x76B0F000      C:\WINDOWS\system32\WINMM.dll
    0x6BD00000 - 0x6BD0D000      C:\WINDOWS\system32\SYNCOR11.DLL
    0x10000000 - 0x10007000      C:\DevSuiteHome_1\jdk\jre\bin\hpi.dll
    0x00940000 - 0x0094E000      C:\DevSuiteHome_1\jdk\jre\bin\verify.dll
    0x00950000 - 0x00969000      C:\DevSuiteHome_1\jdk\jre\bin\java.dll
    0x00970000 - 0x0097D000      C:\DevSuiteHome_1\jdk\jre\bin\zip.dll
    0x02F60000 - 0x02F6F000      C:\DevSuiteHome_1\BIN\frmjapi.dll
    0x02F70000 - 0x02F8C000      C:\DevSuiteHome_1\bin\frmd2f.dll
    0x663D0000 - 0x66414000      C:\DevSuiteHome_1\bin\CA.dll
    0x66340000 - 0x6636A000      C:\DevSuiteHome_1\bin\mmc.dll
    0x64CA0000 - 0x64CB1000      C:\DevSuiteHome_1\bin\UTL.dll
    0x60730000 - 0x607DC000      C:\DevSuiteHome_1\bin\oracore10.dll
    0x608D0000 - 0x60963000      C:\DevSuiteHome_1\bin\oranls10.dll
    0x62B40000 - 0x62B53000      C:\DevSuiteHome_1\bin\oraunls10.dll
    0x60C40000 - 0x60C47000      C:\DevSuiteHome_1\bin\orauts.dll
    0x719F0000 - 0x71A07000      C:\WINDOWS\system32\WS2_32.dll
    0x719E0000 - 0x719E8000      C:\WINDOWS\system32\WS2HELP.dll
    0x774A0000 - 0x775DD000      C:\WINDOWS\system32\ole32.dll
    0x616B0000 - 0x61891000      C:\DevSuiteHome_1\bin\oraclient10.dll
    0x62B60000 - 0x62B66000      C:\DevSuiteHome_1\bin\oravsn10.dll
    0x60D30000 - 0x60DE8000      C:\DevSuiteHome_1\bin\oracommon10.dll
    0x60300000 - 0x60720000      C:\DevSuiteHome_1\bin\orageneric10.dll
    0x629C0000 - 0x629D2000      C:\DevSuiteHome_1\bin\orasnls10.dll
    0x62B80000 - 0x62C86000      C:\DevSuiteHome_1\bin\oraxml10.dll
    0x02F90000 - 0x02FA1000      C:\WINDOWS\system32\MSVCIRT.dll
    0x607E0000 - 0x608CC000      C:\DevSuiteHome_1\bin\oran10.dll
    0x62000000 - 0x6202C000      C:\DevSuiteHome_1\bin\oranl10.dll
    0x62030000 - 0x62042000      C:\DevSuiteHome_1\bin\oranldap10.dll
    0x62090000 - 0x62184000      C:\DevSuiteHome_1\bin\orannzsbb10.dll
    0x61E10000 - 0x61E52000      C:\DevSuiteHome_1\bin\oraldapclnt10.dll
    0x61F30000 - 0x61F47000      C:\DevSuiteHome_1\bin\orancrypt10.dll
    0x71A10000 - 0x71A1A000      C:\WINDOWS\system32\WSOCK32.dll
    0x76D10000 - 0x76D29000      C:\WINDOWS\system32\iphlpapi.dll
    0x770E0000 - 0x7716C000      C:\WINDOWS\system32\OLEAUT32.dll
    0x621A0000 - 0x621D7000      C:\DevSuiteHome_1\bin\oranro10.dll
    0x621F0000 - 0x621FC000      C:\DevSuiteHome_1\bin\orantcp10.dll
    0x61F70000 - 0x61F76000      C:\DevSuiteHome_1\bin\oranhost10.dll
    0x61F20000 - 0x61F26000      C:\DevSuiteHome_1\bin\orancds10.dll
    0x62210000 - 0x62216000      C:\DevSuiteHome_1\bin\orantns10.dll
    0x60970000 - 0x60C31000      C:\DevSuiteHome_1\bin\orapls10.dll
    0x62500000 - 0x62507000      C:\DevSuiteHome_1\bin\oraslax10.dll
    0x627B0000 - 0x628B3000      C:\DevSuiteHome_1\bin\oraplp10.dll
    0x618B0000 - 0x61905000      C:\DevSuiteHome_1\bin\orahasgen10.dll
    0x622B0000 - 0x622E6000      C:\DevSuiteHome_1\bin\oraocr10.dll
    0x622F0000 - 0x62315000      C:\DevSuiteHome_1\bin\oraocrb10.dll
    0x6FEE0000 - 0x6FF34000      C:\WINDOWS\system32\NETAPI32.dll
    0x76BA0000 - 0x76BAB000      C:\WINDOWS\system32\PSAPI.DLL
    0x62A80000 - 0x62AF6000      C:\DevSuiteHome_1\bin\orasql10.dll
    0x662F0000 - 0x66320000      C:\DevSuiteHome_1\bin\mmi.dll
    0x64F10000 - 0x64F21000      C:\DevSuiteHome_1\bin\UIIM.dll
    0x64CE0000 - 0x64DBD000      C:\DevSuiteHome_1\bin\UIW.dll
    0x64CD0000 - 0x64CD7000      C:\DevSuiteHome_1\bin\UTC.dll
    0x64CC0000 - 0x64CC9000      C:\DevSuiteHome_1\bin\UTJ.dll
    0x72F50000 - 0x72F76000      C:\WINDOWS\system32\WINSPOOL.DRV
    0x58B50000 - 0x58BE7000      C:\WINDOWS\system32\COMCTL32.dll
    0x64ED0000 - 0x64EF6000      C:\DevSuiteHome_1\bin\UIOLE.dll
    0x76340000 - 0x7638A000      C:\WINDOWS\system32\comdlg32.dll
    0x77F40000 - 0x77FB6000      C:\WINDOWS\system32\SHLWAPI.dll
    0x7C9D0000 - 0x7D1F3000      C:\WINDOWS\system32\SHELL32.dll
    0x64AD0000 - 0x64C05000      C:\DevSuiteHome_1\bin\VGS.dll
    0x64E30000 - 0x64E93000      C:\DevSuiteHome_1\bin\UIREM.dll
    0x659A0000 - 0x659EE000      C:\DevSuiteHome_1\bin\ROS.dll
    0x66250000 - 0x6627E000      C:\DevSuiteHome_1\bin\mmw.dll
    0x662A0000 - 0x662B0000      C:\DevSuiteHome_1\bin\mmv.dll
    0x73AA0000 - 0x73AB7000      C:\WINDOWS\system32\AVIFIL32.dll
    0x77BB0000 - 0x77BC5000      C:\WINDOWS\system32\MSACM32.dll
    0x75BA0000 - 0x75BC1000      C:\WINDOWS\system32\MSVFW32.dll
    0x662C0000 - 0x662DF000      C:\DevSuiteHome_1\bin\mms.dll
    0x66810000 - 0x66A2B000      C:\DevSuiteHome_1\bin\DE.dll
    0x627A0000 - 0x627AF000      C:\DevSuiteHome_1\bin\oraplc10.dll
    0x64F50000 - 0x64F66000      C:\DevSuiteHome_1\bin\UICC.dll
    0x64FB0000 - 0x64FDA000      C:\DevSuiteHome_1\bin\UCOL.dll
    0x02FB0000 - 0x030CA000      C:\DevSuiteHome_1\bin\frmcom.dll
    0x66380000 - 0x66389000      C:\DevSuiteHome_1\bin\mma.dll
    0x64FF0000 - 0x65003000      C:\DevSuiteHome_1\bin\UAT.dll
    0x66220000 - 0x6623C000      C:\DevSuiteHome_1\bin\nn.dll
    0x64F70000 - 0x64F94000      C:\DevSuiteHome_1\bin\UIA.dll
    0x64F30000 - 0x64F45000      C:\DevSuiteHome_1\bin\UIDC.dll
    0x030D0000 - 0x03194000      C:\DevSuiteHome_1\bin\frmdig.dll
    0x031A0000 - 0x0324D000      C:\DevSuiteHome_1\bin\frmdug.dll
    0x66210000 - 0x66215000      C:\DevSuiteHome_1\bin\obs.dll
    0x77390000 - 0x77492000      C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
    0x5B090000 - 0x5B0C8000      C:\WINDOWS\system32\uxtheme.dll
    0x74690000 - 0x746DB000      C:\WINDOWS\system32\MSCTF.dll
    0x76BE0000 - 0x76C0E000      C:\WINDOWS\system32\WINTRUST.dll
    0x779E0000 - 0x77A76000      C:\WINDOWS\system32\CRYPT32.dll
    0x77A80000 - 0x77A92000      C:\WINDOWS\system32\MSASN1.dll
    0x76C40000 - 0x76C68000      C:\WINDOWS\system32\IMAGEHLP.dll
    0x72C70000 - 0x72C79000      C:\WINDOWS\system32\wdmaud.drv
    0x72C60000 - 0x72C68000      C:\WINDOWS\system32\msacm32.drv
    0x77BA0000 - 0x77BA7000      C:\WINDOWS\system32\midimap.dll
    0x5D3F0000 - 0x5D491000      C:\WINDOWS\system32\DBGHELP.dll
    0x77BD0000 - 0x77BD8000      C:\WINDOWS\system32\VERSION.dll
    Heap at VM Abort:
    Heap
    def new generation total 576K, used 35K [0x10010000, 0x100b0000, 0x104f0000)
    eden space 512K, 6% used [0x10010000, 0x10017c90, 0x10090000)
    from space 64K, 7% used [0x10090000, 0x10091348, 0x100a0000)
    to space 64K, 0% used [0x100a0000, 0x100a0000, 0x100b0000)
    tenured generation total 1408K, used 122K [0x104f0000, 0x10650000, 0x14010000)
    the space 1408K, 8% used [0x104f0000, 0x1050e930, 0x1050ea00, 0x10650000)
    compacting perm gen total 4096K, used 1642K [0x14010000, 0x14410000, 0x18010000)
    the space 4096K, 40% used [0x14010000, 0x141aaac8, 0x141aac00, 0x14410000)
    Local Time = Wed Apr 12 10:35:49 2006
    Elapsed Time = 5
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode)
    # An error report file has been saved as hs_err_pid3184.log.
    # Please refer to the file for further information.
    Can anyone help me ?
    Message was edited by:
    dbouchier

    We do something very simular. We rename everything to lowercase for the same reasons. I've pasted a snippet of the code we're using at the end of this post.
    To get the full source code of our converter have a look at http://www.oratransplant.nl/2005/05/30/custom-built-forms-migration-assistant/#comment-642
    Here is the code snippet:
    while (attachedLibs.hasNext()) {
    AttachedLibrary attachedLib = (AttachedLibrary)attachedLibs.next();
    String attachedLibLocation = attachedLib.getLibraryLocation();
    out("Found attached library " + attachedLibLocation, logLevel,
    false);
    if (attachedLib.getName().equalsIgnoreCase("obsolete_forms6")) {
    obsoleteAttached = true;
    if (attachedLib.getName().equalsIgnoreCase("webreports")) {
    webReportsAttached = true;
    // converted name of attached lib to lowercase
    if ((!attachedLibLocation.equals(attachedLibLocation.toLowerCase())) &&
    lowerLib) {
    out(attachedLib,
    "Converting filename to lowercase (" + attachedLibLocation.toLowerCase() +
    ")", logLevel + 1, true);
    attachedLibLocation = attachedLibLocation.toLowerCase();
    pllChanged = true;
    // attachedLibLocation = attachedLibLocation.toUpperCase();
    pldText.append(".attach LIBRARY " + attachedLibLocation +
    " END NOCONFIRM\n");
    out("Re-attaching library " + attachedLibLocation, logLevel + 1,
    false);
    }

  • Loading native libraries

    Hi,
    The other day a came across an UnsatisfiedLinkError with the message "... already loaded in another classloader". I saw the JNI specification states a native library is only permitted to be loaded by a single classloader. My question is why is this the case? What if I have two indipendent applications running on the same JVM instance, and both rely on the same native library? the problem with these native libraries is that there is no classloader delegation architecture when loading one(as there is with java classes), the library will always be loaded by the calling classes' classloader. So what can a developer do? What is the idea behind this behavior?
    Any help is appreciated....

    Thanks for your answers,
    The thing is -
    1) I don't really want to load the library again, I
    simply wish there will be no exception if I attempt to
    load it again from a different classloader. After all,
    what does it matter from which classloader i try to
    load the library? If it is the same classloader the
    method will simply return as if it loaded the lib
    succesfully(even though it didn't since it detected
    it's already loaded), why should there be any
    difference if it's not the same classloader? the
    library is already loaded anyway, all classes in the
    JVM instance will have access to it anyway....Write the code so that it checks for the already loaded exception.
    2) What if I one of my applications is a "third party"
    app in which I cannot change the code to load the
    library through my "library loader"?You are probably out of luck.
    Although I would question why you would want a third party library used by mutliple applications to be individually loaded. In J2EE containers the database drivers are loaded outside the class loaders probably for similar reasons.

  • Accessing libraries from java web start

    hi guys,
    I am new to forums and sorry if this question has been posed before. I am trying to access jogl.dll and jogl_cg.dll through java web start. These libraries are getting downloaded on the client machine as a jar file. I am using the following commands to access these files
    System.loadLibrary("jogl");
    System.loadLibrary("jogl_cg");
    Its giving me the follwing error
    Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\java\tools\jogl_cg.dll: Can't find dependent libraries
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
    at java.lang.Runtime.loadLibrary0(Runtime.java:822)
    at java.lang.System.loadLibrary(System.java:992)
    at testlib.Main.main(Main.java:35)
    Java Result: 1
    I am getting unsatisfied link error as its searching for another library which jogl_cg.dll depends upon. Can anybody suggest me what other library do i need to attach and the way i am accessing the libraries using system.loadlibrary is correct or not
    I would appreciate your help in this regard.
    Thanks in advance,
    ravi ananthuni.

    Actually you're correct. There was a resource missing.
    The error was in the way I was packaging mail.jar. This archive has resources located in the META-INF subfolder inside the jar file. I'm running on Windows 2000, and I was expanding the mail.jar file, and then recreating and signing the archive using the Netscape utility signtool with the -Z option:
    signtool -k <mycert> -d <keystore_path> -Z mail.jar <expanded JAR directory>.
    When creating the JAR file, the META-INF folder is deleted and replaced with the META-INF entries for the JAR you've just created. The other resources packaged in the META-INF are overwritten, and so the signed mail.jar did not work properly -- hence the NoSuchProvider exception.
    For reference the solution is to sign the directory without creating the jar file:
    signtool -k <mycert> -d <keystore_path> <expanded JAR directory>
    and then create the jar file from the signed directory using another archiving utility. I used the command line interface for Winzip 8.0.
    cd <expanded JAR directory>
    wzzip -rp ..\mail.jar *
    http://developer.netscape.com/docs/manuals/cms/41/adm_gide/app_sign.htm#1012833
    Thanks!
    -- Eric.
    Hi,
    you suppose that the .jar files are not signed
    correctly,
    but what should have gone wrong?
    You can check that each .jar is correctly signed with
    the jarsigner tool:
    jarsigner -verify -verbose foo.jar
    If all your jars are reported to be signed, the only
    other error I can imagine regarding signing is the
    "all .jars referenced by one .jnlp must be signed
    by the same key" rule. (Read Section 5.4 of the
    jnlp 1.0.1 spec).
    javax.mail.NoSuchProviderException: No provider for
    Address type: rfc822
    files to be listed as resources, Java Web Startfails
    to launch my application (unsigned application
    requesting unrestricted access to system).I would have expected the latter error, if you
    have a signing problem.
    That first error looks like something different,
    perhaps the app is looking for a resource that
    defines rfc822 behaviour.
    Regards,
    Marc

  • Wls 6.1 on solaris 8 intel: native libraries missing (libmuxer.so ...)

    It seems that the native libraries for sparc only are included in WLS 6.1???
    #file libmuxer.so
    libmuxer.so: ELF 32-bit MSB dynamic lib SPARC Version 1, dynamically linked,
    not stripped
    Where can I get the intel version?
    # ./startWebLogic.sh
    LD_LIBRARY_PATH=/usr2/bea/wlserver6.1/lib/solaris:/usr2/bea/wlserver6.1/lib/solaris/oci816_8
    * To start WebLogic Server, use the password *
    * assigned to the system user. The system *
    * username and password must also be used to *
    * access the WebLogic Server console from a web *
    * browser. *
    Starting WebLogic Server ....
    <Jan 18, 2002 9:57:11 AM CET> <Notice> <Management> <Loading configuration file
    ./config/helsana/config.xml ...>
    <Jan 18, 2002 9:57:17 AM CET> <Notice> <WebLogicServer> <Starting WebLogic Admin
    Server "sunetweb"
    for domain "helsana">
    <Jan 18, 2002 9:57:22 AM CET> <Notice> <Management> <Starting discovery of Managed
    Server... This feature is on by default, you may turn this off by passing -Dweblogic.management.discover=false>
    <Jan 18, 2002 9:57:28 AM CET> <Notice> <Management> <Application Poller not started
    for production
    server.>
    <Jan 18, 2002 9:57:28 AM CET> <Notice> <WebLogicServer> <ListenThread listening
    on port 80>
    <Jan 18, 2002 9:57:28 AM CET> <Error> <Performance Pack> <Unable to load performance
    pack, using Java I/O instead.
    Please ensure that libmuxer library is in /usr/j2sdk1_3_1_02/jre/bin/../lib/i386/hotspot:/usr/j2sdk1_3_1_02/jre/bin/../lib/i386::/usr2/bea/wlserver6.1/lib/solaris:/usr2/bea/wlserver6.1/lib/solaris/oci816_8:/usr/lib
    java.lang.UnsatisfiedLinkError: /usr2/bea/wlserver6.1/lib/solaris/libmuxer.so:
    ld.so.1: /usr/j2sdk1_3_1_02/jre/bin/../bin/i386/native_threads/java: fatal: /usr2/bea/wlserver6.1/lib/solaris/libmuxer.so:
    wrong ELF data format: ELFDATA2MSB
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1419)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1343)
    at java.lang.Runtime.loadLibrary0(Runtime.java:749)
    at java.lang.System.loadLibrary(System.java:820)
    at weblogic.socket.PosixSocketMuxer.<init>(PosixSocketMuxer.java:90)
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:237)
    at weblogic.socket.SocketMuxer.makeTheMuxer(SocketMuxer.java:192)
    at weblogic.socket.SocketMuxer.getMuxer(SocketMuxer.java:144)
    at weblogic.t3.srvr.ListenThread.run(ListenThread.java:232)
    >
    <Jan 18, 2002 9:57:28 AM CET> <Notice> <WebLogicServer> <SSLListenThread listening
    on port 443>

    Hi.
    We only support Solaris on Sparc platforms, so there are no intel libs for Solaris 8.
    Regards,
    Michael
    Dominik wrote:
    It seems that the native libraries for sparc only are included in WLS 6.1???
    #file libmuxer.so
    libmuxer.so: ELF 32-bit MSB dynamic lib SPARC Version 1, dynamically linked,
    not stripped
    Where can I get the intel version?
    # ./startWebLogic.sh
    LD_LIBRARY_PATH=/usr2/bea/wlserver6.1/lib/solaris:/usr2/bea/wlserver6.1/lib/solaris/oci816_8
    * To start WebLogic Server, use the password *
    * assigned to the system user. The system *
    * username and password must also be used to *
    * access the WebLogic Server console from a web *
    * browser. *
    Starting WebLogic Server ....
    <Jan 18, 2002 9:57:11 AM CET> <Notice> <Management> <Loading configuration file
    /config/helsana/config.xml ...>
    <Jan 18, 2002 9:57:17 AM CET> <Notice> <WebLogicServer> <Starting WebLogic Admin
    Server "sunetweb"
    for domain "helsana">
    <Jan 18, 2002 9:57:22 AM CET> <Notice> <Management> <Starting discovery of Managed
    Server... This feature is on by default, you may turn this off by passing -Dweblogic.management.discover=false>
    <Jan 18, 2002 9:57:28 AM CET> <Notice> <Management> <Application Poller not started
    for production
    server.>
    <Jan 18, 2002 9:57:28 AM CET> <Notice> <WebLogicServer> <ListenThread listening
    on port 80>
    <Jan 18, 2002 9:57:28 AM CET> <Error> <Performance Pack> <Unable to load performance
    pack, using Java I/O instead.
    Please ensure that libmuxer library is in /usr/j2sdk1_3_1_02/jre/bin/../lib/i386/hotspot:/usr/j2sdk1_3_1_02/jre/bin/../lib/i386::/usr2/bea/wlserver6.1/lib/solaris:/usr2/bea/wlserver6.1/lib/solaris/oci816_8:/usr/lib
    java.lang.UnsatisfiedLinkError: /usr2/bea/wlserver6.1/lib/solaris/libmuxer.so:
    ld.so.1: /usr/j2sdk1_3_1_02/jre/bin/../bin/i386/native_threads/java: fatal: /usr2/bea/wlserver6.1/lib/solaris/libmuxer.so:
    wrong ELF data format: ELFDATA2MSB
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1419)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1343)
    at java.lang.Runtime.loadLibrary0(Runtime.java:749)
    at java.lang.System.loadLibrary(System.java:820)
    at weblogic.socket.PosixSocketMuxer.<init>(PosixSocketMuxer.java:90)
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:237)
    at weblogic.socket.SocketMuxer.makeTheMuxer(SocketMuxer.java:192)
    at weblogic.socket.SocketMuxer.getMuxer(SocketMuxer.java:144)
    at weblogic.t3.srvr.ListenThread.run(ListenThread.java:232)
    >
    <Jan 18, 2002 9:57:28 AM CET> <Notice> <WebLogicServer> <SSLListenThread listening
    on port 443>--
    Michael Young
    Developer Relations Engineer
    BEA Support

  • How to unload a dll in java

    After loading the native library through System.loadLibrary , we were unable to unload the dll , i have tried entering the Registry Values of current windows version creating key alwaysunloaddll to 1 and also through c/c++ Wrapper Classes Using JNI but nothing worked out As the Dll is loaded in to the memory ,So Please Let Me know if there is any other way to Unload the Library in java? it is an Urgent Requirement so any comments and suggestions are appreciated ,Thanks in advance

    Thanks a lot,i really appreciate of taking time to answer my questions ,but im afraid that i have already used System.gc but i was unable to unload the library , But i think custom class loaders is only ray of hope so ,can anybody send me a code to unload the native library ,coz im a laymen to the concept of class loaders, or please do let me know if there is any alternate way of unloading the library Afterall there is a solution for every problem Right!Thanks once again ............

  • Problem in loading Native libraries

    While trying to load native libraries I'm getting the following error message
    java.lang.UnsatisfiedLinkError: /XXX/XXX/libMySharedObj.so: ld.so.1: <JAVA_HOME>/bin/sparcv9/java: fatal: libskgxp10.so: open failed: No such file or directory
    At which place the 'libskgxp10.so' file should present and from where I can get a copy of the same?
    I'm using webLogic 8.15 on a solaris(5.8) box. The JVM has been started in 64bit mode with the options JAVA_VM="-server" and JAVA_OPTIONS="-d64" in the 'startWebLogic.sh' script.
    Any idea to fix this issue?

    Suspecting the same, I've tried to run the application in the same machine where the shared object has been created.
    This time I got the error message as
    java.lang.UnsatisfiedLinkError: /XXX/XXX/libMySharedObj.so: ld.so.1: <JAVA_HOME>/bin/java: fatal: /XXX/XXX/libMySharedObj.so: wrong ELF class: ELFCLASS64.
    I have created the native library 'libMySharedObj.so' by the following way
    gcc -c xxx.c
    gcc -c yyy.c
    gcc -c zzz.c
    ld -G xxx.o yyy.o zzz.o -o libMySharedObj.so -lm -lc -lpthreadPlease advice if I'm taking the wrong track somewhere or with any alternative approach.

  • Defining Native Libraries? (Unsatisifed link error)

    I am testing an application that we previously had working on 10g release 2 (as well as Tomcat and WebLogic, all on Windows). At the moment my application can't find a couple of native libraries, which should be easy enough to fix. Just set the java.library.path.
    My problem is that I can't find anywhere in the Oracle 10g administration to specify the locations of the libraries or set the java.library.path that is used. How is this done?
    I added the location to the PATH environment variable (which 10g seems to ignore) and I have tried following the docs at http://download-west.oracle.com/docs/cd/B14099_12/core.1012/b13996/oc4j.htm#sthref394 (although I realise this is for release 2 and not release 3) without success.
    I've search the forums and this seems to be an oft asked question. Does anyone know how to do it, or can point me at the documentation?
    Cheers

    Thanks Maro, but I have already tried that without success I am afraid. I had added the following:
    <environment>
    <variable id="LD_LIBRARY_PATH" value="C:\Program Files\Documentum\Shared" append="true" />
    </environment>
    I still get "java.lang.UnsatisfiedLinkError: no dmcl40 in java.library.path"
    And, indeed, when I look that the java.library.path all I have is
    C:\product\10.1.3\OracleAS_1\jdk\bin;.;C:\WINDOWS\system32;C:\WINDOWS;
    C:\product\10.1.3\OracleAS_1\opmn\bin;C:\product\10.1.3\OracleAS_1\opmn\lib;
    C:\product\10.1.3\OracleAS_1\bin;C:\WINDOWS;C:\WINDOWS\system32
    The folder C:\Program Files\Documentum\Shared is also in my PATH environment varibale (which Oracle is ignoring for some reason).
    This is really frustrating. :o(

  • Native Libraries

    What is the effect of loading native libraries into a WLS instance? Is this
    forbidden/frowned upon/ok ?
    One effect we have seen is that may be related is that if a native library
    is not properly unloaded - either via WLS crash or just poor programming,
    restarting the WLS instance is not possible as it belives that the port is
    still in use (by another process) What is the relationship here?
    thanks,
    g

    Loading native libraries is not recommended, however, not forbidden.
    Writing a stable native code is not easy, if your native code screws up
    (such as memory leak), in most cases, weblogic will screw up too.
    For restarting, if you restart weblogic, weblogic can use its port. Once
    weblogic is killed, OS will release its port for reuse.
    My 2 cents.
    Cheers - Wei
    Garrick Evans <[email protected]> wrote in message
    news:8itojp$b0j$[email protected]..
    What is the effect of loading native libraries into a WLS instance? Isthis
    forbidden/frowned upon/ok ?
    One effect we have seen is that may be related is that if a native library
    is not properly unloaded - either via WLS crash or just poor programming,
    restarting the WLS instance is not possible as it belives that the port is
    still in use (by another process) What is the relationship here?
    thanks,
    g

Maybe you are looking for

  • How do you get iWeb to look at a different folder?

    I have two versions of my site (one slightly more updated than the other) on my hd, and want to point iweb to the newer one. I know how to point iweb to where it will be pulishing TO, as in godaddy, or my dropbox or whatever. But how do I change the

  • Javascripts – check boxes not returning proper values

    Hi All, not sure if this is the right place for this post... but here goes.... here's the url: http://theexperience-exchange.co.uk/Mods_appleit.html The contact form generates and e-mail.  At the moment the results form the checkboxes look like this:

  • Help - I cannot add files to my playlist.

    I am using iTunes 7 and I cannot drag .mp3 files into my playlist nor can I import them via the file menu. When I drag and drop or add manually nothing happens at all. I have checked and double checked the file types. They are all .mp3 and they all d

  • Happy Birthday Keanu!

    I don't have any birthday photos since I haven't celebrated it in years but I just watched the Matrix again and I hope this is acceptable-. Good luck everyone! 

  • Creation ofcondition records

    Dear all, What is the difference in creating condition records in COB1 with respect to MBC1, usually we use COB1 when we want the batch determination to take place in process order and we use MBC1 if we want to have batch determination during goods i