Jni library loaded by System.load fails on later call to System.loadLibrary

I'm attempting to use jnotify to listen for directory modifications. This requires using jni to dynamically link to a c library. I have gotten everything to work successfully if I put the library on the java.library.path. However, I would prefer to let my application specify the full path to the jnotify library. My understanding is that I should be able to do a System.load("/foo/libjnotify.so") in a static block and then subsequent calls to System.loadLibrary("jnotify") should do nothing as the library is already loaded. However I am getting a 'Exception in thread "main" java.lang.UnsatisfiedLinkError: no jnotify in java.library.path'. Am I misunderstanding the correct usage of these System calls?

Joe wrote:
That makes sense.
The System.loadLibrary portion is in a 3rd party library which I am legally not allowed to change.
Are there any other possible ways to accomplish the loading without the library being on the java.library.path?
You have two problems - not one.
The library itself is calling loadLibrary(). The standard idiom is that one does that in a static block. If a static block throws an exception, any exception, then the class will not load.
Presumably the library is not checking for a duplicate library load. So your problem is that that loadLibrary() call must not throw an exception.
Thus you cannot preload the library.
Far as I can see you have the following options.
- Put it on the path.
- Create a jave exec handler (via Runtime.exec or jni), put the library on that path before you start another VM which does the real work.
- Modify the java API loadLibrary() call so it catches the dup exception, that of course requires a boot option.

Similar Messages

  • How to Load 2 library files using System.loadLibrary in one .java file!!!

    Hello,
    Someone please help me. What I am trying to do is load two .DLL files in my program. Program works fine when I
    do the following way i.e. I have two .java files and in each I am loading one .DLL file. But I don't want to have
    two .java files I want to load both the .DLL files in one program.
    **************** Example.java **********
    import java.io.*;
    import java.util.*;
    public class Example
    public native int A(String in);
    static
    System.loadLibrary( "API2" );
    public static void main( String args[])
         Ex ex = new Ex();
         int r;
         r = ex.A("TEST");
    public Example()
    *****************Ex.java*****************
    public class exsysml
    public native int A(String in);
    public exsysml()
    System.loadLibrary("API3");
    The above way works. But I need only one .java file to load both the .DLL files. i.e.
    import java.io.*;
    import java.util.*;
    public class Example
    public native int A(String in);
    static
    System.loadLibrary( "API2" );
    System.loadLibrary( "API3" );     
    public static void main( String args[])
         Example ex = new Example();
         int r;
         r = ex.A("TEST");
    public Example()
    but when I do this way it doesn't work and I get a UnSatisfiedLinkage Error at ex.A("TEST"). While doing the top way it works.
    How can I fix this to just have one .java file and load both the library files as done in the bottom program but doing this program doesn't work. Any help is appreciated.
    Thanks!

    what I figured out so far is that we can only load one library file in a single class and define all the native methods present in that library in the class where we are loading it. Means we can't load multiple library files in a single class. It's just my thought else if someone provides a better solution. I may be wrong so that's why I need your help.
    Thanks

  • Getting a load failed try later message on ATV

    Trying to AirPlay a movie from HBO GO to my tv. Get an error message that says load failed try again later.  Any ideas how to resolve?

    The movie shows the AirPlay icon and turns blue when selected.  Tried again and got audio only but still no video. This was aftervpowering the apple box off and back on.

  • Compilation and System.loadLibrary

    Hi everybody,
    I'm pretty sure this will be the last time I talk about System.loadLibrary issues. This is definitely just a concept question, no code or JNI needed.
    I have a call to System.load library like this:
    System.loadLibrary( "Class" );
    and then directly after that, a I call a constructor for the class:
    Class c = new Class( params );
    The problem is, though, that the code won't compile. I know the constructor is right, and I've looked at the System.loadLibrary documentation, and I can't figure out what the problem is. I know System.loadLibrary is a runtime event, and I'm using Eclipse, if that makes any difference.
    So, I guess here comes the question finally. How can I make the compiler realize that the class I'm loading with System.loadLibrary is legitimate, so it doesn't give me a compiler error?
    Thanks,
    Jezzica85

    jezzica85 wrote:
    Oh, I'm sorry. That was just a general example, and yes, "Class" was just a fill-in for what I actually named the class, and "params" a fill-in for the parameters. I figured the specifics weren't important. I guess I should have made that example clearer.
    Jezzica85I just wanted to make sure.
    So, you have a class called whatever you have there in your classpath, and you've verified that it has a public constructor with the same parameters that you have given it? If both those statements are true then I don't see how you can have a compiler error involving the ctor - please post a copy and paste of the exact compiler error message.

  • Error in SAPGUI-on AIX- Can't load JNI library

    Error in SAPGUI-on AIX- Can't load JNI library
    I am getting error as below:
    ^C# ./sapgui /H/punlparidm06 /S/sapdbIND
    ERROR #############################
    07.03. 12:48:37.619 ERROR: Attempt to load shared library /local/SAPClients/SAPGUI7.00rev2.1/bin/libJPlatin.so failed.
    07.03. 12:48:37.619 ERROR: The library file exists, so either the program
    07.03. 12:48:37.619 ERROR: don't has the privileges to access the library
    07.03. 12:48:37.619 ERROR: or the library is not loadable by the shared object loader
    07.03. 12:48:37.619 ERROR: Technical information:
    07.03. 12:48:37.619 ERROR: Error location: GuiJniLoader.loadPlatinLibrary()
    07.03. 12:48:37.619 ERROR: Error message : /local/SAPClients/SAPGUI7.00rev2.1/bin/libJPlatin.so: load ENOEXEC on shared library(s) /local/SAPClients/SAPGUI7.00rev2.1/bin/libJPlatin.so
    ERROR #############################
    java.lang.UnsatisfiedLinkError: /local/SAPClients/SAPGUI7.00rev2.1/bin/libJPlatin.so: load ENOEXEC on shared library(s) /local/SAPClients/SAPGUI7.00rev2.1/bin/libJPlatin.so
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2144)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1973)
    at java.lang.Runtime.load0(Runtime.java:773)
    at java.lang.System.load(System.java:887)
    at com.sap.platin.r3.util.GuiJniLoader.loadPlatinLibrary(GuiJniLoader.java:114)
    at com.sap.platin.r3.protocol.diag.JniAgiLibAdaptor.<init>(JniAgiLibAdaptor.java:24)
    at com.sap.platin.r3.protocol.diag.GuiDiagToAutomationParser.configure(GuiDiagToAutomationParser.java:289)
    at com.sap.platin.base.connection.GuiConnection.open(GuiConnection.java:316)
    at com.sap.platin.base.application.GuiApplication.createConnection(GuiApplication.java:860)
    at com.sap.platin.base.logon.GuiImpl.evalCommandLine(GuiImpl.java:275)
    at com.sap.platin.base.logon.GuiImpl.<init>(GuiImpl.java:44)
    at com.sap.platin.base.logon.GuiImpl.main(GuiImpl.java:447)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
    at java.lang.reflect.Method.invoke(Method.java:391)
    at com.sap.platin.micro.Microkernel.invokeMainMethod(Microkernel.java:1670)
    at com.sap.platin.micro.Microkernel.startApplication(Microkernel.java:1750)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
    at java.lang.reflect.Method.invoke(Method.java:391)
    at com.sap.platin.Gui.main(Gui.java:65)
    java.lang.Exception: JniAgiLibAdaptor.<init>: Cannot load JNI library
    at com.sap.platin.r3.protocol.diag.JniAgiLibAdaptor.<init>(JniAgiLibAdaptor.java:25)
    at com.sap.platin.r3.protocol.diag.GuiDiagToAutomationParser.configure(GuiDiagToAutomationParser.java:289)
    at com.sap.platin.base.connection.GuiConnection.open(GuiConnection.java:316)
    at com.sap.platin.base.application.GuiApplication.createConnection(GuiApplication.java:860)
    at com.sap.platin.base.logon.GuiImpl.evalCommandLine(GuiImpl.java:275)
    at com.sap.platin.base.logon.GuiImpl.<init>(GuiImpl.java:44)
    at com.sap.platin.base.logon.GuiImpl.main(GuiImpl.java:447)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
    at java.lang.reflect.Method.invoke(Method.java:391)
    at com.sap.platin.micro.Microkernel.invokeMainMethod(Microkernel.java:1670)
    at com.sap.platin.micro.Microkernel.startApplication(Microkernel.java:1750)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
    at java.lang.reflect.Method.invoke(Method.java:391)
    at com.sap.platin.Gui.main(Gui.java:65)
    ERROR #############################
    07.03. 12:51:52.173 ERROR: GuiConnection: Connect failed
    07.03. 12:51:52.173 ERROR: JniAgiLibAdaptor.<init>: Cannot load JNI library
    ERROR #############################

    Hi,
    It seems to be a permission issue.
    Just check the permissions and grant 755 using chmod comand.
    Hope it helps.
    Reward suitable points!!!!!

  • Solaris java sapgui error JniAgiLibAdaptor. init : Cannot load JNI library

    i have a problem java sapgui.
    Launch the Sapgui and then try to connect to any one of the three choices and it should produce the following error.
    i am running this on a Solaris 10 32bit. This sam java SAPGUI runs fine when i boot into the windows xp pro. Hope this helps.
    gui version;
    SAPGUI for Java 7.10 rev 8 (java),
    no library (lib)
    (Version ID 071000040800)
    Mon Mar 30 10:34:24 MEST 2009
    uw1059, 710_REL, 1054563
    Java VM: Sun Microsystems Inc. Version 1.6.0_14
    OS: SunOS(x86) Version 5.10
    The version of Java being used is:
    java -version
    java version "1.5.0_16"
    Java(TM) Platform, Standard Edition for Business (build 1.5.0_16-b02)
    Java HotSpot(TM) Client VM (build 1.5.0_16-b02, mixed mode, sharing)
    Thank You,
    Ferhan
    JniAgiLibAdaptor.<init>: Cannot load JNI library
    details;
    java.lang.Exception: JniAgiLibAdaptor.<init>: Cannot load JNI library
    at: com.sap.platin.r3.protocol.diag.JniAgiLibAdaptor.<init>(JniAgiLibAdaptor.java:29)
    at: com.sap.platin.r3.protocol.diag.GuiDiagToAutomationParser.configure(GuiDiagToAutomationParser.java:283)
    at: com.sap.platin.base.connection.GuiConnection.open(GuiConnection.java:297)
    at: com.sap.platin.base.application.GuiApplication.createConnection(GuiApplication.java:798)
    at: com.sap.platin.base.logon.GuiLogonFrame.doConnect(GuiLogonFrame.java:838)
    at: com.sap.platin.base.logon.GuiLogonFrame$SymListener.actionPerformed(GuiLogonFrame.java:443)
    at: javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at: javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at: javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at: javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at: javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at: java.awt.Component.processMouseEvent(Unknown Source)
    at: javax.swing.JComponent.processMouseEvent(Unknown Source)
    at: java.awt.Component.processEvent(Unknown Source)
    at: java.awt.Container.processEvent(Unknown Source)
    at: java.awt.Component.dispatchEventImpl(Unknown Source)
    at: java.awt.Container.dispatchEventImpl(Unknown Source)
    at: java.awt.Component.dispatchEvent(Unknown Source)
    at: java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at: java.awt.LightweightDispatcher.proc
    Attempt to load shared library
    /opt/SAPClients/SAPGUI7.10rev8/bin/libJPlatin.so failed.
    The library file exists, so either the program has
    insufficient privileges to access the library or the library
    is not loadable by the shared object loader.
    Please recheck the system requirements for your operating
    system and make sure all required libraries are installed.
    details;
    ava.lang.UnsatisfiedLinkError: /opt/SAPClients/SAPGUI7.10rev8/bin/libJPlatin.so: ld.so.1: java: fatal: /opt/SAPClients/SAPGUI7.10rev8/bin/libJPlatin.so: wrong ELF data format: ELFDATA2MSB (Possible cause: endianness mismatch)
    at: java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at: java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at: java.lang.ClassLoader.loadLibrary(Unknown Source)
    at: java.lang.Runtime.load0(Unknown Source)
    at: java.lang.System.load(Unknown Source)
    at: com.sap.platin.r3.util.GuiJniLoader.loadPlatinLibrary(GuiJniLoader.java:56)
    at: com.sap.platin.r3.protocol.diag.JniAgiLibAdaptor.<init>(JniAgiLibAdaptor.java:27)
    at: com.sap.platin.r3.protocol.diag.GuiDiagToAutomationParser.configure(GuiDiagToAutomationParser.java:283)
    at: com.sap.platin.base.connection.GuiConnection.open(GuiConnection.java:297)
    at: com.sap.platin.base.application.GuiApplication.createConnection(GuiApplication.java:798)
    at: com.sap.platin.base.logon.GuiLogonFrame.doConnect(GuiLogonFrame.java:838)
    at: com.sap.platin.base.logon.GuiLogonFrame$SymListener.actionPerformed(GuiLogonFrame.java:443)
    at: javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at: javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at: javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at: javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at: javax.swing.plaf.basic.BasicB

    Hello Ferhan,
    the output of the AboutBox is indicating that you are trying to run SAP GUI for Java on Solaris 10 with x86 CPU. Unfortunately, the library required to be loaded is complied for SPARC. Please have a look at the system requirements part of the manual coming with the installer of SAP GUI for Java or [note 959236|https://service.sap.com/sap/support/notes/959236].
    Best regards
    Rolf-Martin

  • Error: Can't load libJPlatin.so -(JNI Library)in SAP GUI  for java 7.0 -AIX

    Hi,
    I am getting error in SAP GUI  for java 7.0 -AIX
    <b>Error: Can't load libJPlatin.so -(JNI Library)</b>
    I ran command as
    <b>./guistart /H/localhost/S/sapdbIND</b>
    I gave 777 permission to corressponding library.

    It's on AIX.
    <b>I am getting error as below:</b>
    ^C# ./sapgui /H/punlparidm06 /S/sapdbIND
    ERROR #############################
    07.03. 12:48:37.619 ERROR: Attempt to load shared library /local/SAPClients/SAPGUI7.00rev2.1/bin/libJPlatin.so failed.
    07.03. 12:48:37.619 ERROR: The library file exists, so either the program
    07.03. 12:48:37.619 ERROR: don't has the privileges to access the library
    07.03. 12:48:37.619 ERROR: or the library is not loadable by the shared object loader
    07.03. 12:48:37.619 ERROR: Technical information:
    07.03. 12:48:37.619 ERROR: Error location: GuiJniLoader.loadPlatinLibrary()
    07.03. 12:48:37.619 ERROR: Error message : /local/SAPClients/SAPGUI7.00rev2.1/bin/libJPlatin.so:  load ENOEXEC on shared library(s) /local/SAPClients/SAPGUI7.00rev2.1/bin/libJPlatin.so
    ERROR #############################
    java.lang.UnsatisfiedLinkError: /local/SAPClients/SAPGUI7.00rev2.1/bin/libJPlatin.so:  load ENOEXEC on shared library(s) /local/SAPClients/SAPGUI7.00rev2.1/bin/libJPlatin.so
            at java.lang.ClassLoader$NativeLibrary.load(Native Method)
            at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2144)
            at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1973)
            at java.lang.Runtime.load0(Runtime.java:773)
            at java.lang.System.load(System.java:887)
            at com.sap.platin.r3.util.GuiJniLoader.loadPlatinLibrary(GuiJniLoader.java:114)
            at com.sap.platin.r3.protocol.diag.JniAgiLibAdaptor.<init>(JniAgiLibAdaptor.java:24)
            at com.sap.platin.r3.protocol.diag.GuiDiagToAutomationParser.configure(GuiDiagToAutomationParser.java:289)
            at com.sap.platin.base.connection.GuiConnection.open(GuiConnection.java:316)
            at com.sap.platin.base.application.GuiApplication.createConnection(GuiApplication.java:860)
            at com.sap.platin.base.logon.GuiImpl.evalCommandLine(GuiImpl.java:275)
            at com.sap.platin.base.logon.GuiImpl.<init>(GuiImpl.java:44)
            at com.sap.platin.base.logon.GuiImpl.main(GuiImpl.java:447)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
            at java.lang.reflect.Method.invoke(Method.java:391)
            at com.sap.platin.micro.Microkernel.invokeMainMethod(Microkernel.java:1670)
            at com.sap.platin.micro.Microkernel.startApplication(Microkernel.java:1750)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
            at java.lang.reflect.Method.invoke(Method.java:391)
            at com.sap.platin.Gui.main(Gui.java:65)
    java.lang.Exception: JniAgiLibAdaptor.<init>: Cannot load JNI library
            at com.sap.platin.r3.protocol.diag.JniAgiLibAdaptor.<init>(JniAgiLibAdaptor.java:25)
            at com.sap.platin.r3.protocol.diag.GuiDiagToAutomationParser.configure(GuiDiagToAutomationParser.java:289)
            at com.sap.platin.base.connection.GuiConnection.open(GuiConnection.java:316)
            at com.sap.platin.base.application.GuiApplication.createConnection(GuiApplication.java:860)
            at com.sap.platin.base.logon.GuiImpl.evalCommandLine(GuiImpl.java:275)
            at com.sap.platin.base.logon.GuiImpl.<init>(GuiImpl.java:44)
            at com.sap.platin.base.logon.GuiImpl.main(GuiImpl.java:447)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
            at java.lang.reflect.Method.invoke(Method.java:391)
            at com.sap.platin.micro.Microkernel.invokeMainMethod(Microkernel.java:1670)
            at com.sap.platin.micro.Microkernel.startApplication(Microkernel.java:1750)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
            at java.lang.reflect.Method.invoke(Method.java:391)
            at com.sap.platin.Gui.main(Gui.java:65)
    ERROR #############################
    07.03. 12:51:52.173 ERROR: GuiConnection: Connect failed
    07.03. 12:51:52.173 ERROR: JniAgiLibAdaptor.<init>: Cannot load JNI library
    ERROR #############################

  • Verify installation of MS C Runtime Library - Cannot load JNI library

    Hello,
    I´am working on a MS XP frontend on customer side and have no admin rights, installed is  SAPGUI for Java 7.10rev4 with sun java version 1.5.0_11
    The admin from the customer told me that he had completly installed the MS C Runtime Library VS2005 SP1, file vcredist_x86.msi.
    However, if I try to use the JAVA Gui I found in the trace file the following error:
    29.07. 10:25:16.039 CON: new GuiNiNetConnection
    0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1. ERROR #############################
    29.07. 10:25:16.055 ERROR: GuiConnection: Connection failed
    29.07. 10:25:16.055 ERROR: JniAgiLibAdaptor.: Cannot load JNI library
    0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1. ERROR #############################
    0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2. ERROR #############################
    29.07. 10:25:16.055 ERROR: JniAgiLibAdaptor.: Cannot load JNI library
    29.07. 10:25:16.055 ERROR: Technical Details
    29.07. 10:25:16.055 ERROR: java.lang.Exception: JniAgiLibAdaptor.: Cannot load JNI library
    29.07. 10:25:16.055 ERROR: at: com.sap.platin.r3.protocol.diag.JniAgiLibAdaptor.<init
    In an old posted message I found the information that the reason should be that the MS C Runtime Library is not installed.
    - Is there a simple way to check if the vcredist_x86.msi is installed in a correct and completed way?
    - Any other ideas about the error "Cannot load JNI library" on a windows XP system?
    Thanks in advance,
    Stefan

    Hi szgyurka!
    I have an article here that can help you troubleshoot this issue with your iTunes application:
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/ts1717
    Take care, and thanks for visiting the Apple Support Communities.
    Cheers,
    Braden

  • Loading JNI library on Tomcat startup

    I am trying to load a JNI library on startup of servlet. I have written the following code in my servlet init function:
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    log.info("Loading native libraries...");
    System.loadLibrary("foo");
    log.info("Native libraries loaded...");
    On Tomcat startup, I see the "Loading native libraries..." message, but I don't see the "Native libraries loaded...". As if the system hung in the System.loadLibrary function.
    Anybody knows how to solve this problem?
    Martin

    The specification specifically forbids the use of native libraries in container objects. So you might want to take that into consideration with whatever you are doing.
    If you do want to do that then I would suggest loading it outside of the container. There is probably some configuration option that allows you to force tomcat to load something on start up.
    You might also want to consider if hot deploys are part of your future. If they are then you might want to put the interface inside of your own custom class loader, so you can probably control the unload of the shared library.
    If you search the J2EE lists you will find that almost everyone states that JNI should not even be loaded into the server. Instead you should create a seperate application and use RMI to access it. Myself I think that is overkill, but I would probably consider exactly what I am interfacing to before making that final decision. If your JNI library blows up it will take down the entire server (which is why the spec forbids it.)

  • SRW248G4P - (!)Loader Binary checksum error - ERR Runtime Loading Fail - System Halt.

    We have this 48 port switch in our engineering department, and it basically stopped passing network traffic.
    When connecting to the Console port and power cycling the switch, this is what I see:
    Image Loader 1.0.1
    Loading Diagnostic Image File : SRW224G4P_SRW248G4P_boot.bix
    Diagnostic 1.0.1
    User Mode
    --- Performing Power-On Self Tests (POST) ---
    DUMMY Test 1 ................. PASS
    UART Loopback Test ........... PASS
    POE UART Loopback Test ....... PASS
    DRAM Test .................... PASS
    Timer Test ................... PASS
    Done All Pass.
    ------------------ DONE ---------------------
    (!)Loader Binary checksum error
    <ERR> Runtime Loading Fail - System Halt.
    This error obviously doesn't look "normal".
    When pressing CTRL-U, I get the following screen:
    File Name                         S/Up Type Size       Create Time
    $logfile_1                          0    3         64  1193046:28:15
    Factory_Default_Config.cfg          0    5        354  24:01:02
    SRW224G4P_SRW248G4P_boot.bix        1    1    1377600  00:01:03
    certificate                         0    8      18040  24:00:56
    startup-config                      1    5       5651  25:00:38
    startup1.cfg                        0    5       5537  24:01:14
    Free Space : 5636096
    [X]modem Download  [D]elete File  [S]et Startup File
    [Q]uit
    Select>
    I've tried to update the "SRW224G4P_SRW248G4P_image_v1310.bix" file using Xmodem download, but since I really wasn't sure how to use this boot loader tool, I haven't been successful at doing that, nor do I even know if that's the solution for the problem that I'm having.
    Xmodem Receiving Start ::
    XMODEM, Successful.
    Blocks Received = 7289
    Bytes Received = 394480
    Errors:
            Checksum   = 0
            Complement = 0
            Duplicates = 0
    Image downloaded to buffer.
            [R]untime
            [D]iagnostic
            M[u]ltipe Image
            [L]oader (Warning: Are you sure what you are doing?)
            [Q]uit
    Update Image File:r
    Runtime Image Filename : SRW224G4P_SRW248G4P_image_v1310.bix
    Updating file system.
    File system update fail.
    I'm guessing that I'll need to contact Cisco tech support, although at least through their web site, they make that nearly impossible to accomplish.
    Does anyone have any suggestions on what may have happened to our switch and what I should do to recover? Of course we're about to start a time-critical round of product testing, and without this switch, I'm dead in the water.  And it's not like we have a spare 48-port PoE switch lying around.

    Hello,
    I got the same issue. After downloading and uploading the firmware, I got the following result and all LED on the switch are glowing. Could you please help on this issue? Where can I find the right firmware. I also have Image loader 1.0.1.
    Xmodem Receiving Start ::
    XMODEM, Successful.
    Blocks Received = 6b59
    Bytes Received = 35ac80
    Errors:
            Checksum   = 0
            Complement = 0
            Duplicates = 0
    Image downloaded to buffer.
            [R]untime
            [D]iagnostic
            M[u]ltipe Image
            [L]oader (Warning: Are you sure what you are doing?)
            [Q]uit
    Update Image File:r
    Runtime Image Filename : SRW224G4P_SRW248G4P_image_v1020.bix
    Updating file system.
    File system update fail.
    File Name                         S/Up Type Size       Create Time
    All I got now after restarting the switch is:
    File Name                         S/Up Type Size       Create Time
    Factory_Default_Config.cfg          1    5        354  24:01:02
    certificate                         0    8      18040  24:00:56
    Free Space : 7602176
    [X]modem Download  [D]elete File  [S]et Startup File
    [Q]uit
    Select>
    Thnx in advance.

  • SRW224G4P - " ERR Runtime Loading Fail - System Halt"

    Hello everyone!
    When I power up my switch (SRW224G4P), hyperterminal displays the following output:
    Image Loader 1.0.1
    Loading Diagnostic Image File : SRW224G4P_SRW248G4P_boot.bix
    Diagnostic 1.0.1
    * the screen then clears and displays *
    User Mode
    --- Performing Power-On Self Tests (POST) ---
    DUMMY Test 1 ................. PASS
    UART Loopback Test ........... PASS
    POE UART Loopback Test ....... PASS
    DRAM Test .................... PASS
    Timer Test ................... PASS
    Done All Pass.
    ------------------ DONE ---------------------
    <ERR> Runtime Loading Fail - System Halt.
    * no "auto-boot in 2 second" message is displayed *
    Does anyone have any ideas what can be done to fix this error?
    Message Edited by Vince_02 on 12-14-2009 10:52 AM

    The SRW is now part of Cisco Small Business. You better ask your question in the Cisco Small Business Support Community. You'll find Cisco people over there...

  • Check if applet can load JNI library within the applet

    Hello,
    I have a signed applet that is part of a bigger application. The application has native installer that installs some JNI libraries and grants permissions to my applet in java.policy file. However if the user did not install the application (using the installer) which means that the java.policy file is not modified. Then if he/she go directly go to the web UI, and opens my applet the user sees a dialog with the following warning: "The applet was signed by "xxx", but Java cannot verify the authenticity of the signature's certificate. Do you trust this certificate?" that have two buttons "Trust" and "Don't trust".
    I have two questions:
    A) Is it possible instead of showing the dialog, the JVM directly to choose "Don't trust", which means that I will get a security exception inside my code, so I can navigate to another site with installation instructions.
    B) what is the exact reason for showing this dialog. Is it because I am calling System.loadLibrary("xxx"); which requires privileges. If this is the case, how can I check if the applet has enough privileges before calling System.loadLibrary()?
    Thanks in advance
    Kiril

    A) Is it possible instead of showing the dialog, the JVM directly to choose "Don't trust", which means that I will get a security exception inside my code, so I can navigate to another site with installation instructions.Just don't sign it. It will be totally untrusted, except for clients that have java.policy modified.
    You will get the exception, will catch it and you will be able to navigate to another page from the
    catch block.
    B) what is the exact reason for showing this dialog.The reason is that the applet is signed.
    The reason for the "but..." part is that the certificate was created by a certificate authority that
    Java does not recognize (it would recognize 'well known' CA's like Verisign, Thawte etc.).
    Is it because I am calling System.loadLibrary("xxx"); which requires privileges. If this is the case, how can I check if the applet has enough privileges before calling System.loadLibrary()?Why 'before'? Isn't this good enough?
    try
      System.loadLibrary("xxx");
      // Applet has privileges
    catch ( SecurityException e )
      // Applet does not have privileges
    }

  • Library loaded but unsatisfies

    Hi All,
    I have the following problem: with the following signature generated by
    javah -jni -d media/huffyuv media.huffyuv.HuffYUVEncoder
    /* signature taken from generated .h file
    JNIEXPORT jint JNICALL Java_media_huffyuv_HuffYUVEncoder_openEnc
      (JNIEnv *, jobject, jint, jint, jint, jint, jint, jint, jint);
    C++ function:  */
    JNIEXPORT jint JNICALL Java_media_huffyuv_HuffYUVEncoder_openEnc(JNIEnv *env, jobject o,
         jint handle,jint inform,jint width,jint height,jint content,jint method,jint bitcount) {
         Encoder* enc=new Encoder(handle,inform,width,height,
              content,method,bitcount);
         return (jint)enc;
    }media.huffyuv.HuffYUVEncoder.openEnc declared as
    protected native int openEnc(int handle,int inform,int width,int height,int content,int method,int bitcount);causes
    java.lang.UnsatisfiedLinkError: openEnc
            at media.huffyuv.HuffYUVEncoder.openEnc(Native Method)
            at media.huffyuv.HuffYUVEncoder.open(HuffYUVEncoder.java:193)
    ...when I want to call it. Loading library as
    static {
         if(!loaded) {
              loaded=true;
              try {
                   System.loadLibrary("huffyuv");
              }catch(Throwable t) {
                   System.out.print("Unable to load huffyuv!\n");
                   loaded=false;
              if(loaded)
                   System.out.print("huffyuv loaded.\n");
    }is successful (I see 'huffyuv loaded.').
    What can be the problem? Thank you in advance.
    ps: I use Visual C++ 6.0 and Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
    Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode) under Win2k

    Hi there,
    I checked, extern "C" was there. Nevertheless, I translated the C++ stuff into C (and checked #ifdef __cplusplus was not true) to avoid it, but nothing changed. My compiler is what comes with MS Visual C++ 6.0:
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
    Copyright (C) Microsoft Corp 1984-1998. All rights reserved.Its settings are (I tried to get rid of every fancy and non-standard):
    /nologo /MTd /Za /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HUFFYUV_EXPORTS" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c for linking:
    kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /pdb:none /map:"Debug/huffyuv.map" /debug /machine:I386 /out:"Debug/huffyuv.dll" /implib:"Debug/huffyuv.lib" what can be the problem?
    thanx in advance: kolaloka

  • Windows 8.1 SOFTWARE registry hive load failed on Windows Server 2012

    Hello,
    I am participated in custom Windwows Software backup/restore project development that requires load of Windows SOFTWARE/SYSTEM registry hives from target OS system drive connected to Windows system.
    On all Windows version except Windows 8.1 program works correctly but when host system (on that programm run on) is Windows Server 2012 or Windows 8 and target system is Windows 8.1 registry hive load failed with following error: 
    Failed to load f:\Windows\System32\config\software: [1009] The configuration registry database is corrupt.
    After run of 'chkdsk /r' error still remained. All requred security privileges (SE_BACKUP, SE_RESTORE) are applied. All systems are 64-bit.
    Generally even system registry editor (regedit) could not open SOFTWARE hive  from Windows 8.1 with following error:
    Cannot Load f:\Windows\System32\config\software: Error while loading hive.
    But when host system is Windows 7 or Windwos Server 2008 then SOFTWARE hive  loaded without any problem. 
    So is there some Windows 8/8.1 registry hives validation mechanism or additional security checks tha prevents load of registry hives fromother OS instance?

    Sorry for later response. I was busy with other tasks.
    The procMon tool shows RegLoadKey is failed when it tried to load the hive on Windows 8.1 (8.1 based WinPE also). On Windows 7, I didn't see the error (Shows Success instead of REGISTRY CORRUPT). Once the hive is load & unloaded on Windows 7 OS, the
    check sum of the hive is changed, and I can load the updated hive with regedit in Windows 8.1 OS.
    "reg.exe","752","RegCloseKey","HKLM\SOFTWARE\Microsoft\SQMClient\Windows","SUCCESS",""
    "reg.exe","752","RegQueryKey","HKLM","SUCCESS","Query: HandleTags, HandleTags: 0x0"
    "reg.exe","752","RegOpenKey","HKLM\Software\Microsoft\Rpc","SUCCESS","Desired Access: Query Value"
    "reg.exe","752","RegQueryValue","HKLM\SOFTWARE\Microsoft\Rpc\IdleTimerWindow","NAME NOT FOUND","Length: 144"
    "reg.exe","752","RegCloseKey","HKLM\SOFTWARE\Microsoft\Rpc","SUCCESS",""
    "reg.exe","752","QueryNameInformationFile","C:\Dhoni","SUCCESS","Name: \Dhoni"
    "reg.exe","752","RegQueryKeySecurity","HKLM","SUCCESS",""
    "reg.exe","752","RegLoadKey","HKLM\target1","REGISTRY CORRUPT","Hive Path: C:\Dhoni\SYSTEM1"

  • Data load failed while loading data from one DSO to another DSO..

    Hi,
    On SID generation data load failed while loading data  from Source DSO to Target DSO.
    Following are the error which is occuuring--
    Value "External Ref # 2421-0625511EXP  " (HEX 450078007400650072006E0061006C0020005200650066
    Error when assigning SID: Action VAL_SID_CONVERT, InfoObject 0BBP
    So, i'm  not getting  WHY in one DSO i.e Source  it got successful but in another DSO i.e. Target its got failed??
    While analyzing all i check that SIDs Generation upon Activation is ckecked in source DSO but not in Target DSO..so it is reason its got failed??
    Please explain..
    Thanks,
    Sneha

    Hi,
    I hope your data flow has been designed in such a way where the 1st DSO as a staging Device and all transformation rules and routine are maintained in between 1st to 2nd dso and sid generation upon activation maintained in 2nd DSO.  By doing so you will be getting your data 1st DSO same as your source system data since you are not doing any transformation rules and routine etc.. which helps to avoid data load failure.  
    Please analyze the following
    Have you loaded masterdata before transaction data ... if no please do it first
    go to the property of first dso and check whether there maintained sid generation up on activation (it may not be maintained I guess)
    Goto the property of 2nd Dso and check whether there maintained sid generation up on activation (It may be maintained I hope)
    this may be the reason.
    Also check whether there is any special char involvement in your transaction data (even lower case letter)
    Regards
    BVR

Maybe you are looking for

  • Capturing sound samples

    hi , i need the best way to capture sound samples from an opened Microphone port is it by directly using a TargetDataLine and how ? and thanks

  • Screen resolution 13" Mcp

    Hey.. I have a Macbook Pro 13" that runs on Mac Os X (10.7.4) Yesterday i noticed my screen resolution was all strange. It is set to as a max resolution of 1440 x 842 and not to 1440 x 900 why is that and how can i change it back to 1440 x 900 ? =) /

  • HELP NEWBIE Integrating CR into Visual Basic 2010 pro

    I am creating reports in CR for ms visual studio(VB) how do I do this I am lost. I do not understand how to have a menu written in vb. A menu with reports that a user can select which report to run. I have been tring to do this for weeks. I am using

  • When i click any link of wikipedia it says This Site Is Restricted

    I messed around with proxies to bypass it and it worked so wat IS the problem? i have PTCL DSL and i live in pakistan. (MANY OTHER SITES SHOW THIS MESSAGE TOO!!! PLZ HELP!!! == This happened == Every time Firefox opened == since yesterday i think whe

  • HT4009 how can i view my in-app purchases via iphone?

    how can i view my in-app purchases via iphone?