2011년 7월 4일 월요일

[WebSphere] Native libraries & UnsatisfiedLinkError

WebSphere Application Server에서 native libraries 설정

Problem
This technote provides instructions for setting paths to native libraries. This can be accomplished by setting an operating system environment variable or by setting a JVM™ system property. You can receive a java.lang. UnsatisfiedLinkError from any application if the native library required by the application is not found in the library path.

Cause
An improperly set path to native libraries. To work properly, the application requires that the native libraries be in the library path.

Solution
To set the path to a native library, you can use an operating system environment variable or you can set a JVM system property. If this path is not properly defined, an Unsatisfied Link error can occur when a Java™ program makes a native call but is unable to find the native library.
A. Setting the Operating System environment variable
Each operating system has a different name for the environment variable to include native libraries in your path.
  AIX = LIBPATH
  Linux = LD_LIBRARY_PATH
  Solaris = LD_LIBRARY_PATH
  HP-UX = SHLIB_PATH
  Windows = PATH

A. Set the operating system environment variables through the WebSphere Application Server Administrative Console:
 1. In the Administrative Console, select the application server for which you want to configure the environment variables.
 2. Navigate to the Application Server (Environment Entries) for which you want to add the classpath.
             -> Servers > Server Types > {instance name} > server infrastructure >> prcoess define >.
 3. Click Environment (see screenshot below).
 4. In the Environment Editor window, click Add, then type the Name and Value for your environment variables (see screenshot below):
 5. Click OK.
 6. Click Apply.
Restart WebSphere Application Server.

B. Setting the java.library.path JVM system property
To set the java.library.path for all Operating Systems:
 1. Open the Administrative Console.
 2. Navigate to the Application Server (JVM) for which you want to add the classpath.
         --> Servers > Server Types > {instance name} > server infrastructure >> prcoess define >
 3. Click on the JVM(Java Virtual Machine) Settings tab.
 4. In the "Custom properties" section click Add.
 5. Type the java.library.path for the Name, then type the path to the library for the Value.
 6. Click Apply.
 7. Restart the WebSphere Application Server.

댓글 없음:

댓글 쓰기