我们有同一个 Web 应用程序的两个独立实例。一个是沙盒,一个是实时环境。两者都在访问 subversion,因此我们设置svnClientAdapter
为使用 JavaHL。在我们正在调用的应用程序启动时JhlClientAdapterFactory.setup();
当第二个实例启动时,我收到错误消息:
Failed to load JavaHL Library.
These are the errors that were encountered:
Native Library C:\jboss-6.1.0.Final\bin\native\msvcr100.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\msvcp100.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\libapr-1.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\libapriconv-1.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\libeay32.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\ssleay32.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\libaprutil-1.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\dbghelp.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\libsasl.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\libsvn_subr-1.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\libsvn_delta-1.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\libsvn_diff-1.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\libsvn_wc-1.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\libsvn_fs-1.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\libsvn_repos-1.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\libsvn_ra-1.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\libsvn_client-1.dll already loaded in another classloader
Native Library C:\jboss-6.1.0.Final\bin\native\libsvnjavahl-1.dll already loaded in another classloader
no svnjavahl-1 in java.library.path
no svnjavahl in java.library.path
java.library.path = C:/jboss-6.1.0.Final/bin/native
很明显问题是什么,但我不知道如何解决它。
使用以下方法加载本机库svnClientAdapter
:
System.loadLibrary(WINDOWSLIBS[i]);