调试Teamcenter Rich Client(eclipse rcp)失败,出现“org.osgi.service.component.ComponentException”

时间:2016-10-03 07:18:32

标签: eclipse debugging eclipse-rcp

在一台机器上(WIN 7 x64)我有一个工作的eclipse安装和工作区,我从中运行/调试Teamcenter RCP(eclipse 3.6)的插件完美无瑕。

现在我将eclipse和工作区移动到另一台WIN 7 x64机器上,确保:

  • 拥有相同的jre
  • 具有相同的配置和安装路径
  • 安装相同的目标平台(Teamcenter)(至少是同一套插件)

但新计算机上有 ,当我启动调试配置时,应用程序无法以此异常启动。

org.osgi.framework.ServiceException: Exception in org.eclipse.equinox.internal.ds.ServiceReg.getService()
    at org.eclipse.osgi.internal.serviceregistry.ServiceUse.getService(ServiceUse.java:130)
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:447)
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:430)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:667)
    at com.teamcenter.rac.util.OSGIUtil.getService(Unknown Source)
    at com.teamcenter.rac.util.OSGIUtil.getService(Unknown Source)
    at com.teamcenter.rac.aifrcp.Application.runApplication(Unknown Source)
    at com.teamcenter.rac.aifrcp.Application.start(Unknown Source)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Caused by: org.osgi.service.component.ComponentException: The component was not built because some of its references could not be bound. The component is Component[
    name = com.teamcenter.rac.aifrcp.RCPPortal
    activate = activate
    deactivate = deactivate
    modified = 
    configuration-policy = optional
    factory = null
    autoenable = true
    immediate = false
    implementation = com.teamcenter.rac.aifrcp.RCPPortal
    state = Unsatisfied
    properties = 
    serviceFactory = false
    serviceInterface = [com.teamcenter.rac.services.IPortalService]
    references = {
        Reference[name = ISessionService, interface = com.teamcenter.rac.services.ISessionService, policy = static, cardinality = 1..1, target = null, bind = setSessionService, unbind = null]
    }
    located in bundle = com.teamcenter.rac.aifrcp_9000.1.0 [594]
]
    at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:342)
    at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:580)
    at org.eclipse.equinox.internal.ds.ServiceReg.getService(ServiceReg.java:53)
    at org.eclipse.osgi.internal.serviceregistry.ServiceUse$1.run(ServiceUse.java:120)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.internal.serviceregistry.ServiceUse.getService(ServiceUse.java:118)
    ... 20 more

在第二台机器上,我也尝试使用其他eclipse版本和JRE,并在干净安装时导出/导入插件项目,但没办法,运行/调试失败

1 个答案:

答案 0 :(得分:0)

问题出在我用来指定目标平台的.target文件中(本例中为Teamcenter)。

假设我的plugins文件夹位于C:\plm\plmsw\tcroot\portal\plugins路径中。

Eclipse在.target文件中接受两种形式:

  • 插件位置= C:\plm\plmsw\tcroot\portal\plugins enter image description here

  • 插件位置= C:\plm\plmsw\tcroot\portal enter image description here

但在运行时,只有秒是正确的,因为它被视为RCP的基本路径。 事实上,此错误源自Teamcenter未找到“{1}}中搜索到的”注册表“文件夹,而不是在其正确的位置C:\plm\plmsw\tcroot\portal\plugins\registry