[英]jacob - Can't co-create object
My environment is Java 7, on Windows 7 - 64 bit. 我的环境是Windows 7-64位上的Java 7。 So here's my requirement and procedures I followed 所以这是我的要求和遵循的程序
test.dll
from Java 我想从Java执行一个名为test.dll
的库 PATH
. 我首先下载了最新版本的jacob ,并将它们放在Windows环境变量PATH
包含的文件夹中。 test.dll
using regsvr32.exe
under C:\\Windows\\SysWOW64
(it was successful!) 我在C:\\Windows\\SysWOW64
下使用regsvr32.exe
注册了test.dll
(成功!) WEB-INF/lib
has jacob.jar
in it. 我正在从WEB-INF/lib
应用程序运行jacob,因此请确保WEB-INF/lib
包含jacob.jar
。 -Djava.library.path=c:/dev/jacob/jacob-1.17-x64.dll
(This is where I have kept the jacob-1.17-x64.dll
) 我还设置了一个Java系统属性-Djava.library.path=c:/dev/jacob/jacob-1.17-x64.dll
(这是我保存jacob-1.17-x64.dll
) still I am facing 我仍然面对
com.jacob.com.ComFailException: Can't co-create object
at com.jacob.com.Dispatch.createInstanceNative(Native Method)
at com.jacob.com.Dispatch.<init>(Dispatch.java:99)
I have gone through many of the SO posts but none of them have helped me so far 我已经完成了许多SO职位,但到目前为止,它们都没有对我有帮助
can anyone please guide me to the solution? 谁能指导我解决问题?
通过将jdk从64位更改为32位,解决了我一个类似的问题。
Looking at the source code of Jacob Dispatch, line 99 ( http://jacob-project.cvs.sourceforge.net/viewvc/jacob-project/jacob/src/com/jacob/com/Dispatch.java?revision=1.18&view=markup ), the error is not within Jacob (at least not the Java code). 查看Jacob Dispatch的源代码,第99行( http://jacob-project.cvs.sourceforge.net/viewvc/jacob-project/jacob/src/com/jacob/com/Dispatch.java?revision=1.18&view = markup ),则错误不在Jacob内(至少不是Java代码内)。 Before digging into the Jacob native code, I would try to create this COM object in another container, say an Excel macro or Windows Scripting Host. 在深入研究Jacob本机代码之前,我将尝试在另一个容器(例如Excel宏或Windows脚本宿主)中创建此COM对象。 I believe you will find the same error, or at least will be able to determine if Jacob is the culprit or not. 我相信您会发现相同的错误,或者至少能够确定雅各是否是罪魁祸首。 I suspect not. 我怀疑不是。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.