简体   繁体   English

无法启动64位Windows版本的应用程序:org.eclipse.ui.workbench无效-> NoClassDefFound

[英]Cannot launch 64 bit Windows version of application : org.eclipse.ui.workbench is invalid -> NoClassDefFound

The complete version of the problem, entire log file can be found at this link 问题的完整版本,可以在此链接中找到整个日志文件

We have a Eclipse application whose 64 bit windows version fails to launch. 我们有一个Eclipse应用程序,其64位Windows版本无法启动。 While its 32 bit windows version, 32 and 64 bit mac version and 32 and 64 bit linux version work well. 虽然其32位Windows版本,32和64位mac版本以及32和64位linux版本运行良好。

I am using eclipse-java-luna-SR1a-win32-x86_64 我正在使用eclipse-java-luna-SR1a-win32-x86_64

I have referred the following links:- Link_A Link_B Link_C 我引用了以下链接: -Link_A Link_B Link_C

But they are not helpful to me as either they revert back to 32 bit system instead of 64 bit system. 但是它们对我没有帮助,因为它们会恢复为32位系统而不是64位系统。 I need to get the 64bit version of the application working . I need to get the 64bit version of the application working In the other link they add missing SWT jar. 在另一个链接中,他们添加了丢失的SWT jar。 I checked my target platform[Windows->Preferences->Plug-in Development->Target Platforms -> Edit -> type swt in type filter text]. 我检查了目标平台[Windows->首选项->插件开发->目标平台->编辑->在类型过滤器文本中输入swt]。 And I see SWT library checked or included 我看到SWT库已检查或包含在内

Any attempts to run the 64 bit version of the application by double clicking the application fails to launch and generates the following exception in the log. I am pasting here starting part of my log file. 我在这里粘贴我的日志文件的一部分。 As the entire log file shall not fit in here 由于整个日志文件不适合放在这里

!SESSION 2015-01-20 13:49:43.986 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_72
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86_64

!ENTRY org.eclipse.osgi 4 0 2015-01-20 13:49:45.107
!MESSAGE An error occurred while automatically activating bundle org.eclipse.ui.workbench (73).
!STACK 0
org.osgi.framework.BundleException: The activator org.eclipse.ui.internal.WorkbenchPlugin for bundle org.eclipse.ui.workbench is invalid
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:171)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:679)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
    at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:463)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
    at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:35)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:473)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.getDeclaredMethod(Unknown Source)
    at org.eclipse.equinox.internal.ds.model.ServiceComponent.getMethod(ServiceComponent.java:148)
    at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:245)
    at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
    at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:346)
    at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:588)
    at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:196)
    at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:441)
    at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:213)
    at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:800)
    at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:767)
    at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/swt/SWTError
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:166)
    ... 30 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.SWTError
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 35 more
Root exception:
java.lang.NoClassDefFoundError: org/eclipse/swt/SWTError
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:166)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:679)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
    at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:463)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
    at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:35)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:473)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.getDeclaredMethod(Unknown Source)
    at org.eclipse.equinox.internal.ds.model.ServiceComponent.getMethod(ServiceComponent.java:148)
    at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:245)
    at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
    at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:346)
    at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:588)
    at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:196)
    at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:441)
    at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:213)
    at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:800)
    at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:767)
    at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.SWTError
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 35 more

I shall appreciate any help resolving this issue 我将不胜感激地解决这个问题

I got it resolved with the help of guys at eclipse forum. 我在Eclipse论坛上得到了大家的解决。 For detailed explanation check the link 有关详细说明,请查看链接

Solution:- 解:-

The 64 bit org.eclipse.swt.win32.win32.x86_64 bundle was not getting included in the target osgi environment. 64位org.eclipse.swt.win32.win32.x86_64软件包未包含在目标osgi环境中。

A quick test was to open osgi shell for the application 快速测试是打开该应用程序的osgi shell

Command:- application.exe -noExit -console 命令: application.exe -noExit -console

Once you are in the osgi shell, execute the command ss org.eclipse.swt 进入osgi shell后,执行命令ss org.eclipse.swt

osgi> ss org.eclipse.swt

Framework is launched.

id      State       Bundle
70      RESOLVED    org.eclipse.swt_3.7.2.v3740f
                    Fragments=71
71      RESOLVED    org.eclipse.swt.win32.win32.x86_64_3.7.2.v3740f
                    Master=70

If equinox(OSGI container) does not include 64 bit SWT bundle, you shall not see 如果Equinox(OSGI容器)不包括64位SWT包,则您将看不到
71 RESOLVED org.eclipse.swt.win32.win32.x86_64_3.7.2.v3740f Master=70 in the above command prompt. 71 RESOLVED org.eclipse.swt.win32.win32.x86_64_3.7.2.v3740f Master=70在以上命令提示符下解决71 RESOLVED org.eclipse.swt.win32.win32.x86_64_3.7.2.v3740f Master=70

I finally noticed for Target platform's equinox environment , in my feature.xml plugin specification for org.eclipse.swt.win32.win32.x86_64 and org.eclipse.equinox.launcher.win32.win32.x86_64 were not included. 我终于注意到Target platform's equinox environment ,在我的org.eclipse.swt.win32.win32.x86_64org.eclipse.equinox.launcher.win32.win32.x86_64 feature.xml插件规范中并未包括在内。

In the feature.xml file had to include the following 在feature.xml文件中必须包含以下内容

<plugin
         id="org.eclipse.swt.win32.win32.x86_64"
         os="win32"
         ws="win32"
         arch="x86_64"
         download-size="0"
         install-size="0"
         version="0.0.0"
         fragment="true"
         unpack="false"/>

   <plugin
         id="org.eclipse.equinox.launcher.win32.win32.x86_64"
         os="win32"
         ws="win32"
         arch="x86_64"
         download-size="0"
         install-size="0"
         version="0.0.0"
         fragment="true"/>    

Once I included them, the project ran fine 一旦包含它们,该项目就可以正常运行

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

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