Closed anarak closed 5 years ago
Jay encountered the same problem yesterday too using EAVP from the p2 repository (whereas I encountered it from source code) When Jay ran the OSGi console in ICE (2.2.1RC1) and looked at the service, he got the following:
org.eclipse.eavp.viz.service_0.1.1.201701231839 [208] Id=208, Status=ACTIVE Data Root=/home/jay/ICEResearch/ice-2.2.1RC1-20170214/configuration/org.eclipse.osgi/208/data "Registered Services" {org.eclipse.eavp.viz.service.IVizServiceFactory}={service.id=310, service.bundleid=208, service.scope=bundle, component.name=org.eclipse.eavp.viz.service.factory, component.id=76}
However, when he ran my Vaadin bundle using the EAVP bundles that are in the exact same running instance of ICE (i.e. - through the native target and p2 repo, not from source), he got:
org.eclipse.eavp.viz.service_0.1.1.201701231839 [79] Id=79, Status=ACTIVE Data Root=/home/jay/Documents/anaraWorkspace/.metadata/.plugins/org.eclipse.pde.core/stable-test2/org.eclipse.osgi/79/data "No registered services."
After changing the reference cardinality from 1-1 to 0-1 in vizFactory.xml of o.e.avp.viz.service bundle, the constructor in BasicVizServiceFactory was executed, which means we were requiring at least 1 bundle (o.e.ui.IWorkbench) in the code, and because of that this constructor wasn't reachable before.
The other holdback was that the factory's register
method was calling Eclipse's ui code for associating the editors to files. Refactoring the association part solves the issue, i.e. the EAVP service becomes consumable.
Let's leave this open please. This is definitely something that we need to fix because not all projects will use Eclipse.
@anarak It would be helpful if you would open a broader ticket too so that we can track every place you are finding where similar dependencies exist.
Created #148
In 0.3, EAVP will be consumed as an http micro service using the HATEOS principle, instead of an OSGI service.
The service provider setVizServiceFactory() is not executed when launching OSGi framework.