简体   繁体   English

无法通过 java 连接到 PowerDesigner

[英]Unable to Connect to PowerDesigner through java

I have a requirement to automate the process of connecting to PowerDesigner through java to extract the models from repository.我需要自动化通过 java 连接到 PowerDesigner 的过程,以从存储库中提取模型。 I have used the OLE Automation JavaProxy document to configure the process.我已经使用 OLE 自动化 JavaProxy 文档来配置该过程。

when trying to run, I'm getting this error:尝试运行时,出现此错误:

Exception in thread "main" java.lang.NoSuchMethodError: org.eclipse.swt.internal.ole.win32.COM.CoCreateInstance(Lorg/eclipse/swt/internal/ole/win32/GUID;IILorg/eclipse/swt/internal/ole/win32/GUID;[I)I at com.sybase.stf.powerdesigner.PdCommon.Application.start(Application.java:57) at com.sybase.stf.powerdesigner.PdCommon.Application.(Application.java:31) at com.sybase.stf.powerdesigner.PdCommon.Application.getInstance(Application.java:42) at OOM.src.createOOM.CreateOOM.CreateAndDisplayOOM(CreateOOM.java:37) at OOM.src.createOOM.CreateOOM.main(CreateOOM.java:28)线程“main”中的异常 java.lang.NoSuchMethodError: org.eclipse.swt.internal.ole.win32.COM.CoCreateInstance(Lorg/eclipse/swt/internal/ole/win32/GUID;IILorg/eclipse/swt/internal/ ole/win32/GUID;[I) 我在 com.sybase.stf.powerdesigner.PdCommon.Application.start(Application.java:57) 在 com.sybase.stf.powerdesigner.PdCommon.Application.(Application.java:31) ) 在 com.sybase.stf.powerdesigner.PdCommon.Application.getInstance(Application.java:42) 在 OOM.src.createOOM.CreateOOM.CreateAndDisplayOOM(CreateOOM.java:37) 在 OOM.src.createOOM.CreateOOM.main(创建OOM.java:28)

Versions:版本:

  • PowerDesigner - 16.5.5.0电源设计器 - 16.5.5.0
  • Eclipse 4.18日食 4.18

Supporting Jars:支持罐子:

  • pdj2com_16.5.5.jar pdj2com_16.5.5.jar
  • org.eclipse.swt.win32.win32.x86_64_3.115.100.v20201202-1103.jar org.eclipse.swt.win32.win32.x86_64_3.115.100.v20201202-1103.jar

The above issue is resolved Thanks!以上问题已解决 谢谢!

Now i'm facing trouble connecting again with the below issue.现在我遇到了再次连接以下问题的麻烦。

org.eclipse.swt.SWTException: Action can not be performed. org.eclipse.swt.SWTException:无法执行操作。 result = -2137456383 (com.sybase.stf.powerdesigner.com.COMException: COM Failure [HRESULT: 0x80990101]) at org.eclipse.swt.ole.win32.OLE.error(OLE.java:345) at com.sybase.stf.powerdesigner.com.COMException.raiseOnFail(COMException.java:83) at com.sybase.stf.powerdesigner.com.IDispatchEx.raisingInvoke(IDispatchEx.java:231) at com.sybase.stf.powerdesigner.PdCommon.IApplication.CreateModel(IApplication.java:84) at OOM.src.createOOM.CreateOOM.createOOM(CreateOOM.java:68) at OOM.src.createOOM.CreateOOM.CreateAndDisplayOOM(CreateOOM.java:42) at OOM.src.createOOM.CreateOOM.main(CreateOOM.java:28) Caused by: com.sybase.stf.powerdesigner.com.COMException: COM Failure [HRESULT: 0x80990101] at com.sybase.stf.powerdesigner.com.COMException.raiseOnFail(COMException.java:88) ... 5 more Is there anything else to add to the code to connect?结果 = -2137456383 (com.sybase.stf.powerdesigner.com.COMException: COM Failure [HRESULT: 0x80990101]) at org.eclipse.swt.ole.win32.OLE.error(OLE.java:345) at com.sybase .stf.powerdesigner.com.COMException.raiseOnFail(COMException.java:83) 在 com.sybase.stf.powerdesigner.com.IDispatchEx.raiseInvoke(IDispatchEx.java:231) 在 com.sybase.stf.powerdesigner.PdCommon.IApplication .CreateModel(IApplication.java:84) 在 OOM.src.createOOM.CreateOOM.createOOM(CreateOOM.java:68) 在 OOM.src.createOOM.CreateOOM.CreateAndDisplayOOM(CreateOOM.java:42) 在 OOM.src.createOOM。 CreateOOM.main(CreateOOM.java:28) 由:com.sybase.stf.powerdesigner.com.COMException: COM 失败 [HRESULT: 0x80990101] at com.sybase.stf.powerdesigner.com.COMException.raiseOnFail(COMException.java) :88) ... 5 more 还有什么要添加到代码中以进行连接吗?

I am not able to find any solution online.我无法在网上找到任何解决方案。 Kindly help me figure this out.请帮我解决这个问题。 Thanks in advance.提前致谢。

The swt.win.win32.x86_64 jar is for 64-bit, so I assume you're using a 64-bit Java. swt.win.win32.x86_64 jar 适用于 64 位,因此我假设您使用的是 64 位 Java。

In my case, the pdj2com jar is named something like pdj2com_16.N.Nx64.jar for the 64-bit version.就我而言,pdj2com jar 的名称类似于 64 位版本的pdj2com_16.N.Nx64.jar pdj2com_16.NNjar is the name of the 32-bit version. pdj2com_16.NNjar 是 32 位版本的名称。

I seem to have stumbled on the same issue with the COM Exception as you did.我似乎和您一样偶然发现了与 COM 异常相同的问题。 Any luck on overcoming the issue?克服这个问题有运气吗?

Thank you谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM