UnsatisfiedLinkError exception loading native library: njni10
Exception in thread "main" java.lang.UnsatisfiedLinkError: get
metalink上两个相关的帖子,其中之一:
Subject:
In this Document
--------------------------------------------------------------------------------
This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process, and therefore has not been subject to an independent technical review.
Applies to:
Net Configuration Assistant - NetCA - Version: 9.2.0.1.0 to 10.2.0.2.0
Oracle Database Configuration Assistant - Version: 9.2.0.1 to 10.2.0.2
HP-UX PA-RISC (64-bit)
Found in 10.2.0.1, but the problem can affect other Oracle versions
Symptoms
The Database Configuration Assistant (DBCA) and Network Configuration Assistant (NETCA) can fail with the following errors:
UnsatisfiedLinkError exception loading native library: njni10
Exception in thread "main" java.lang.UnsatisfiedLinkError: get
at oracle.net.common.NetGetEnv.get(Native Method)
at oracle.net.config.Config.getNetDir(Unknown Source)
at oracle.net.config.Config.initConfig(Unknown Source)
at oracle.net.config.Config.<init>(Unknown Source)
at oracle.sysman.assistants.util.NetworkUtils.<init>(NetworkUtils.java:222)
at oracle.sysman.assistants.util.step.StepContext.<init>(StepContext.java:255)
at oracle.sysman.assistants.dbca.backend.Host.<init>(Host.java:682)
at oracle.sysman.assistants.dbca.ui.UIHost.<init>(UIHost.java:205)
at oracle.sysman.assistants.dbca.ui.InteractiveHost.<init>(InteractiveHost.java:54)
at oracle.sysman.assistants.dbca.Dbca.getHost(Dbca.java:160)
at oracle.sysman.assistants.dbca.Dbca.execute(Dbca.java:94)
at oracle.sysman.assistants.dbca.Dbca.main(Dbca.java:180)
In this case DBCA and NETCA failed to load library libnjni10.sl
The generic error is:
UnsatisfiedLinkError exception loading native library: <library name>
Exception in thread "main" java.lang.UnsatisfiedLinkError: get
at oracle.net.common.NetGetEnv.get(Native Method)
at oracle.net.config.Config.getNetDir(Unknown Source)
at oracle.net.config.Config.initConfig(Unknown Source)
at oracle.net.config.Config.<init>(Unknown Source)
at oracle.sysman.assistants.util.NetworkUtils.<init>(NetworkUtils.java:222)
:
Cause
If you use truss or tusc to trace the DBCA or NETCA tools, the output can contain errors which indicate that the tools fail due to a lack of resources.
:
[19963] stat("/oracle/product/10.2.0/lib32/libnjni10.sl", 0x77ff4440) ......................................................... = 0
[19963] open("/oracle/product/10.2.0/lib32/libnjni10.sl", O_RDONLY, 040230) ............................... = 76
:
[19963] read(76, "80\0\0\v\0\0\004\0\0\0\0", 12) .................................................................................... = 12
[19963] mmap(NULL, 20135936, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 76, 3629056)
................................................. ERR#12 ENOMEM
[19963] close(76) ................................................................................................................................... = 0
[19963] write(1, "U n s a t i s f i e d L i n k E ".., 61) ............................................................................... = 61
:
The ENOMEM error indicates that the tool failing when is trying to mmap (allocate memory for) the libnjni10.sl library.
From the mmap line we see that DBCA/NETCA fails to allocate 20 megabytes of virtual memory when loading the libnjni10.sl library.
Solution
To implement the solution, please execute the following steps:
1. Check if all kernel parameters are set correctly and all OS packages and Patches are installed (see Note 169706.1)
2. Verify if the environment is set correctly:
if the above env variables do not point to the correct Oracle Home, please change them according:
3. Check whether any errors occur during a 'relink all' (and resolve them)
4. Collect truss or tusc output by running the following command (or similar):
5. Check the truss/tusc output and, for the library reported in the UnsatisfiedLinkError exception, identify a line like the following:
[19963] stat("/oracle/product/10.2.0/lib32/libnjni10.sl", 0x77ff4440)................................................................ = 0
[19963] open("/oracle/product/10.2.0/lib32/libnjni10.sl", O_RDONLY, 040230)............................................ = 76
:
[19963] read(76, "80\0\0\v\0\0\004\0\0\0\0", 12)..................................................................................... = 12
[19963] mmap(NULL, 20135936, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 76, 3629056)................................................. ERR#12 ENOMEM
[19963] close(76).................................................................................................................... = 0
[19963] write(1, "U n s a t i s f i e d L i n k E ".., 61)........................................................................... = 61
:
According to the mmap line, the mmap system call fails to allocate 20135936 bytes of shared memory.
6. If this happens, try running DBCA/NETCA in a separate memory window (specifying how much memory the window requires, in megabytes):
@ the above command is only for HP-UX PA-RISC OS.
Keywords
DBCA ; DBUA ; DATABASE~CONFIGURATION~ASSISTANT ; UNSATISFIEDLINKERROR ; JAVA.LANG.UNSATISFIEDLINKERROR ; NETCA ;
--------------------------------------------------------------------------------
Help us improve our service. Please email us your comments for this document. .
metalink上第二篇相关文章
Subject:
In this Document
--------------------------------------------------------------------------------
Applies to:
Oracle Application Server 10g Enterprise Edition - Version: 10.1.2.0.0 to 10.1.2.3.0
IBM AIX Based Systems (64-bit)
Checked for relevance on 2-July-2009
Symptoms
During the installation of patchset 10.1.2.2.0, the Oracle Internet Directory Patch Configuration
Assistant fails with the following error:
UnsatisfiedLinkError exception loading native library: njni10
Exception in thread "main" java.lang.UnsatisfiedLinkError: get
at oracle.net.config.Config.getNetDir(Unknown Source)
Changes
The libnjni10 file did exist as expected in $ORACLE_HOME/lib and lib32.
The following notes describing the same error were reviewed and determined to not solve the issue:
Note 395891.1 - DBCA, NETCA and DBUA Fail With Error: "UnsatisfiedLinkError exception loading native library ..."
Cause
AIX caches the shared libraries at the OS level and in this case, it cached libraries specific to the Oracle installation.
Solution
1. Link prerequisite libraries
> ln -s $ORACLE_HOME/lib32/libnjni10.dylib $ORACLE_HOME/lib32/libnjni10
> ln -s $ORACLE_HOME/lib32/libclntsh.dylib $ORACLE_HOME/lib32/libclntsh.dylib.10.1
2. Clear the shared library cache by running the following command as root
> /usr/bin/slibclean
Be careful to switch back to the oracle user before running anything else
3. Set the LIBPATH to $ORACLE_HOME/lib32
4. Re-run the installation (failed configuration assistants can be completed by doing the following)
> export LD_LIBRARY_PATH=$ORACLE_HOME/lib32
> $ORACLE_HOME/cfgtoollogs/configToolCommands
References
Note 395891.1 - DBCA, NETCA and DBUA Fail With Error: "UnsatisfiedLinkError exception loading native library ..."
SR 6126571.993
Keywords
INSTALLATION~FAILS ; AIX ; SHARED~LIBRARY ; LIB32 ; UNSATISFIEDLINKERROR ; DURING~INSTALLATION ; JAVA.LANG.UNSATISFIEDLINKERROR ;
--------------------------------------------------------------------------------
Help us improve our service. Please email us your comments for this document
<< Back |
The complete error while loading the ./netca after making the installation is the following:
UnsatisfiedLinkError exception loading native library: njni10
Exception in thread "main" java.lang.UnsatisfiedLinkError: jniGetOracleHome
at oracle.net.common.NetGetEnv.jniGetOracleHome(Native Method)
at oracle.net.common.NetGetEnv.getOracleHome(Unknown Source)
at oracle.net.common.NetProperties.(Unknown Source)
at oracle.net.common.NetProperties.getInstance(Unknown Source)
at oracle.net.ca.CmdlineArgs.(Unknown Source)
at oracle.net.ca.InitialSetup.(Unknown Source)
at oracle.net.ca.NetCA.main(Unknown Source)
Ok , just follow the simple two steps ,
cd into $ORACLE_HOME/bin
then type: ln -s $ORACLE_HOME/lib/libnjni10.dylib $ORACLE_HOME/lib/libnjni10 , then ENTER
then type: ln -s $ORACLE_HOME/lib/libclntsh.dylib $ORACLE_HOME/lib/libclntsh.dylib.10.1
After that go into $ORACLE_HOME/bin and start ./netca
Problem solved, this simple solution came to me literally after hours of dealing with the situacion and very little help from ORACLE documentation on the issue.