我正在使用Eclipse RCP(Kepler)编写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"
这可能是启动我的插件失败的原因吗?如果是这样,我该如何解决?
谢谢
答案 0 :(得分:6)
您可以右键单击您的项目,转到Run as - >运行配置和“插件”选项卡。在这里单击Add required plug-ins按钮,这将自动解决您的验证问题。
答案 1 :(得分:6)
我必须在运行配置“Eclipse Application”中删除以下插件才能摆脱 xmlrpc警告:
org.apache.xmlrpc
org.eclipse.mylyn.bugzilla.core
org.eclipse.mylyn.bugzilla.ui
org.eclipse.mylyn.commons.xmlrpc
xmlrpc警告已经发生
由于Oxygen,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 Team首选项中禁用 git warning ,如警告本身所示。
可以通过删除插件ch.qos.logback.slf4j
解决 slf4j警告,另请参阅multiple slf4j bindings in Eclipse RCP Plugin
如果您手动更改插件选择,请注意并使用验证插件功能,以确保不会创建其他依赖项问题。
如果您安装了其他插件,您可能会看到更多警告,例如来自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警告提交了一个错误,感谢Lars Koedderitzsch他们将在8.5.0版本中得到解决: https://sourceforge.net/p/eclipse-cs/bugs/428/
答案 2 :(得分:3)
如果您安装了EclipseLink 2.5.2,那么这是一个已知错误:https://bugs.eclipse.org/bugs/show_bug.cgi?id=456174
要修复此问题,请使用此更新站点更新到最新版本:http://download.eclipse.org/rt/eclipselink/updates/ 选择比2.5.2更新的版本
注意:我必须取消选中"隐藏已安装的版本"添加更新站点之后要安装的复选框,因为它似乎认为它已安装,但是当我取消选中该框时它显示该软件未安装。 安装新版本后,重新启动Eclipse,然后: 1.选择菜单:运行 - >运行配置 2.单击按钮"添加必需的捆绑包"
之后一切正常
答案 3 :(得分:1)
如果您正在尝试使用功能的RCP E4应用程序,请尝试将org.eclipse.e4.rcp添加到产品中的依赖项 - >依赖关系窗格。并做“添加所需”。这解决了我的问题
答案 4 :(得分:0)
尝试了其他方法之后:我做了:
help>安装新软件
并添加了此存储库: http://download.eclipse.org/tools/orbit/downloads/drops/R20190226160451/repository 取自轨道:https://download.eclipse.org/tools/orbit/downloads/drops/R20190226160451/
选择与.javax,xml流相关的内容
对我有用。 Eclipse建模工具 版本:2019-03(4.11.0) 赢得10