RCP 导出失败,找不到应用程序 class

Fail on RCP export, Application class not found

我 运行 进入我的 RCP 导出 java.lang.ClassNotFoundException,我还没有成功解决。所以上下文是我正在创建一个独立的 RCP 应用程序,并通过它创建了一个 org.eclipse.core.runtime.applications extention.When 我将我的 Rcp 作为一个 eclipse 应用程序启动,一切都按我想要的那样完美运行,但是当我导出它时,我明白了 java.lang.ClassNotFoundException。在我看来,我添加了所需的依赖项并且我的 class rule.editor.rcp.Application 没问题。 这是我得到的错误日志:

!SESSION 2015-09-15 11:24:48.858 -------------------------------------------      ----
eclipse.buildId=unknown
java.version=1.8.0_51
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=fr_FR
Framework arguments:  -clearPersistedState
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -clearPersistedState -data C:/Alstom/rule_editor_rcp/rule_editor/workspace

!ENTRY org.eclipse.osgi 2 0 2015-09-15 11:25:04.048
!MESSAGE rule.editor.rcp.Application cannot be found by rule.editor.rcp_1.0.0.201509151120
!STACK 0
java.lang.ClassNotFoundException: rule.editor.rcp.Application cannot be found by rule.editor.rcp_1.0.0.201509151120
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:439)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:352)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:344)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:573)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:191)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
at org.eclipse.equinox.launcher.Main.main(Main.java:1488)

!ENTRY org.eclipse.osgi 4 0 2015-09-15 11:25:04.063
!MESSAGE Application error
!STACK 1
org.eclipse.core.runtime.CoreException: Plug-in rule.editor.rcp was unable to load class rule.editor.rcp.Application.
at    org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:191)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
Caused by: java.lang.ClassNotFoundException: rule.editor.rcp.Application cannot be found by rule.editor.rcp_1.0.0.201509151120
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:439)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:352)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:344)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:573)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
... 16 more

这是我的 Plugin.xml:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>

   <extension
         id="application"
         point="org.eclipse.core.runtime.applications">
      <application>
         <run
               class="rule.editor.rcp.Application">
     </run>
  </application>
   </extension>
   <extension
        point="org.eclipse.ui.perspectives">
      <perspective
        name="RCP Perspective"
        class="rule.editor.rcp.Perspective"
        id="rule.editor.rcp.perspective">
  </perspective>
   </extension>
   <extension
         id="product_test"
         point="org.eclipse.core.runtime.products">
      <product
            application="rule.editor.rcp.application"
            name="My Product">
         <property
               name="appName"
               value="My Product">
         </property>
         <property
               name="applicationXMI"
               value="rule.editor.rcp/Application.e4xmi">
         </property>
         <property
               name="startupProgressRect"
               value="5,275,445,15">
     </property>
     <property
           name="preferenceCustomization"
           value="plugin_customization.ini">
         </property>
      </product>
   </extension>

</plugin>

还有我的Manifest.MF:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Rcp
Bundle-SymbolicName: rule.editor.rcp;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: rule.editor.rcp.Activator
Require-Bundle: org.eclipse.debug.core,
 org.eclipse.ui.workbench,
 org.eclipse.debug.ui;bundle-version="3.11.0",
 org.eclipse.core.runtime;bundle-version="3.11.0",
 org.eclipse.e4.core.di.annotations;bundle-version="1.4.0",
 org.eclipse.swt;bundle-version="3.104.0",
 org.eclipse.jface;bundle-version="3.11.0",
 org.eclipse.ui.console;bundle-version="3.6.0",
 org.eclipse.ui.ide;bundle-version="3.11.0",
 com.jcraft.jsch;bundle-version="0.1.51",
 ch.qos.logback.classic;bundle-version="1.0.7",
 com.jscape;bundle-version="1.0.0",
 name.schedenig.eclipse.grepconsole;bundle-version="3.7.0",
 name.schedenig.eclipse.popupnotifications;bundle-version="1.0.0",
 org.drools.eclipse;bundle-version="6.2.0",
 org.eclipse.aether.maven;bundle-version="3.1.0",
 org.jboss.tools.runtime.core;bundle-version="3.1.0",
 org.eclipse.rcp;bundle-version="4.5.0",
 org.eclipse.equinox.p2.publisher;bundle-version="1.4.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: javax.annotation;version="1.0.0";resolution:=optional,
javax.inject;version="1.0.0",
rule.editor.rcp
Bundle-ActivationPolicy: lazy
Export-Package: rule.editor.rcp

这是我的 build.properties:

output.. = bin/
bin.includes = plugin.xml,\
               META-INF/,\
               Application.e4xmi,\
               icons/,\
               plugin_customization.ini,\
               bin/,\
               rule.editor.rcp.product
src.includes = icons/,\
               rule.editor.rcp.product

此外,我的产品配置是基于插件的,因此所有依赖项都在 rule.editor.rcp.product

我来了,谢谢

build.properties 应该为 class 文件指定 . 而不是 bin

output.. = bin/
bin.includes = plugin.xml,\
               META-INF/,\
               .,\
               Application.e4xmi,\
               icons/,\
               plugin_customization.ini

此外,您不需要包含

中的 rule.editor.rcp.product 文件