简体   繁体   English

Eclipse rcp 导出产品抛出 NullPointerException

[英]Eclipse rcp export product throws NullPointerException

I have eclipse rcp project, I want to export it and make executable.我有 eclipse rcp 项目,我想导出它并使其可执行。 I do Export an Eclipse product via product file.我确实通过产品文件Export an Eclipse product As result I get catalog with plugins, other files and MyApp.exe but when I run exe file, In log I get such message.结果,我得到了带有插件、其他文件和MyApp.exe目录,但是当我运行 exe 文件时,在日志中我收到了这样的消息。 Maybe someone can tell me what could be the reason of this exception?也许有人可以告诉我这个例外的原因是什么?

!ENTRY org.eclipse.equinox.app 0 0 2016-09-18 15:05:10.837
!MESSAGE Product myapp.product could not be found.

!ENTRY org.eclipse.osgi 4 0 2016-09-18 14:06:41.616
    !MESSAGE Application error
    !STACK 1
    java.lang.NullPointerException
        at org.eclipse.emf.common.util.URI$URIPool$PlatformAccessUnit.setValue(URI.java:865)
        at org.eclipse.emf.common.util.URI$URIPool.intern(URI.java:1949)
        at org.eclipse.emf.common.util.URI.createPlatformPluginURI(URI.java:2718)
        at org.eclipse.e4.ui.internal.workbench.swt.E4Application.determineApplicationModelURI(E4Application.java:407)
        at org.eclipse.e4.ui.internal.workbench.swt.E4Application.loadApplicationModel(E4Application.java:348)
        at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:252)
        at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:148)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        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:388)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
        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:498)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1519)

Product myapp.product could not be found is the key message here - your exported product doesn't seem to contain your product definition (perhaps the plugin is missing). Product myapp.product could not be found是此处的关键信息 - 您导出的产品似乎不包含您的产品定义(可能缺少插件)。 The crash is caused because the product couldn't be found.崩溃是因为找不到产品造成的。

Make sure that your xxx.product file contains all your plugins plus all the Eclipse RCP plugins that they depend on (you can use the 'Add Required' button to work this out).确保您的xxx.product文件包含您的所有插件以及它们所依赖的所有 Eclipse RCP 插件(您可以使用“添加所需”按钮来解决这个问题)。

I was facing similar problems, when following the tutorial from vogella在遵循vogella的教程时,我遇到了类似的问题

Make sure the plugin defining your product "myapp.product" is also included in the product configuration.确保定义您的产品“myapp.product”的插件也包含在产品配置中。 So, if your product configuration is based on features, you need to add the "myapp.product" plugin inside a feature.因此,如果您的产品配置基于功能,则需要在功能中添加“myapp.product”插件。 Otherwise, it is not part of the packaging.否则,它不是包装的一部分。

See Maven Tycho RCP Product Not Found After Moving Folder请参阅移动文件夹后未找到 Maven Tycho RCP 产品

I ran into the same exact error and was initially misled by the "product not found error message".我遇到了完全相同的错误,最初被“未找到产品错误消息”误导。 After tracing the stacktrace and the Eclipse source code I realized that when I dropped my Application.e4xmi into the ui plugin project I hadn't added it to the build.properties file so that it would get packaged in the jar.在跟踪堆栈跟踪和 Eclipse 源代码后,我意识到当我将 Application.e4xmi 放入 ui 插件项目时,我没有将它添加到 build.properties 文件中,以便将它打包到 jar 中。 Once I did that it worked as expected.一旦我这样做了,它就会按预期工作。

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

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