Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2009-09-26T00:31:15Z by SystemAdmin
SystemAdmin
SystemAdmin
9 Posts
ACCEPTED ANSWER

Pinned topic How to use NameWorks Scoring class?

‏2008-12-03T16:04:16Z |
I am trying to write a very simple Java program that uses the NameWorks Scoring class. This program fails on the statement that constructs the Scoring object:

Scoring scoring = 

new Scoring(nwConfigFile);

The exception that is thrown is:

UnsatisfiedLinkError:  swig_module_init At com.ibm.gnr.nws.scoringSWIGJNI.swig_module_init (Native Method)

In the statement to run this Java program, I do include the following clause to access the NameWorks .DLL files (where non-Java native methods are located):

-Djava.library.path=”C:\IBM\GNR\GNM\bin”

This clause was needed to successfully run one of the sample programs, NameParserCLU.jar, as follows:

java  -Djava.library.path=”C:\IBM\GNR\GNM\bin”  -jar NameParserCLU.jar

What .DLL or other file do I need to resolve this error?
Updated on 2009-09-26T00:31:15Z at 2009-09-26T00:31:15Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    9 Posts
    ACCEPTED ANSWER

    Re: How to use NameWorks Scoring class?

    ‏2009-08-25T14:53:29Z  in response to SystemAdmin
    Unix builds of npclu have a number of external shared-library dependencies. Most of the time, the necessary libraries should already be in the library search path. If not, the libraries that npclu needs are as follows:
    1. On Solaris, using the Forte6 build: libdl.so, libm.so, libw.so, libthread.so, libc.so, and libc_psr.so.
    2. On Solaris, using the GNU 3.2 build: libdl.so, libstdc++.so, libm.so, libgcc_s.so, and libc.so.
    3. On (Red Hat) Linux, using the GNU 3.2 build: libdl.so, libstdc++.so, libm.so, libgcc_s.so, libc.so, and ld-linux.so.

    For NameParserCLU: If you are running it self-contained so that it calls NameParser through its Java interface, make sure that the appropriate DLL is in your library search path.

    java sudoku
  • SystemAdmin
    SystemAdmin
    9 Posts
    ACCEPTED ANSWER

    Re: How to use NameWorks Scoring class?

    ‏2009-09-26T00:31:15Z  in response to SystemAdmin
    I didn't see a line where you load the scoring library (okay, it's really an archive):

    public class MyScoringClass {
    static {
    System.loadLibrary("scoring");
    }
    ...
    }

    Note: the above call to loadLibrary() assumes that libscoring.a is in your loader's path. For Unix I would just set LD_LIBRARY_PATH=<GNR HOME>/lib. I'm not sure what to do on Windows.

    I hope this helps.