Hi Karl!

After catching Throwable and Exception as well my output looks like this:

trying to stop bundle 7 <- vehicle 1055293 left the scenario => reset of
framework 1
bundle 7 was stopped <- reset of application
try to uninstall bundle 7
bundle 7 was uninstalled
trying to install
file:/home/markus/bundles/application/VehicleBeaconingApp_1.0.0.jar
file:/home/markus/bundles/application/VehicleBeaconingApp_1.0.0.jar was
installed
vehicle id 1055293 successfully unbounded from framework 1
trying to start bundle 7 <- new vehicle tries to bind to framework 1 =>
start of application
exception java.lang.IllegalStateException: Cannot start an uninstalled
bundle.
bundle 7 was started
error: bundle 7 is not running

Mhhh, the exception doesn't really make sense, because the application
(bundle 7) should be in the state INSTALLED, when the vehicle tries to start
it. Maybe the process of stopping / uninstalling and reinstalled the bundles
takes internally longer than I exspect from the output?!?

BTW: Currently I'm not sure if the new vehicle contacts my framework handler
using the same thread. So maybe I have to synchronize same parts of my code,
too ... I will think about that more detailed tomorrow ...

BR,

Markus

2009/9/16 Karl Pauls <[email protected]>

> Can't you catch Throwable as well and give us a stacktrace of whatever
> exception/error gets thrown by the start() method?
>
> regards,
>
> Karl
>
> On Wed, Sep 16, 2009 at 3:48 PM, Markus Michel
> <[email protected]> wrote:
> > Hi there!
> >
> > Here's a short explanation, how my program is working:
> >
> > Inside my program I using a FrameworkHandler class to control a pool of
> OSGi
> > instances, which represents vehicles of a traffic simulation, For every
> > instances I using three BundleHandler ( system, user, application) to
> > install / uninstall / start / stop a list of bundles. When the program is
> > started the pool is initialized and all system (OSGi services, Shell ..)
> and
> > user (my services) bundles are installed and started. Everytime (if there
> is
> > a free instance) there is a new vehicle, my program binds it to an
> instance
> > of the pool and installs / started an application, which should be
> running
> > on this vehicle using the application bundle handler. If the vehicles
> leaves
> > the scenario, the program resets the application by stopping, uninstalled
> > and reinstalling the corresponding bundles. Afterwards a new vehicle can
> be
> > bound the same instance.
> >
> > My problem is that currently my program seems to hang into a loop, when
> the
> > application bundle is started after it was reset. By doing some printouts
> I
> > know that the problem occurs into that code block:
> >
> >            // start bundle
> >            try
> >            {
> >                bundle.start();
> >            }
> >            catch (BundleException e)
> >            {
> >                System.out.println("error: could not start bundle " +
> > bundle.getBundleId());
> >                System.out.println(e);
> >                System.exit(1);
> >            }
> >
> > I'm not sure what really happens, because there is no bundle exception,
> > although the error occurs inside the call of the start method. Isn't it
> > possible to "reset" an OSGi bundle?
> >
> > Because I though that my problem might be a bug of the framework i
> already
> > upgraded my program to the new felix version 2.0.0, but the problem still
> > appears ...
> >
> > BR,
> >
> > Markus
> >
>
>
>
> --
> Karl Pauls
> [email protected]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to