Ole8700 / openhab

Automatically exported from code.google.com/p/openhab
GNU General Public License v3.0
1 stars 0 forks source link

Problem of Bundle Start #257

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
First of all, i introduce my function request.

I want to start a single bundle by using the OSGi Framework provided by openHAB 
runtime.

But i donnot hope my bundle has some communication with openHAB runtime.
just let openHAB runtime to start my bundle.

What steps will reproduce the problem?
1. I use eclipse IDE to produce a simple HelloWorld bundle, in class "Activator"

public class Activator implements BundleActivator {

    /*
     * (non-Javadoc)
     * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
     */
    public void start(BundleContext context) throws Exception {
        System.out.println("Hello World!!");
    }

    /*
     * (non-Javadoc)
     * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
     */
    public void stop(BundleContext context) throws Exception {
        System.out.println("Goodbye World!!");
    }

}

2. I pack the bundle into a .jar file. then, i put the .jar file to "addons" 
subdirectary. As i know that openHAB runtime will start bundles in the 
subdirectary.

3.but when i start openHAB runtime, i find that my HelloWorld bundle's status 
is "STARTING".
in the dos command line, donnot print the information "Hello World!!" defined 
by function "start"in class Activator.

so i guess openHAB runtime donnot start my bundle.

Original issue reported on code.google.com by duanruiq...@gmail.com on 27 Apr 2013 at 3:51

GoogleCodeExporter commented 9 years ago
There is no general problem with openHAB - it definitely tries to start 
whatever you put into the addons.
So the problem must be with your bundle. Reading 
http://www.osgi.org/javadoc/r4v43/core/org/osgi/framework/Bundle.html#STARTING, 
could it be the case that you defined your bundle to be lazily started?

Original comment by kai.openhab on 27 Apr 2013 at 9:17

GoogleCodeExporter commented 9 years ago
we should move over to Google-Group and try to analyse your problem in more 
detail!

Could you first the send the content of the MANIFEST.MF to the group?

Original comment by teichsta on 27 Apr 2013 at 7:24