1

我们有一个通过 JNI 依赖于 C++ 代码的 java 程序。我们有用于 solaris 和 windows 的 C++ 代码的 .so 和 .dll 放置在 java 程序的类路径中。同样在 Windows 上,我们生成了 java.exe.manifest 以强制 Windows 使用 MSVC RTL。这在 solaris 和 windows 2003 中运行良好,但在 windows 2008 上我收到错误消息“并排组装配置错误”

这是 java.exe.manifest

<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.762' processorArchitecture='amd64' publicKeyToken='1fc8b3b9a1e18e3b' />
    </dependentAssembly>
  </dependency>
</assembly>

我也尝试通过 sxstrace 调试问题,这是它的日志

=================
Begin Activation Context Generation.
Input Parameter:
    Flags = 0
    ProcessorArchitecture = AMD64
    CultureFallBacks = en-US;en
    ManifestPath = D:\JDA\TRO\bin\OptCoreBodies.dll
    AssemblyDirectory = D:\JDA\TRO\bin\
    Application Config File = 
-----------------
INFO: Parsing Manifest File D:\JDA\TRO\bin\OptCoreBodies.dll.
    INFO: Manifest Definition Identity is (null).
    INFO: Reference: Microsoft.VC80.CRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50608.0"
    INFO: Reference: Microsoft.VC80.CRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.4053"
INFO: Resolving reference Microsoft.VC80.CRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50608.0".
    INFO: Resolving reference for ProcessorArchitecture amd64.
        INFO: Resolving reference for culture Neutral.
            INFO: Applying Binding Policy.
                INFO: Find publisher policy at C:\Windows\WinSxS\manifests\amd64_policy.8.0.microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.3053_none_09c0f5a3facc9779.manifest
                INFO: Publisher Policy redirected assembly version.
                INFO: Post policy assembly identity is Microsoft.VC80.CRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.3053".
            INFO: Begin assembly probing.
                INFO: Attempt to probe manifest at C:\Windows\WinSxS\manifests\amd64_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.3053_none_88e044e32fae7230.manifest.
                INFO: Manifest found at C:\Windows\WinSxS\manifests\amd64_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.3053_none_88e044e32fae7230.manifest.
            INFO: End assembly probing.
INFO: Resolving reference Microsoft.VC80.CRT.mui,language="&#x2a;",processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.3053".
    INFO: Resolving reference for ProcessorArchitecture amd64.
        INFO: Resolving reference for culture en-US.
            INFO: Applying Binding Policy.
                INFO: No publisher policy found.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_64\Microsoft.VC80.CRT.mui\8.0.50727.3053_en-US_1fc8b3b9a1e18e3b\Microsoft.VC80.CRT.mui.DLL.
                INFO: Did not find manifest for culture en-US.
            INFO: End assembly probing.
        INFO: Resolving reference for culture en.
            INFO: Applying Binding Policy.
                INFO: No publisher policy found.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_64\Microsoft.VC80.CRT.mui\8.0.50727.3053_en_1fc8b3b9a1e18e3b\Microsoft.VC80.CRT.mui.DLL.
                INFO: Did not find manifest for culture en.
            INFO: End assembly probing.
INFO: Resolving reference Microsoft.VC80.CRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.4053".
    INFO: Resolving reference for ProcessorArchitecture amd64.
        INFO: Resolving reference for culture Neutral.
            INFO: Applying Binding Policy.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_64\Microsoft.VC80.CRT\8.0.50727.4053__1fc8b3b9a1e18e3b\Microsoft.VC80.CRT.DLL.
                INFO: Attempt to probe manifest at D:\JDA\TRO\bin\Microsoft.VC80.CRT.DLL.
                INFO: Attempt to probe manifest at D:\JDA\TRO\bin\Microsoft.VC80.CRT.MANIFEST.
                INFO: Attempt to probe manifest at D:\JDA\TRO\bin\Microsoft.VC80.CRT\Microsoft.VC80.CRT.DLL.
                INFO: Attempt to probe manifest at D:\JDA\TRO\bin\Microsoft.VC80.CRT\Microsoft.VC80.CRT.MANIFEST.
                INFO: Did not find manifest for culture Neutral.
            INFO: End assembly probing.
    ERROR: Cannot resolve reference Microsoft.VC80.CRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.4053".
ERROR: Activation Context generation failed.
End Activation Context Generation.

谁能帮我解决这个问题。我尝试安装 MS VS 2005 Redistributable 但没有用。

提前致谢 Niraj Rathi

4

3 回答 3

1

我终于解决了这个问题。我重新安装了操作系统,然后安装了 Visual C++ 2005 Redistributables (x64) 和 SP1。然后安装 Java 64 位。然后添加 HKEY_LOCAL_MACHINE\COMPONENTS\PreferExternalManifest 注册表并将其设置为 1。

在那个问题得到解决之后。

谢谢尼拉吉·拉蒂

于 2012-07-03T09:52:35.570 回答
1

您使用 version='8.0.50727.762' 编译的 CRT 版本以及您正在执行的系统没有此 CRT 版本。所以@panickal 提到安装MS VS 2005 Redistributable Package应该可以解决这个问题。

于 2012-06-28T13:28:31.980 回答
0

尝试x64安装MS VS 2005 Redistributable Package.

MS VS 2005 Redistributable Package 有四种变体

于 2012-06-27T09:35:15.577 回答