2015-09-15 118 views
0

因此,我正在運行到我的RCP導出中的java.lang.ClassNotFoundException,我沒有成功解析。所以上下文是我正在創建一個獨立的RCP應用程序,並通過該應用程序創建了一個org.eclipse.core.runtime.applications擴展。當我將Rcp作爲eclipse應用程序啓動時,所有功能都可以正常工作,但是當我導出它,我得到這個java.lang.ClassNotFoundException。在我看來,我添加了所需的依賴關係,並且我的類class.editor.rcp.Application沒問題。 這是錯誤日誌中我得到:RCP導出失敗,Apllication類未找到

!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

我在這裏,謝謝

回答

0

下的build.properties應該指定.而非bin爲類文件:

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

而且你不需要rule.editor.rcp.product文件中包括

+0

謝謝@格雷格-449解決了我的問題! –

相關問題