Plugins 启动插件失败,缺少约束javax.xml.bind

Plugins 启动插件失败,缺少约束javax.xml.bind,plugins,eclipse-rcp,constraints,launching-application,Plugins,Eclipse Rcp,Constraints,Launching Application,我正在使用EclipseRCP(开普勒)编写一个Eclipse插件。一切都很正常,直到昨天晚上,当我尝试测试我的插件时,突然出现了空指针异常。下面是stacktrace的一个片段: !ENTRY org.eclipse.ui.workbench 4 2 2013-08-24 08:36:17.616 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench". !STACK 0 ja

我正在使用EclipseRCP(开普勒)编写一个Eclipse插件。一切都很正常,直到昨天晚上,当我尝试测试我的插件时,突然出现了空指针异常。下面是stacktrace的一个片段:

!ENTRY org.eclipse.ui.workbench 4 2 2013-08-24 08:36:17.616
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
!STACK 0
java.lang.NullPointerException
at org.eclipse.equinox.internal.p2.ui.sdk.scheduler.migration.MigrationSupport.getLastMigration(MigrationSupport.java:229)
at org.eclipse.equinox.internal.p2.ui.sdk.scheduler.migration.MigrationSupport.baseChangedSinceLastPresentationOfWizard(MigrationSupport.java:190)
at org.eclipse.equinox.internal.p2.ui.sdk.scheduler.migration.MigrationSupport.performMigration(MigrationSupport.java:69)
at org.eclipse.equinox.internal.p2.ui.sdk.scheduler.AutomaticUpdateScheduler.earlyStartup(AutomaticUpdateScheduler.java:89)
at org.eclipse.ui.internal.EarlyStartupRunnable.runEarlyStartup(EarlyStartupRunnable.java:87)
at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:66)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.Workbench$55.run(Workbench.java:2552)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
java.lang.NullPointerException
at org.eclipse.core.internal.runtime.InternalPlatform.getLog(InternalPlatform.java:354)
at org.eclipse.core.runtime.Plugin.getLog(Plugin.java:291)
at org.eclipse.ui.internal.WorkbenchPlugin.log(WorkbenchPlugin.java:830)
at org.eclipse.ui.statushandlers.StatusManager.logError(StatusManager.java:285)
at org.eclipse.ui.statushandlers.StatusManager.handle(StatusManager.java:200)
at org.eclipse.ui.statushandlers.StatusManager.handle(StatusManager.java:231)
at org.eclipse.ui.statushandlers.StatusManager$StatusManagerLogListener.logging(StatusManager.java:305)
at org.eclipse.core.internal.runtime.RuntimeLog.logToListeners(RuntimeLog.java:160)
at org.eclipse.core.internal.runtime.PlatformLogWriter.logged(PlatformLogWriter.java:100)
at org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.safeLogged(ExtendedLogReaderServiceFactory.java:86)
at org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.logPrivileged(ExtendedLogReaderServiceFactory.java:205)
at org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.log(ExtendedLogReaderServiceFactory.java:178)
at org.eclipse.equinox.log.internal.ExtendedLogServiceFactory.log(ExtendedLogServiceFactory.java:65)
at org.eclipse.equinox.log.internal.ExtendedLogServiceImpl.log(ExtendedLogServiceImpl.java:87)
at org.eclipse.equinox.log.internal.LoggerImpl.log(LoggerImpl.java:54)
at org.eclipse.core.internal.runtime.PlatformLogWriter.logging(PlatformLogWriter.java:43)
at org.eclipse.core.internal.runtime.RuntimeLog.log(RuntimeLog.java:96)
at org.eclipse.core.runtime.SafeRunner.handleException(SafeRunner.java:71)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:44)
at org.eclipse.ui.internal.Workbench$55.run(Workbench.java:2552)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
为了尝试找出可能发生的情况,我转到插件的启动配置,单击“验证插件”,并得到以下错误:

org.apache.xmlrpc
    Missing Constraint: Import-package: javax.xml.bind; version="0.0.0"

这可能是启动我的插件失败的原因吗?如果是,我如何修复它


谢谢

您可以右键单击项目,转到“运行方式”->“运行配置”和“插件”选项卡。单击此处的“添加所需插件”按钮,这将自动解决验证问题。

如果您正在尝试具有功能的RCP E4应用程序,请尝试在“产品->依赖项”窗格中将org.eclipse.E4.RCP添加到依赖项中。并添加“必需”。这解决了我的问题

如果您安装了EclipseLink 2.5.2,那么这是一个已知的错误:

要修复此问题,请使用此更新站点更新至最新版本: 选择比2.5.2更新的版本

注意:添加更新站点后,我必须取消选中“隐藏已安装版本”复选框才能安装,因为它似乎认为它已安装,但在我取消选中复选框时,它显示软件未安装。 安装较新版本后,请重新启动Eclipse,然后: 1.选择菜单:运行->运行配置 2.单击“添加所需捆绑包”按钮


在那之后,它应该可以正常工作了。我不得不在我的运行配置“Eclipse应用程序”中删除以下插件,以消除xmlrpc警告:

org.apache.xmlrpc
org.eclipse.mylyn.bugzilla.core
org.eclipse.mylyn.bugzilla.ui
org.eclipse.mylyn.commons.xmlrpc
xmlrpc警告已与一起出现

  • Eclipse RCP的新下载,Oxygen
  • 使用“Hello World,Command”模板创建的新插件
  • 窗口7
由于xmlrpc问题不是在控制台中出现的,而是作为一个额外的弹出窗口出现的,我发现这更令人恼火和困惑。控制台显示以下附加输出:

 SLF4J: Class path contains multiple SLF4J bindings.
    SLF4J: Found binding in [bundleresource://555.fwk1347294617:1/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: Found binding in [bundleresource://555.fwk1347294617:2/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
    SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
    08:49:41.650 [Worker-1] INFO  c.g.t.t.d.PublishedGradleVersions - Gradle version information cache is up-to-date. Trying to read.
    !SESSION 2017-09-04 08:49:32.846 -----------------------------------------------
    eclipse.buildId=4.7.0.I20170612-0950
    java.version=1.8.0_144
    java.vendor=Oracle Corporation
    BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
    Framework arguments:  -product org.eclipse.platform.ide
    Command-line arguments:  -product org.eclipse.platform.ide -data D:\eclipse\workspace/../runtime-EclipseApplication -dev file:D:/eclipse/workspace/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog

    !ENTRY org.eclipse.egit.ui 2 0 2017-09-04 08:49:41.847
    !MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
    user global configuration and to define the default location to store repositories: 'C:\Users\eis'. If this is
    not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
    EGit might behave differently since they see different configuration options.
    This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. 
这可能是启动我的插件失败的原因吗

我想不是。我的插件似乎不受这些警告的影响

  • 正如警告本身所暗示的那样,可以在Eclipse团队首选项中禁用git警告

  • 通过删除插件
    ch.qos.logback.slf4j
    ,可以解决slf4j警告问题,另请参见

如果手动更改插件选择,请小心使用验证插件功能以确保不会产生其他依赖性问题

如果安装了其他插件,您可能会看到更多警告,例如来自checkstyle的警告:

!ENTRY org.eclipse.ui 2 0 2017-09-04 10:09:32.926
!MESSAGE Warnings while parsing the commands from the 'org.eclipse.ui.commands' and 'org.eclipse.ui.actionDefinitions' extension points.
!SUBENTRY 1 org.eclipse.ui 2 0 2017-09-04 10:09:32.926
!MESSAGE Commands should really have a category: plug-in='net.sf.eclipsecs.ui', id='CheckstylePlugin.PurgeCaches', categoryId='net.sf.eclipsecs'

!ENTRY org.eclipse.ui 2 0 2017-09-04 10:09:33.622
!MESSAGE Warnings while parsing the commands from the 'org.eclipse.ui.commands' and 'org.eclipse.ui.actionDefinitions' extension points.
!SUBENTRY 1 org.eclipse.ui 2 0 2017-09-04 10:09:33.622
!MESSAGE Commands should really have a category: plug-in='net.sf.eclipsecs.ui', id='CheckstylePlugin.PurgeCaches', categoryId='net.sf.eclipsecs'
=>有点乱。因此,制作一份可以忽略的“默认”警告的副本可能是一个好主意。这样就更容易看到警告是否与您自己的插件/最近的更改有关

编辑

我为checkstyle警告提交了一个bug,多亏了Lars Koedderitzsch,它们将通过版本8.5.0得到解决:

在尝试了不同的东西之后:我做到了:

帮助>安装新软件

并添加了此存储库: 从轨道上拍摄:

选择与.javax、xml流相关的

这对我有用。 Eclipse建模工具 版本:2019-03(4.11.0)
win 10

对于Neon.2中的插件开发,我有相同的错误消息,“添加所需插件”按钮并没有解决问题。@aro_tech我只是在Neon上遇到了同样的问题。可能是因为最近更新了一些插件。插件有很多错误消息,其中一些错误消息是通过使用此按钮修复的。“产品->依赖项”是否意味着我必须使用插件MANIFEST.MF文件的编辑器?(我无法在那里添加依赖项。)或者您是否有额外的产品/功能定义?我的案例就是这样。我正在使用Eclypse版本-Leon。这可能对其他一些人有用。谢谢,Stefan。在我的例子中,根本原因是预期的Java 8包和Java 11包之间的差异(其中
javax.xml.bind
已被弃用),这个解决方法对我有效。谢谢,第一个链接保存我的插件项目。