ITeye博客

Class Loader Problem Determination

dikar · 2010-04-05 22:30 · JAVA · 编程语言 · Markdown

摘录自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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。