无法加载.dll文件(HRESULT 0x80070002)

4

Eclipse会查找一个我的插件需要执行的.dll文件。这是该文件的完整路径:

C:\Eclipse\eclipse-sib\eclipse\configuration\org.eclipse.osgi\bundles\324\1\.cp\jni4net.n.w32.v20-0.8.6.0

尝试这样打开:

public class Main {

  public static void main(String[] args) {

    File f = new File("C:\\Eclipse\\eclipse-sib\\eclipse\\configuration\\org.eclipse.osgi\\bundles\\324\\1\\.cp\\jni4net.n-0.8.6.0.dll");

    System.out.println(f.getName() + " " + f.getAbsolutePath());
  }

}

工作正常!

Output:
jni4net.n-0.8.6.0.dll C:\Eclipse\eclipse-sib\eclipse\configuration\org.eclipse.osgi\bundles\324\1\.cp\jni4net.n-0.8.6.0.dll

但是,当我一访问文件就运行我的插件时,我收到了以下错误信息:

enter image description here

使用 FUSLOGVW.EXE 出现相同的错误:

*** Assembly Binder Log Entry  (26.08.2013 @ 13:53:35) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable  C:\Eclipse\eclipse-sib\eclipse\eclipsec.exe
--- A detailed error log follows. 

LOG: IJW explicit bind. File path:C:\Eclipse\eclipse-sib\eclipse\configuration\org.eclipse.osgi\bundles\324\1\.cp\jni4net.n-0.8.6.0.dll.

有人知道问题可能是什么吗?
2个回答

2
我认为这个错误可能是由于缺少“jni4net.n-0.8.6.0.dll”的依赖关系导致的。 在Windows上,我建议使用FileMon/ProcessMonitor来检查Eclipse在该错误之前尝试加载哪些文件/dlls。

查看依赖项以查看文档中未明确提到的任何依赖项。为了真正了解发生了什么,请从http://live.sysinternals.com运行procmon.exe,以查看来自Eclipse的实际内核调用。您可能会惊讶地发现文件在进程中被搜索的位置。 - Pekka

0

将文件名结尾改为:jni4net.n.w32.v20-0.8.6.0,而不是你使用的:jni4net.n-0.8.6.0.dll


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接