TestRoots / watchdog

IntelliJ & Eclipse plugin for monitoring how Java applications are developed and tested
http://www.testroots.org
Other
18 stars 10 forks source link

Fix imports and exports of org.jfree in osgi bundles #308

Closed TimvdLippe closed 6 years ago

TimvdLippe commented 6 years ago

Finally I was able to figure it out to bring the WatchDogView back to life in Eclipse: image

Apparently the inclusion of the org.jfree dependencies in core were breaking the Eclipse plugin. I suspect that this dependency was clashing, because core was actually not relying on any of its imports. E.g. because core does not import from org.jfree, it would "discard" the dependency and not shade. However, when the eclipse.plugin then loads the clash, it would incorrectly load the core version.

Fixes #304

TimvdLippe commented 6 years ago

Ugh, Eclipse was just fine, but apparently mvn now complains. Investigating....

TimvdLippe commented 6 years ago

All right, it should be fixed now. The core issue was the following:

core and eclipse.plugin both included jcommon and jfreechart on their Bundle-Classpath. Therefore, the ClassLoader would clash, as it would load certain classes in the core plugin, while other classes are loaded in the eclipse.plugin plugin.

The fix is to make eclipse.plugin aware of the fact that core already has the classes available. To do so, all required packages must be imported there and consequently exported from core.

These shenanigans are all necessary because all these packages do not have proper OSGi support, so we have to do it ourselves :cry: