Запуск плагина с ошибкой, отсутствие ограничения javax.xml.bind - программирование
Подтвердить что ты не робот

Запуск плагина с ошибкой, отсутствие ограничения javax.xml.bind

Я пишу плагин Eclipse, используя Eclipse RCP (Kepler). Все отлично работало до последней ночи, и внезапно я начал получать исключения нулевого указателя при попытке проверить мой плагин. Вот фрагмент 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)

Чтобы попытаться выяснить, что может произойти, я пошел в конфигурацию запуска для своего плагина и нажал "Validate Plug-ins" и получил следующую ошибку:

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

missing constraint

Может ли это быть причиной запуска моего плагина? Если да, то как это исправить?

Спасибо

4b9b3361

Ответ 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"
  • Windows7

Так как 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. 

Может ли это быть причиной запуска моего плагина?

Думаю, нет. На мои плагины, похоже, не влияют эти предупреждения.

  • Предупреждение git может быть отключено в настройках Eclipse Team, как предполагает само предупреждение.

  • Предупреждение slf4j можно устранить, удалив плагин ch.qos.logback.slf4j, также см. несколько привязок slf4j в плагине Eclipse RCP

Если вы вручную измените выбор плагина, будьте осторожны и используйте функцию Проверять подключаемые модули, чтобы убедиться, что вы не создаете другие проблемы с зависимостями.

Если у вас установлены дополнительные плагины, вы можете увидеть еще больше предупреждений, например. от 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'

= > Это вроде беспорядок. Поэтому было бы неплохо сделать копию предупреждений по умолчанию, которые можно игнорировать. Тогда будет легче увидеть, связано ли предупреждение с вашими собственными плагинами/недавними изменениями.

Edit

Я подал ошибку для предупреждений checkstyle, и благодаря Ларсу Кодедрицчу они будут решены с версией 8.5.0: https://sourceforge.net/p/eclipse-cs/bugs/428/

Ответ 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. Выберите меню: Run → Run Configurations 2. Нажмите кнопку "Добавить необходимые связки"

После этого все должно работать нормально

Ответ 4

Если вы пытаетесь использовать приложение RCP E4 с функциями, попробуйте добавить org.eclipse.e4.rcp в свои зависимости в панели продуктов → зависимостей. И "добавить обязательно". Это решило мою проблему.