[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] tycho-demo pom first: the bundle except test bundle not started

Did you add Bundle-Activator and Bundle-ActivationPolicy to relevant
bundle manifests? For pom-first projects this should be done through
pom.xml configuration, check maven-bundle-plugin documentation for more

If you really need to force start bundles during test execution, you can
do this with <bundleStartLevel> tycho-surefire-plugin configuration
parameter, something like


-- Regards, Igor

On 12-07-17 12:05 AM, Guofeng Zhang wrote:

I clone the tycho demo application and tried itp02 for pom first dependency.

The demo works well following the instruction on

Now I make some modification to the demo. I let PomFirst and ITP02 to be
a registered service by its Activator. The IT02Test changed as the

public class ITP02Test {


     public void basic() {

         ITP02 testee = getITP02();

         Assert.assertEquals("maven-bundle-plugin", testee.getMessage());


             private ITP02 getITP02() {

                             ServiceReference<ITP02> ref =
Activator.getContext().getServiceReference(ITP02.class ) ;

                             return Activator.getContext().getService(ref );



When run the test by Maven, I got the following error:

Tests in error:

   basic(tycho.demo.itp02.bundle.tests.ITP02Test): A null service
reference is not allowed.

I think this is because pomfirst-bundle and tycho.demo.itp02.bundle are
not started (not console output from their activators), so the required
services are not registered.

I cannot figure out why the two bundles are not started, by analyzing
config.ini, the two bundles are listed in osgi.bundles, but without

How to solve this issue?

Thanks for your help.


tycho-user mailing list