Skip to content

#293 Fix classloader issue#367

Merged
tfesenko merged 6 commits intomasterfrom
task/293
Aug 3, 2017
Merged

#293 Fix classloader issue#367
tfesenko merged 6 commits intomasterfrom
task/293

Conversation

@tfesenko
Copy link
Copy Markdown
Member

@tfesenko tfesenko commented Aug 2, 2017

This PR fixes classloader issue described in #293 by using Orbit Jackson and eliminating import-package in MANIFEST.MF
We were previously using Jackson from the RepreZen bundles plugin. I removed it from there and added Tycho-friendly Jackson from Eclipse Orbit

How to QA

A followed the steps from here

  1. Install Eclipse Oxygen. I used a brand-new oomph p2 pool just in case.
  2. Install Eclipse Docker Tooling from Eclipse Marketplace
  3. Install Spring IDE plugins (STS) from Eclipse Marketplace

To check that the reported classpath problem is present in old builds:
4. Install KaiZen OpenAPI Editor from this update site: http://products-internal.reprezen.com/swagedit/0.8.0.201707202032. This is the latest update site which uses Jackson from RepreZen bundles.
Open a Swagger file - the editor will not be opened, Eclipse will show an error dialog.

To check that the new build fixes it:
5. Get the same Eclipse+Docker Tools + STS plugins configuration by uninstalling KaiZen editor.
6. Install KaiZen Editor using this update site: http://products-internal.reprezen.com/swagedit/0.8.0.201708021857/ . It's built on the PR.
Open a Swager or OAS3 file - the editor is opened and functioning correctly.

Overview

Target Platform

I completely removed RepreZen Bundles plugin from the target platform.

  • I added Jackson from http://download.eclipse.org/tools/orbit/downloads/drops/R20170516192513/ to the update site.
    Note: there are newer versions of Orbit libs available, we will migrate to them later.
  • SnakeYAML is also a required and shipped by Orbit. A funny thing is that it (SnakeYAML) was listed on the Orbit site, but was not visible in the target platform editor. The reason? They used a wrong label:

screen shot 2017-08-02 at 5 18 39 pm

I found it among other `bundleName`s by version.
  • Because Swagger2 model libs were provided by RepreZeb bundles, I re-added them to the [cr].swagedit/lib.

YamlErrorProcessor suffering from non-visible JacksonYAMLParseException and MarkedYAMLException

JacksonYAMLParseException and MarkedYAMLException are not Tycho-exposed in Orbit. So, had to use a hack to restore proper errors on the wrong indentation. The automated tests pass, I also manually tested it. But any new input is welcome

YAMLMapper cannot be instantiated in Tycho

While YAMLMapper is visible, using it throws an exception at runtime. The reason is that Jackson Dataformat library does not declare an OSGi dependency on Jackson Databind which is needed to initialize YAMLMapper (it extends ObjectMapper from Jackson Databind).
Replacing new YAMLMapper() with new ObjectMapper(new YAMLFactory()) solves it.

Copy link
Copy Markdown
Member

@ghillairet ghillairet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed QA, works as expected.

@tfesenko tfesenko merged commit a01d8ab into master Aug 3, 2017
@tfesenko tfesenko deleted the task/293 branch August 3, 2017 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants