`

Class Loader Problem Determination

    博客分类:
  • JAVA
阅读更多

 

摘录自WebSphere.com

 

JVM classloader “–verbose” and “-verboseJNI” JVM options

 

Problem Determination – Native Libraries


  JVM throws an UnsatisfiedLinkError indicating the native library could
  not be found

  •      Verify the native library is in the search path
  •      Verify whether the application invokes the loadLibrary() method with the
  •      correct name of the library without platform-specific prefixes or extensions
  •      Check whether the System.mapLibraryName() function is returning the wrong
  •      version of the native library. On UNIX®, “.a” versus “.so”
  •      Dependent native library not in JVM native library path

 

JVM throws an UnsatisfiedLinkError indicating the native library is
  already loaded

  •       Determine why the library is being reloaded and rectify the situation
  •        Placing the native library in an Application Server associated shared library will solve the problem
  •        Place the call in a static block within the class

 

  JVM throws an UnsatisfiedLinkError indicating a dependent native
  library could not be resolved

  •      Set the LD_LIBRARY_PATH (UNIX) or PATH (Windows®) environment
  •      variable to include the path containing the unresolved native library

 

Common Problems
  ClassCastException
       Duplicate class loaded by two different class loaders and   have dependencies

  ClassNotFoundException
    Classes not in the classpath
    Loaded classes that have dependencies that are lower in the hierarchy

   NoClassDefFoundError

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics