You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Rajini Sivaram <ra...@googlemail.com> on 2007/06/27 16:46:41 UTC

Framework listener is not invoked after Felix is restarted

Hello,

I have a set of JUnit tests which startup a Felix runtime in the setUp
method and shut the runtime down using Felix.shutdown(). The tests run fine
when run one-by-one (single Felix runtime startup and shutdown in a VM), but
when run together (as a sequence of Felix runtime startup and shutdown from
one VM), the framework listener is not called after the first shutdown.
Apart from the framework listener, other operations dont run into any
problems with the restarting of the runtime, so I presume restarting the
embedded runtime is not a problem.

Is this something which will get fixed with the changes to the embedded
APIs?


Thank you...

Regards,

Rajini

Re: Framework listener is not invoked after Felix is restarted

Posted by Felix Meschberger <Fe...@day.com>.
Hi Richard,

No, missed that one. Will do it of course.

Regards
Felix

On 6/30/07, Richard S. Hall <he...@ungoverned.org> wrote:
>
> Felix,
>
> Did you also deploy main.jar? When framework.jar it generally means
> that we should deploy main.jar too, since they are essentially the
> same JAR minus the launcher.
>
> -> richard
>
> On Jun 29, 2007, at 10:55 AM, Felix Meschberger wrote:
>
> > Hi Rajini,
> >
> > I deployed a new build of the org.apache.felix.framework JAR file
> > to the
> > Apache Snapshot repository. Could you please verify, that it now
> > works (my
> > tests show success, just want to be sure).
> >
> > Regards
> > Felix
> >
> > On 6/28/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> >>
> >> Thank you, Felix.
> >>
> >>
> >>
> >> On 6/28/07, Felix Meschberger <Fe...@day.com> wrote:
> >> >
> >> > Hi Rajini,
> >> >
> >> > Thanks for providing the test case.
> >> >
> >> > It turns out, that you discovered a subtle issue with the Felix
> >> > EventDispatcher !
> >> >
> >> > Let me explain quickly: If you start the framework, ane
> >> EventDispatcher
> >> > instance is created and a dispatcher thread is started. When the
> >> framework
> >> > is stopped, the EventDispatcher thread is stopped and internal
> >> flags of
> >> > the
> >> > EventDispatcher are set. Both, the thread and the flags are static
> >> > variables. If you now create a new Felix instance (without
> >> changing the
> >> > class loaders) the EventDispatcher static variables are not
> >> reset and
> >> > hence
> >> > the second (and any further) Felix instance started will not
> >> dispatch
> >> any
> >> > asynchronous events at all.
> >> >
> >> > I will report an issue for this.
> >> >
> >> > Regards
> >> > Felix
> >> >
> >> > On 6/28/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> >> > >
> >> > > Felix,
> >> > >
> >> > > A test program is attached. If run without any changes, no
> >> events are
> >> > > received by the framework listener.
> >> > >
> >> > > If you comment out the first start and shutdown in the main
> >> method,
> >> one
> >> > > event is received. If felix.shutdown() is not called inside
> >> > > shutdownFelixRuntime, the event is received even with the new
> >> Felix
> >> > > instance.
> >> > >
> >> > > Thank you...
> >> > >
> >> > > Regards,
> >> > >
> >> > > Rajini
> >> > >
> >> > >
> >> > > On 6/28/07, Felix Meschberger <Fe...@day.com> wrote:
> >> > > >
> >> > > > Hi Rajini,
> >> > > >
> >> > > > Then it is strange, that it is not called ...
> >> > > >
> >> > > > Do you have some sample code you might share for a quick
> >> code review
> >> ?
> >> > > >
> >> > > > Regards
> >> > > > Felix
> >> > > >
> >> > > > On 6/27/07, Rajini Sivaram <ra...@googlemail.com>
> >> wrote:
> >> > > > >
> >> > > > > Felix,
> >> > > > >
> >> > > > > I create a new instance of Felix each time. Once shutdown is
> >> called,
> >> > > > the
> >> > > > > instance of Felix and the system bundle context are not
> >> used again
> >> .
> >> > A
> >> > > > > framework listener is created for the system bundle
> >> context every
> >> > time
> >> > > > the
> >> > > > > runtime is restarted, but it doesn't get invoked at all
> >> after the
> >> > > > first
> >> > > > > shutdown.
> >> > > > >
> >> > > > >
> >> > > > > Thank you...
> >> > > > >
> >> > > > > Regards,
> >> > > > >
> >> > > > > Rajini
> >> > > > >
> >> > > > > On 6/27/07, Felix Meschberger <Felix.Meschberger@day.com >
> >> wrote:
> >> > > > > >
> >> > > > > > Hi Rajini,
> >> > > > > >
> >> > > > > > How do you restart the framework ? Do you create the Felix
> >> > instance
> >> > > > anew
> >> > > > > > for
> >> > > > > > each framework start or do start-stop the same instance
> >> multiple
> >> > > > times ?
> >> > > > > >
> >> > > > > > For better replicability and also in view of the changes
> >> that
> >> > > > Richard is
> >> > > > > > currently implementing, I suggest you do not reuse the
> >> Felix
> >> > > > instances
> >> > > > > but
> >> > > > > > instead recreate a new instance for each start-stop cycle.
> >> > > > > >
> >> > > > > > Anyway, I assume, that you have to register the framework
> >> listener
> >> > > > each
> >> > > > > > time
> >> > > > > > you start Felix.
> >> > > > > >
> >> > > > > > Hope this helps
> >> > > > > >
> >> > > > > > Regards
> >> > > > > > Felix
> >> > > > > >
> >> > > > > > On 6/27/07, Rajini Sivaram
> >> <ra...@googlemail.com> wrote:
> >> > > > > > >
> >> > > > > > > Hello,
> >> > > > > > >
> >> > > > > > > I have a set of JUnit tests which startup a Felix
> >> runtime in
> >> the
> >> > > > setUp
> >> > > > > > > method and shut the runtime down using Felix.shutdown
> >> (). The
> >> > tests
> >> > > > run
> >> > > > > > > fine
> >> > > > > > > when run one-by-one (single Felix runtime startup and
> >> shutdown
> >> > in
> >> > > > a
> >> > > > > VM),
> >> > > > > > > but
> >> > > > > > > when run together (as a sequence of Felix runtime
> >> startup and
> >> > > > shutdown
> >> > > > > > > from
> >> > > > > > > one VM), the framework listener is not called after
> >> the first
> >> > > > > shutdown.
> >> > > > > > > Apart from the framework listener, other operations
> >> dont run
> >> > into
> >> > > > any
> >> > > > > > > problems with the restarting of the runtime, so I presume
> >> > > > restarting
> >> > > > > the
> >> > > > > > > embedded runtime is not a problem.
> >> > > > > > >
> >> > > > > > > Is this something which will get fixed with the
> >> changes to the
> >> > > > > embedded
> >> > > > > > > APIs?
> >> > > > > > >
> >> > > > > > >
> >> > > > > > > Thank you...
> >> > > > > > >
> >> > > > > > > Regards,
> >> > > > > > >
> >> > > > > > > Rajini
> >> > > > > > >
> >> > > > > >
> >> > > > >
> >> > > >
> >> > >
> >> > >
> >> > >
> >> >
> >>
> >>
> >>
> >> --
> >> Thank you...
> >>
> >> Regards,
> >>
> >> Rajini
> >>
>
>

Re: Framework listener is not invoked after Felix is restarted

Posted by Felix Meschberger <Fe...@day.com>.
Ok, also deployed Felix main.

Regards
Felix

On 6/30/07, Richard S. Hall <he...@ungoverned.org> wrote:
>
> Felix,
>
> Did you also deploy main.jar? When framework.jar it generally means
> that we should deploy main.jar too, since they are essentially the
> same JAR minus the launcher.
>
> -> richard
>
> On Jun 29, 2007, at 10:55 AM, Felix Meschberger wrote:
>
> > Hi Rajini,
> >
> > I deployed a new build of the org.apache.felix.framework JAR file
> > to the
> > Apache Snapshot repository. Could you please verify, that it now
> > works (my
> > tests show success, just want to be sure).
> >
> > Regards
> > Felix
> >
> > On 6/28/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> >>
> >> Thank you, Felix.
> >>
> >>
> >>
> >> On 6/28/07, Felix Meschberger <Fe...@day.com> wrote:
> >> >
> >> > Hi Rajini,
> >> >
> >> > Thanks for providing the test case.
> >> >
> >> > It turns out, that you discovered a subtle issue with the Felix
> >> > EventDispatcher !
> >> >
> >> > Let me explain quickly: If you start the framework, ane
> >> EventDispatcher
> >> > instance is created and a dispatcher thread is started. When the
> >> framework
> >> > is stopped, the EventDispatcher thread is stopped and internal
> >> flags of
> >> > the
> >> > EventDispatcher are set. Both, the thread and the flags are static
> >> > variables. If you now create a new Felix instance (without
> >> changing the
> >> > class loaders) the EventDispatcher static variables are not
> >> reset and
> >> > hence
> >> > the second (and any further) Felix instance started will not
> >> dispatch
> >> any
> >> > asynchronous events at all.
> >> >
> >> > I will report an issue for this.
> >> >
> >> > Regards
> >> > Felix
> >> >
> >> > On 6/28/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> >> > >
> >> > > Felix,
> >> > >
> >> > > A test program is attached. If run without any changes, no
> >> events are
> >> > > received by the framework listener.
> >> > >
> >> > > If you comment out the first start and shutdown in the main
> >> method,
> >> one
> >> > > event is received. If felix.shutdown() is not called inside
> >> > > shutdownFelixRuntime, the event is received even with the new
> >> Felix
> >> > > instance.
> >> > >
> >> > > Thank you...
> >> > >
> >> > > Regards,
> >> > >
> >> > > Rajini
> >> > >
> >> > >
> >> > > On 6/28/07, Felix Meschberger <Fe...@day.com> wrote:
> >> > > >
> >> > > > Hi Rajini,
> >> > > >
> >> > > > Then it is strange, that it is not called ...
> >> > > >
> >> > > > Do you have some sample code you might share for a quick
> >> code review
> >> ?
> >> > > >
> >> > > > Regards
> >> > > > Felix
> >> > > >
> >> > > > On 6/27/07, Rajini Sivaram <ra...@googlemail.com>
> >> wrote:
> >> > > > >
> >> > > > > Felix,
> >> > > > >
> >> > > > > I create a new instance of Felix each time. Once shutdown is
> >> called,
> >> > > > the
> >> > > > > instance of Felix and the system bundle context are not
> >> used again
> >> .
> >> > A
> >> > > > > framework listener is created for the system bundle
> >> context every
> >> > time
> >> > > > the
> >> > > > > runtime is restarted, but it doesn't get invoked at all
> >> after the
> >> > > > first
> >> > > > > shutdown.
> >> > > > >
> >> > > > >
> >> > > > > Thank you...
> >> > > > >
> >> > > > > Regards,
> >> > > > >
> >> > > > > Rajini
> >> > > > >
> >> > > > > On 6/27/07, Felix Meschberger <Felix.Meschberger@day.com >
> >> wrote:
> >> > > > > >
> >> > > > > > Hi Rajini,
> >> > > > > >
> >> > > > > > How do you restart the framework ? Do you create the Felix
> >> > instance
> >> > > > anew
> >> > > > > > for
> >> > > > > > each framework start or do start-stop the same instance
> >> multiple
> >> > > > times ?
> >> > > > > >
> >> > > > > > For better replicability and also in view of the changes
> >> that
> >> > > > Richard is
> >> > > > > > currently implementing, I suggest you do not reuse the
> >> Felix
> >> > > > instances
> >> > > > > but
> >> > > > > > instead recreate a new instance for each start-stop cycle.
> >> > > > > >
> >> > > > > > Anyway, I assume, that you have to register the framework
> >> listener
> >> > > > each
> >> > > > > > time
> >> > > > > > you start Felix.
> >> > > > > >
> >> > > > > > Hope this helps
> >> > > > > >
> >> > > > > > Regards
> >> > > > > > Felix
> >> > > > > >
> >> > > > > > On 6/27/07, Rajini Sivaram
> >> <ra...@googlemail.com> wrote:
> >> > > > > > >
> >> > > > > > > Hello,
> >> > > > > > >
> >> > > > > > > I have a set of JUnit tests which startup a Felix
> >> runtime in
> >> the
> >> > > > setUp
> >> > > > > > > method and shut the runtime down using Felix.shutdown
> >> (). The
> >> > tests
> >> > > > run
> >> > > > > > > fine
> >> > > > > > > when run one-by-one (single Felix runtime startup and
> >> shutdown
> >> > in
> >> > > > a
> >> > > > > VM),
> >> > > > > > > but
> >> > > > > > > when run together (as a sequence of Felix runtime
> >> startup and
> >> > > > shutdown
> >> > > > > > > from
> >> > > > > > > one VM), the framework listener is not called after
> >> the first
> >> > > > > shutdown.
> >> > > > > > > Apart from the framework listener, other operations
> >> dont run
> >> > into
> >> > > > any
> >> > > > > > > problems with the restarting of the runtime, so I presume
> >> > > > restarting
> >> > > > > the
> >> > > > > > > embedded runtime is not a problem.
> >> > > > > > >
> >> > > > > > > Is this something which will get fixed with the
> >> changes to the
> >> > > > > embedded
> >> > > > > > > APIs?
> >> > > > > > >
> >> > > > > > >
> >> > > > > > > Thank you...
> >> > > > > > >
> >> > > > > > > Regards,
> >> > > > > > >
> >> > > > > > > Rajini
> >> > > > > > >
> >> > > > > >
> >> > > > >
> >> > > >
> >> > >
> >> > >
> >> > >
> >> >
> >>
> >>
> >>
> >> --
> >> Thank you...
> >>
> >> Regards,
> >>
> >> Rajini
> >>
>
>

Re: Framework listener is not invoked after Felix is restarted

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Felix,

Did you also deploy main.jar? When framework.jar it generally means  
that we should deploy main.jar too, since they are essentially the  
same JAR minus the launcher.

-> richard

On Jun 29, 2007, at 10:55 AM, Felix Meschberger wrote:

> Hi Rajini,
>
> I deployed a new build of the org.apache.felix.framework JAR file  
> to the
> Apache Snapshot repository. Could you please verify, that it now  
> works (my
> tests show success, just want to be sure).
>
> Regards
> Felix
>
> On 6/28/07, Rajini Sivaram <ra...@googlemail.com> wrote:
>>
>> Thank you, Felix.
>>
>>
>>
>> On 6/28/07, Felix Meschberger <Fe...@day.com> wrote:
>> >
>> > Hi Rajini,
>> >
>> > Thanks for providing the test case.
>> >
>> > It turns out, that you discovered a subtle issue with the Felix
>> > EventDispatcher !
>> >
>> > Let me explain quickly: If you start the framework, ane  
>> EventDispatcher
>> > instance is created and a dispatcher thread is started. When the
>> framework
>> > is stopped, the EventDispatcher thread is stopped and internal  
>> flags of
>> > the
>> > EventDispatcher are set. Both, the thread and the flags are static
>> > variables. If you now create a new Felix instance (without  
>> changing the
>> > class loaders) the EventDispatcher static variables are not  
>> reset and
>> > hence
>> > the second (and any further) Felix instance started will not  
>> dispatch
>> any
>> > asynchronous events at all.
>> >
>> > I will report an issue for this.
>> >
>> > Regards
>> > Felix
>> >
>> > On 6/28/07, Rajini Sivaram <ra...@googlemail.com> wrote:
>> > >
>> > > Felix,
>> > >
>> > > A test program is attached. If run without any changes, no  
>> events are
>> > > received by the framework listener.
>> > >
>> > > If you comment out the first start and shutdown in the main  
>> method,
>> one
>> > > event is received. If felix.shutdown() is not called inside
>> > > shutdownFelixRuntime, the event is received even with the new  
>> Felix
>> > > instance.
>> > >
>> > > Thank you...
>> > >
>> > > Regards,
>> > >
>> > > Rajini
>> > >
>> > >
>> > > On 6/28/07, Felix Meschberger <Fe...@day.com> wrote:
>> > > >
>> > > > Hi Rajini,
>> > > >
>> > > > Then it is strange, that it is not called ...
>> > > >
>> > > > Do you have some sample code you might share for a quick  
>> code review
>> ?
>> > > >
>> > > > Regards
>> > > > Felix
>> > > >
>> > > > On 6/27/07, Rajini Sivaram <ra...@googlemail.com>  
>> wrote:
>> > > > >
>> > > > > Felix,
>> > > > >
>> > > > > I create a new instance of Felix each time. Once shutdown is
>> called,
>> > > > the
>> > > > > instance of Felix and the system bundle context are not  
>> used again
>> .
>> > A
>> > > > > framework listener is created for the system bundle  
>> context every
>> > time
>> > > > the
>> > > > > runtime is restarted, but it doesn't get invoked at all  
>> after the
>> > > > first
>> > > > > shutdown.
>> > > > >
>> > > > >
>> > > > > Thank you...
>> > > > >
>> > > > > Regards,
>> > > > >
>> > > > > Rajini
>> > > > >
>> > > > > On 6/27/07, Felix Meschberger <Felix.Meschberger@day.com >  
>> wrote:
>> > > > > >
>> > > > > > Hi Rajini,
>> > > > > >
>> > > > > > How do you restart the framework ? Do you create the Felix
>> > instance
>> > > > anew
>> > > > > > for
>> > > > > > each framework start or do start-stop the same instance  
>> multiple
>> > > > times ?
>> > > > > >
>> > > > > > For better replicability and also in view of the changes  
>> that
>> > > > Richard is
>> > > > > > currently implementing, I suggest you do not reuse the  
>> Felix
>> > > > instances
>> > > > > but
>> > > > > > instead recreate a new instance for each start-stop cycle.
>> > > > > >
>> > > > > > Anyway, I assume, that you have to register the framework
>> listener
>> > > > each
>> > > > > > time
>> > > > > > you start Felix.
>> > > > > >
>> > > > > > Hope this helps
>> > > > > >
>> > > > > > Regards
>> > > > > > Felix
>> > > > > >
>> > > > > > On 6/27/07, Rajini Sivaram  
>> <ra...@googlemail.com> wrote:
>> > > > > > >
>> > > > > > > Hello,
>> > > > > > >
>> > > > > > > I have a set of JUnit tests which startup a Felix  
>> runtime in
>> the
>> > > > setUp
>> > > > > > > method and shut the runtime down using Felix.shutdown 
>> (). The
>> > tests
>> > > > run
>> > > > > > > fine
>> > > > > > > when run one-by-one (single Felix runtime startup and  
>> shutdown
>> > in
>> > > > a
>> > > > > VM),
>> > > > > > > but
>> > > > > > > when run together (as a sequence of Felix runtime  
>> startup and
>> > > > shutdown
>> > > > > > > from
>> > > > > > > one VM), the framework listener is not called after  
>> the first
>> > > > > shutdown.
>> > > > > > > Apart from the framework listener, other operations  
>> dont run
>> > into
>> > > > any
>> > > > > > > problems with the restarting of the runtime, so I presume
>> > > > restarting
>> > > > > the
>> > > > > > > embedded runtime is not a problem.
>> > > > > > >
>> > > > > > > Is this something which will get fixed with the  
>> changes to the
>> > > > > embedded
>> > > > > > > APIs?
>> > > > > > >
>> > > > > > >
>> > > > > > > Thank you...
>> > > > > > >
>> > > > > > > Regards,
>> > > > > > >
>> > > > > > > Rajini
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> > >
>> > >
>> >
>>
>>
>>
>> --
>> Thank you...
>>
>> Regards,
>>
>> Rajini
>>


Re: Framework listener is not invoked after Felix is restarted

Posted by Felix Meschberger <Fe...@day.com>.
Hi Rajini,

Thanks for your feedback. So I will close the issue.

Regards
Felix

On 6/29/07, Rajini Sivaram <ra...@googlemail.com> wrote:
>
> Felix,
>
> Yes, the new jar works fine for me. Thank you very much!
>
>
> Thank you...
>
> Regards,
>
> Rajini
>
>
> On 6/29/07, Felix Meschberger <Fe...@day.com> wrote:
> >
> > Hi Rajini,
> >
> > I deployed a new build of the org.apache.felix.framework JAR file to the
> > Apache Snapshot repository. Could you please verify, that it now works
> (my
> > tests show success, just want to be sure).
> >
> > Regards
> > Felix
> >
> > On 6/28/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> > >
> > > Thank you, Felix.
> > >
> > >
> > >
> > > On 6/28/07, Felix Meschberger <Fe...@day.com> wrote:
> > > >
> > > > Hi Rajini,
> > > >
> > > > Thanks for providing the test case.
> > > >
> > > > It turns out, that you discovered a subtle issue with the Felix
> > > > EventDispatcher !
> > > >
> > > > Let me explain quickly: If you start the framework, ane
> > EventDispatcher
> > > > instance is created and a dispatcher thread is started. When the
> > > framework
> > > > is stopped, the EventDispatcher thread is stopped and internal flags
> > of
> > > > the
> > > > EventDispatcher are set. Both, the thread and the flags are static
> > > > variables. If you now create a new Felix instance (without changing
> > the
> > > > class loaders) the EventDispatcher static variables are not reset
> and
> > > > hence
> > > > the second (and any further) Felix instance started will not
> dispatch
> > > any
> > > > asynchronous events at all.
> > > >
> > > > I will report an issue for this.
> > > >
> > > > Regards
> > > > Felix
> > > >
> > > > On 6/28/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> > > > >
> > > > > Felix,
> > > > >
> > > > > A test program is attached. If run without any changes, no events
> > are
> > > > > received by the framework listener.
> > > > >
> > > > > If you comment out the first start and shutdown in the main
> method,
> > > one
> > > > > event is received. If felix.shutdown() is not called inside
> > > > > shutdownFelixRuntime, the event is received even with the new
> Felix
> > > > > instance.
> > > > >
> > > > > Thank you...
> > > > >
> > > > > Regards,
> > > > >
> > > > > Rajini
> > > > >
> > > > >
> > > > > On 6/28/07, Felix Meschberger <Fe...@day.com> wrote:
> > > > > >
> > > > > > Hi Rajini,
> > > > > >
> > > > > > Then it is strange, that it is not called ...
> > > > > >
> > > > > > Do you have some sample code you might share for a quick code
> > review
> > > ?
> > > > > >
> > > > > > Regards
> > > > > > Felix
> > > > > >
> > > > > > On 6/27/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> > > > > > >
> > > > > > > Felix,
> > > > > > >
> > > > > > > I create a new instance of Felix each time. Once shutdown is
> > > called,
> > > > > > the
> > > > > > > instance of Felix and the system bundle context are not used
> > again
> > > .
> > > > A
> > > > > > > framework listener is created for the system bundle context
> > every
> > > > time
> > > > > > the
> > > > > > > runtime is restarted, but it doesn't get invoked at all after
> > the
> > > > > > first
> > > > > > > shutdown.
> > > > > > >
> > > > > > >
> > > > > > > Thank you...
> > > > > > >
> > > > > > > Regards,
> > > > > > >
> > > > > > > Rajini
> > > > > > >
> > > > > > > On 6/27/07, Felix Meschberger <Felix.Meschberger@day.com >
> > wrote:
> > > > > > > >
> > > > > > > > Hi Rajini,
> > > > > > > >
> > > > > > > > How do you restart the framework ? Do you create the Felix
> > > > instance
> > > > > > anew
> > > > > > > > for
> > > > > > > > each framework start or do start-stop the same instance
> > multiple
> > > > > > times ?
> > > > > > > >
> > > > > > > > For better replicability and also in view of the changes
> that
> > > > > > Richard is
> > > > > > > > currently implementing, I suggest you do not reuse the Felix
> > > > > > instances
> > > > > > > but
> > > > > > > > instead recreate a new instance for each start-stop cycle.
> > > > > > > >
> > > > > > > > Anyway, I assume, that you have to register the framework
> > > listener
> > > > > > each
> > > > > > > > time
> > > > > > > > you start Felix.
> > > > > > > >
> > > > > > > > Hope this helps
> > > > > > > >
> > > > > > > > Regards
> > > > > > > > Felix
> > > > > > > >
> > > > > > > > On 6/27/07, Rajini Sivaram <ra...@googlemail.com>
> > wrote:
> > > > > > > > >
> > > > > > > > > Hello,
> > > > > > > > >
> > > > > > > > > I have a set of JUnit tests which startup a Felix runtime
> in
> > > the
> > > > > > setUp
> > > > > > > > > method and shut the runtime down using Felix.shutdown().
> The
> > > > tests
> > > > > > run
> > > > > > > > > fine
> > > > > > > > > when run one-by-one (single Felix runtime startup and
> > shutdown
> > > > in
> > > > > > a
> > > > > > > VM),
> > > > > > > > > but
> > > > > > > > > when run together (as a sequence of Felix runtime startup
> > and
> > > > > > shutdown
> > > > > > > > > from
> > > > > > > > > one VM), the framework listener is not called after the
> > first
> > > > > > > shutdown.
> > > > > > > > > Apart from the framework listener, other operations dont
> run
> > > > into
> > > > > > any
> > > > > > > > > problems with the restarting of the runtime, so I presume
> > > > > > restarting
> > > > > > > the
> > > > > > > > > embedded runtime is not a problem.
> > > > > > > > >
> > > > > > > > > Is this something which will get fixed with the changes to
> > the
> > > > > > > embedded
> > > > > > > > > APIs?
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Thank you...
> > > > > > > > >
> > > > > > > > > Regards,
> > > > > > > > >
> > > > > > > > > Rajini
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Thank you...
> > >
> > > Regards,
> > >
> > > Rajini
> > >
> >
>

Re: Framework listener is not invoked after Felix is restarted

Posted by Rajini Sivaram <ra...@googlemail.com>.
Felix,

Yes, the new jar works fine for me. Thank you very much!


Thank you...

Regards,

Rajini


On 6/29/07, Felix Meschberger <Fe...@day.com> wrote:
>
> Hi Rajini,
>
> I deployed a new build of the org.apache.felix.framework JAR file to the
> Apache Snapshot repository. Could you please verify, that it now works (my
> tests show success, just want to be sure).
>
> Regards
> Felix
>
> On 6/28/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> >
> > Thank you, Felix.
> >
> >
> >
> > On 6/28/07, Felix Meschberger <Fe...@day.com> wrote:
> > >
> > > Hi Rajini,
> > >
> > > Thanks for providing the test case.
> > >
> > > It turns out, that you discovered a subtle issue with the Felix
> > > EventDispatcher !
> > >
> > > Let me explain quickly: If you start the framework, ane
> EventDispatcher
> > > instance is created and a dispatcher thread is started. When the
> > framework
> > > is stopped, the EventDispatcher thread is stopped and internal flags
> of
> > > the
> > > EventDispatcher are set. Both, the thread and the flags are static
> > > variables. If you now create a new Felix instance (without changing
> the
> > > class loaders) the EventDispatcher static variables are not reset and
> > > hence
> > > the second (and any further) Felix instance started will not dispatch
> > any
> > > asynchronous events at all.
> > >
> > > I will report an issue for this.
> > >
> > > Regards
> > > Felix
> > >
> > > On 6/28/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> > > >
> > > > Felix,
> > > >
> > > > A test program is attached. If run without any changes, no events
> are
> > > > received by the framework listener.
> > > >
> > > > If you comment out the first start and shutdown in the main method,
> > one
> > > > event is received. If felix.shutdown() is not called inside
> > > > shutdownFelixRuntime, the event is received even with the new Felix
> > > > instance.
> > > >
> > > > Thank you...
> > > >
> > > > Regards,
> > > >
> > > > Rajini
> > > >
> > > >
> > > > On 6/28/07, Felix Meschberger <Fe...@day.com> wrote:
> > > > >
> > > > > Hi Rajini,
> > > > >
> > > > > Then it is strange, that it is not called ...
> > > > >
> > > > > Do you have some sample code you might share for a quick code
> review
> > ?
> > > > >
> > > > > Regards
> > > > > Felix
> > > > >
> > > > > On 6/27/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> > > > > >
> > > > > > Felix,
> > > > > >
> > > > > > I create a new instance of Felix each time. Once shutdown is
> > called,
> > > > > the
> > > > > > instance of Felix and the system bundle context are not used
> again
> > .
> > > A
> > > > > > framework listener is created for the system bundle context
> every
> > > time
> > > > > the
> > > > > > runtime is restarted, but it doesn't get invoked at all after
> the
> > > > > first
> > > > > > shutdown.
> > > > > >
> > > > > >
> > > > > > Thank you...
> > > > > >
> > > > > > Regards,
> > > > > >
> > > > > > Rajini
> > > > > >
> > > > > > On 6/27/07, Felix Meschberger <Felix.Meschberger@day.com >
> wrote:
> > > > > > >
> > > > > > > Hi Rajini,
> > > > > > >
> > > > > > > How do you restart the framework ? Do you create the Felix
> > > instance
> > > > > anew
> > > > > > > for
> > > > > > > each framework start or do start-stop the same instance
> multiple
> > > > > times ?
> > > > > > >
> > > > > > > For better replicability and also in view of the changes that
> > > > > Richard is
> > > > > > > currently implementing, I suggest you do not reuse the Felix
> > > > > instances
> > > > > > but
> > > > > > > instead recreate a new instance for each start-stop cycle.
> > > > > > >
> > > > > > > Anyway, I assume, that you have to register the framework
> > listener
> > > > > each
> > > > > > > time
> > > > > > > you start Felix.
> > > > > > >
> > > > > > > Hope this helps
> > > > > > >
> > > > > > > Regards
> > > > > > > Felix
> > > > > > >
> > > > > > > On 6/27/07, Rajini Sivaram <ra...@googlemail.com>
> wrote:
> > > > > > > >
> > > > > > > > Hello,
> > > > > > > >
> > > > > > > > I have a set of JUnit tests which startup a Felix runtime in
> > the
> > > > > setUp
> > > > > > > > method and shut the runtime down using Felix.shutdown(). The
> > > tests
> > > > > run
> > > > > > > > fine
> > > > > > > > when run one-by-one (single Felix runtime startup and
> shutdown
> > > in
> > > > > a
> > > > > > VM),
> > > > > > > > but
> > > > > > > > when run together (as a sequence of Felix runtime startup
> and
> > > > > shutdown
> > > > > > > > from
> > > > > > > > one VM), the framework listener is not called after the
> first
> > > > > > shutdown.
> > > > > > > > Apart from the framework listener, other operations dont run
> > > into
> > > > > any
> > > > > > > > problems with the restarting of the runtime, so I presume
> > > > > restarting
> > > > > > the
> > > > > > > > embedded runtime is not a problem.
> > > > > > > >
> > > > > > > > Is this something which will get fixed with the changes to
> the
> > > > > > embedded
> > > > > > > > APIs?
> > > > > > > >
> > > > > > > >
> > > > > > > > Thank you...
> > > > > > > >
> > > > > > > > Regards,
> > > > > > > >
> > > > > > > > Rajini
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > Thank you...
> >
> > Regards,
> >
> > Rajini
> >
>

Re: Framework listener is not invoked after Felix is restarted

Posted by Felix Meschberger <Fe...@day.com>.
Hi Rajini,

I deployed a new build of the org.apache.felix.framework JAR file to the
Apache Snapshot repository. Could you please verify, that it now works (my
tests show success, just want to be sure).

Regards
Felix

On 6/28/07, Rajini Sivaram <ra...@googlemail.com> wrote:
>
> Thank you, Felix.
>
>
>
> On 6/28/07, Felix Meschberger <Fe...@day.com> wrote:
> >
> > Hi Rajini,
> >
> > Thanks for providing the test case.
> >
> > It turns out, that you discovered a subtle issue with the Felix
> > EventDispatcher !
> >
> > Let me explain quickly: If you start the framework, ane EventDispatcher
> > instance is created and a dispatcher thread is started. When the
> framework
> > is stopped, the EventDispatcher thread is stopped and internal flags of
> > the
> > EventDispatcher are set. Both, the thread and the flags are static
> > variables. If you now create a new Felix instance (without changing the
> > class loaders) the EventDispatcher static variables are not reset and
> > hence
> > the second (and any further) Felix instance started will not dispatch
> any
> > asynchronous events at all.
> >
> > I will report an issue for this.
> >
> > Regards
> > Felix
> >
> > On 6/28/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> > >
> > > Felix,
> > >
> > > A test program is attached. If run without any changes, no events are
> > > received by the framework listener.
> > >
> > > If you comment out the first start and shutdown in the main method,
> one
> > > event is received. If felix.shutdown() is not called inside
> > > shutdownFelixRuntime, the event is received even with the new Felix
> > > instance.
> > >
> > > Thank you...
> > >
> > > Regards,
> > >
> > > Rajini
> > >
> > >
> > > On 6/28/07, Felix Meschberger <Fe...@day.com> wrote:
> > > >
> > > > Hi Rajini,
> > > >
> > > > Then it is strange, that it is not called ...
> > > >
> > > > Do you have some sample code you might share for a quick code review
> ?
> > > >
> > > > Regards
> > > > Felix
> > > >
> > > > On 6/27/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> > > > >
> > > > > Felix,
> > > > >
> > > > > I create a new instance of Felix each time. Once shutdown is
> called,
> > > > the
> > > > > instance of Felix and the system bundle context are not used again
> .
> > A
> > > > > framework listener is created for the system bundle context every
> > time
> > > > the
> > > > > runtime is restarted, but it doesn't get invoked at all after the
> > > > first
> > > > > shutdown.
> > > > >
> > > > >
> > > > > Thank you...
> > > > >
> > > > > Regards,
> > > > >
> > > > > Rajini
> > > > >
> > > > > On 6/27/07, Felix Meschberger <Felix.Meschberger@day.com > wrote:
> > > > > >
> > > > > > Hi Rajini,
> > > > > >
> > > > > > How do you restart the framework ? Do you create the Felix
> > instance
> > > > anew
> > > > > > for
> > > > > > each framework start or do start-stop the same instance multiple
> > > > times ?
> > > > > >
> > > > > > For better replicability and also in view of the changes that
> > > > Richard is
> > > > > > currently implementing, I suggest you do not reuse the Felix
> > > > instances
> > > > > but
> > > > > > instead recreate a new instance for each start-stop cycle.
> > > > > >
> > > > > > Anyway, I assume, that you have to register the framework
> listener
> > > > each
> > > > > > time
> > > > > > you start Felix.
> > > > > >
> > > > > > Hope this helps
> > > > > >
> > > > > > Regards
> > > > > > Felix
> > > > > >
> > > > > > On 6/27/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> > > > > > >
> > > > > > > Hello,
> > > > > > >
> > > > > > > I have a set of JUnit tests which startup a Felix runtime in
> the
> > > > setUp
> > > > > > > method and shut the runtime down using Felix.shutdown(). The
> > tests
> > > > run
> > > > > > > fine
> > > > > > > when run one-by-one (single Felix runtime startup and shutdown
> > in
> > > > a
> > > > > VM),
> > > > > > > but
> > > > > > > when run together (as a sequence of Felix runtime startup and
> > > > shutdown
> > > > > > > from
> > > > > > > one VM), the framework listener is not called after the first
> > > > > shutdown.
> > > > > > > Apart from the framework listener, other operations dont run
> > into
> > > > any
> > > > > > > problems with the restarting of the runtime, so I presume
> > > > restarting
> > > > > the
> > > > > > > embedded runtime is not a problem.
> > > > > > >
> > > > > > > Is this something which will get fixed with the changes to the
> > > > > embedded
> > > > > > > APIs?
> > > > > > >
> > > > > > >
> > > > > > > Thank you...
> > > > > > >
> > > > > > > Regards,
> > > > > > >
> > > > > > > Rajini
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> > >
> >
>
>
>
> --
> Thank you...
>
> Regards,
>
> Rajini
>

Re: Framework listener is not invoked after Felix is restarted

Posted by Rajini Sivaram <ra...@googlemail.com>.
Thank you, Felix.



On 6/28/07, Felix Meschberger <Fe...@day.com> wrote:
>
> Hi Rajini,
>
> Thanks for providing the test case.
>
> It turns out, that you discovered a subtle issue with the Felix
> EventDispatcher !
>
> Let me explain quickly: If you start the framework, ane EventDispatcher
> instance is created and a dispatcher thread is started. When the framework
> is stopped, the EventDispatcher thread is stopped and internal flags of
> the
> EventDispatcher are set. Both, the thread and the flags are static
> variables. If you now create a new Felix instance (without changing the
> class loaders) the EventDispatcher static variables are not reset and
> hence
> the second (and any further) Felix instance started will not dispatch any
> asynchronous events at all.
>
> I will report an issue for this.
>
> Regards
> Felix
>
> On 6/28/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> >
> > Felix,
> >
> > A test program is attached. If run without any changes, no events are
> > received by the framework listener.
> >
> > If you comment out the first start and shutdown in the main method, one
> > event is received. If felix.shutdown() is not called inside
> > shutdownFelixRuntime, the event is received even with the new Felix
> > instance.
> >
> > Thank you...
> >
> > Regards,
> >
> > Rajini
> >
> >
> > On 6/28/07, Felix Meschberger <Fe...@day.com> wrote:
> > >
> > > Hi Rajini,
> > >
> > > Then it is strange, that it is not called ...
> > >
> > > Do you have some sample code you might share for a quick code review ?
> > >
> > > Regards
> > > Felix
> > >
> > > On 6/27/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> > > >
> > > > Felix,
> > > >
> > > > I create a new instance of Felix each time. Once shutdown is called,
> > > the
> > > > instance of Felix and the system bundle context are not used again .
> A
> > > > framework listener is created for the system bundle context every
> time
> > > the
> > > > runtime is restarted, but it doesn't get invoked at all after the
> > > first
> > > > shutdown.
> > > >
> > > >
> > > > Thank you...
> > > >
> > > > Regards,
> > > >
> > > > Rajini
> > > >
> > > > On 6/27/07, Felix Meschberger <Felix.Meschberger@day.com > wrote:
> > > > >
> > > > > Hi Rajini,
> > > > >
> > > > > How do you restart the framework ? Do you create the Felix
> instance
> > > anew
> > > > > for
> > > > > each framework start or do start-stop the same instance multiple
> > > times ?
> > > > >
> > > > > For better replicability and also in view of the changes that
> > > Richard is
> > > > > currently implementing, I suggest you do not reuse the Felix
> > > instances
> > > > but
> > > > > instead recreate a new instance for each start-stop cycle.
> > > > >
> > > > > Anyway, I assume, that you have to register the framework listener
> > > each
> > > > > time
> > > > > you start Felix.
> > > > >
> > > > > Hope this helps
> > > > >
> > > > > Regards
> > > > > Felix
> > > > >
> > > > > On 6/27/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> > > > > >
> > > > > > Hello,
> > > > > >
> > > > > > I have a set of JUnit tests which startup a Felix runtime in the
> > > setUp
> > > > > > method and shut the runtime down using Felix.shutdown(). The
> tests
> > > run
> > > > > > fine
> > > > > > when run one-by-one (single Felix runtime startup and shutdown
> in
> > > a
> > > > VM),
> > > > > > but
> > > > > > when run together (as a sequence of Felix runtime startup and
> > > shutdown
> > > > > > from
> > > > > > one VM), the framework listener is not called after the first
> > > > shutdown.
> > > > > > Apart from the framework listener, other operations dont run
> into
> > > any
> > > > > > problems with the restarting of the runtime, so I presume
> > > restarting
> > > > the
> > > > > > embedded runtime is not a problem.
> > > > > >
> > > > > > Is this something which will get fixed with the changes to the
> > > > embedded
> > > > > > APIs?
> > > > > >
> > > > > >
> > > > > > Thank you...
> > > > > >
> > > > > > Regards,
> > > > > >
> > > > > > Rajini
> > > > > >
> > > > >
> > > >
> > >
> >
> >
> >
>



-- 
Thank you...

Regards,

Rajini

Re: Framework listener is not invoked after Felix is restarted

Posted by Felix Meschberger <Fe...@day.com>.
Hi Rajini,

Thanks for providing the test case.

It turns out, that you discovered a subtle issue with the Felix
EventDispatcher !

Let me explain quickly: If you start the framework, ane EventDispatcher
instance is created and a dispatcher thread is started. When the framework
is stopped, the EventDispatcher thread is stopped and internal flags of the
EventDispatcher are set. Both, the thread and the flags are static
variables. If you now create a new Felix instance (without changing the
class loaders) the EventDispatcher static variables are not reset and hence
the second (and any further) Felix instance started will not dispatch any
asynchronous events at all.

I will report an issue for this.

Regards
Felix

On 6/28/07, Rajini Sivaram <ra...@googlemail.com> wrote:
>
> Felix,
>
> A test program is attached. If run without any changes, no events are
> received by the framework listener.
>
> If you comment out the first start and shutdown in the main method, one
> event is received. If felix.shutdown() is not called inside
> shutdownFelixRuntime, the event is received even with the new Felix
> instance.
>
> Thank you...
>
> Regards,
>
> Rajini
>
>
> On 6/28/07, Felix Meschberger <Fe...@day.com> wrote:
> >
> > Hi Rajini,
> >
> > Then it is strange, that it is not called ...
> >
> > Do you have some sample code you might share for a quick code review ?
> >
> > Regards
> > Felix
> >
> > On 6/27/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> > >
> > > Felix,
> > >
> > > I create a new instance of Felix each time. Once shutdown is called,
> > the
> > > instance of Felix and the system bundle context are not used again . A
> > > framework listener is created for the system bundle context every time
> > the
> > > runtime is restarted, but it doesn't get invoked at all after the
> > first
> > > shutdown.
> > >
> > >
> > > Thank you...
> > >
> > > Regards,
> > >
> > > Rajini
> > >
> > > On 6/27/07, Felix Meschberger <Felix.Meschberger@day.com > wrote:
> > > >
> > > > Hi Rajini,
> > > >
> > > > How do you restart the framework ? Do you create the Felix instance
> > anew
> > > > for
> > > > each framework start or do start-stop the same instance multiple
> > times ?
> > > >
> > > > For better replicability and also in view of the changes that
> > Richard is
> > > > currently implementing, I suggest you do not reuse the Felix
> > instances
> > > but
> > > > instead recreate a new instance for each start-stop cycle.
> > > >
> > > > Anyway, I assume, that you have to register the framework listener
> > each
> > > > time
> > > > you start Felix.
> > > >
> > > > Hope this helps
> > > >
> > > > Regards
> > > > Felix
> > > >
> > > > On 6/27/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> > > > >
> > > > > Hello,
> > > > >
> > > > > I have a set of JUnit tests which startup a Felix runtime in the
> > setUp
> > > > > method and shut the runtime down using Felix.shutdown(). The tests
> > run
> > > > > fine
> > > > > when run one-by-one (single Felix runtime startup and shutdown in
> > a
> > > VM),
> > > > > but
> > > > > when run together (as a sequence of Felix runtime startup and
> > shutdown
> > > > > from
> > > > > one VM), the framework listener is not called after the first
> > > shutdown.
> > > > > Apart from the framework listener, other operations dont run into
> > any
> > > > > problems with the restarting of the runtime, so I presume
> > restarting
> > > the
> > > > > embedded runtime is not a problem.
> > > > >
> > > > > Is this something which will get fixed with the changes to the
> > > embedded
> > > > > APIs?
> > > > >
> > > > >
> > > > > Thank you...
> > > > >
> > > > > Regards,
> > > > >
> > > > > Rajini
> > > > >
> > > >
> > >
> >
>
>
>

Re: Framework listener is not invoked after Felix is restarted

Posted by Rajini Sivaram <ra...@googlemail.com>.
Felix,

A test program is attached. If run without any changes, no events are
received by the framework listener.

If you comment out the first start and shutdown in the main method, one
event is received. If felix.shutdown() is not called inside
shutdownFelixRuntime, the event is received even with the new Felix
instance.

Thank you...

Regards,

Rajini


On 6/28/07, Felix Meschberger <Fe...@day.com> wrote:
>
> Hi Rajini,
>
> Then it is strange, that it is not called ...
>
> Do you have some sample code you might share for a quick code review ?
>
> Regards
> Felix
>
> On 6/27/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> >
> > Felix,
> >
> > I create a new instance of Felix each time. Once shutdown is called, the
> > instance of Felix and the system bundle context are not used again . A
> > framework listener is created for the system bundle context every time
> the
> > runtime is restarted, but it doesn't get invoked at all after the first
> > shutdown.
> >
> >
> > Thank you...
> >
> > Regards,
> >
> > Rajini
> >
> > On 6/27/07, Felix Meschberger <Fe...@day.com> wrote:
> > >
> > > Hi Rajini,
> > >
> > > How do you restart the framework ? Do you create the Felix instance
> anew
> > > for
> > > each framework start or do start-stop the same instance multiple times
> ?
> > >
> > > For better replicability and also in view of the changes that Richard
> is
> > > currently implementing, I suggest you do not reuse the Felix instances
> > but
> > > instead recreate a new instance for each start-stop cycle.
> > >
> > > Anyway, I assume, that you have to register the framework listener
> each
> > > time
> > > you start Felix.
> > >
> > > Hope this helps
> > >
> > > Regards
> > > Felix
> > >
> > > On 6/27/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> > > >
> > > > Hello,
> > > >
> > > > I have a set of JUnit tests which startup a Felix runtime in the
> setUp
> > > > method and shut the runtime down using Felix.shutdown(). The tests
> run
> > > > fine
> > > > when run one-by-one (single Felix runtime startup and shutdown in a
> > VM),
> > > > but
> > > > when run together (as a sequence of Felix runtime startup and
> shutdown
> > > > from
> > > > one VM), the framework listener is not called after the first
> > shutdown.
> > > > Apart from the framework listener, other operations dont run into
> any
> > > > problems with the restarting of the runtime, so I presume restarting
> > the
> > > > embedded runtime is not a problem.
> > > >
> > > > Is this something which will get fixed with the changes to the
> > embedded
> > > > APIs?
> > > >
> > > >
> > > > Thank you...
> > > >
> > > > Regards,
> > > >
> > > > Rajini
> > > >
> > >
> >
>

Re: Framework listener is not invoked after Felix is restarted

Posted by Felix Meschberger <Fe...@day.com>.
Hi Rajini,

Then it is strange, that it is not called ...

Do you have some sample code you might share for a quick code review ?

Regards
Felix

On 6/27/07, Rajini Sivaram <ra...@googlemail.com> wrote:
>
> Felix,
>
> I create a new instance of Felix each time. Once shutdown is called, the
> instance of Felix and the system bundle context are not used again . A
> framework listener is created for the system bundle context every time the
> runtime is restarted, but it doesn't get invoked at all after the first
> shutdown.
>
>
> Thank you...
>
> Regards,
>
> Rajini
>
> On 6/27/07, Felix Meschberger <Fe...@day.com> wrote:
> >
> > Hi Rajini,
> >
> > How do you restart the framework ? Do you create the Felix instance anew
> > for
> > each framework start or do start-stop the same instance multiple times ?
> >
> > For better replicability and also in view of the changes that Richard is
> > currently implementing, I suggest you do not reuse the Felix instances
> but
> > instead recreate a new instance for each start-stop cycle.
> >
> > Anyway, I assume, that you have to register the framework listener each
> > time
> > you start Felix.
> >
> > Hope this helps
> >
> > Regards
> > Felix
> >
> > On 6/27/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> > >
> > > Hello,
> > >
> > > I have a set of JUnit tests which startup a Felix runtime in the setUp
> > > method and shut the runtime down using Felix.shutdown(). The tests run
> > > fine
> > > when run one-by-one (single Felix runtime startup and shutdown in a
> VM),
> > > but
> > > when run together (as a sequence of Felix runtime startup and shutdown
> > > from
> > > one VM), the framework listener is not called after the first
> shutdown.
> > > Apart from the framework listener, other operations dont run into any
> > > problems with the restarting of the runtime, so I presume restarting
> the
> > > embedded runtime is not a problem.
> > >
> > > Is this something which will get fixed with the changes to the
> embedded
> > > APIs?
> > >
> > >
> > > Thank you...
> > >
> > > Regards,
> > >
> > > Rajini
> > >
> >
>

Re: Framework listener is not invoked after Felix is restarted

Posted by Rajini Sivaram <ra...@googlemail.com>.
Felix,

I create a new instance of Felix each time. Once shutdown is called, the
instance of Felix and the system bundle context are not used again . A
framework listener is created for the system bundle context every time the
runtime is restarted, but it doesn't get invoked at all after the first
shutdown.


Thank you...

Regards,

Rajini

On 6/27/07, Felix Meschberger <Fe...@day.com> wrote:
>
> Hi Rajini,
>
> How do you restart the framework ? Do you create the Felix instance anew
> for
> each framework start or do start-stop the same instance multiple times ?
>
> For better replicability and also in view of the changes that Richard is
> currently implementing, I suggest you do not reuse the Felix instances but
> instead recreate a new instance for each start-stop cycle.
>
> Anyway, I assume, that you have to register the framework listener each
> time
> you start Felix.
>
> Hope this helps
>
> Regards
> Felix
>
> On 6/27/07, Rajini Sivaram <ra...@googlemail.com> wrote:
> >
> > Hello,
> >
> > I have a set of JUnit tests which startup a Felix runtime in the setUp
> > method and shut the runtime down using Felix.shutdown(). The tests run
> > fine
> > when run one-by-one (single Felix runtime startup and shutdown in a VM),
> > but
> > when run together (as a sequence of Felix runtime startup and shutdown
> > from
> > one VM), the framework listener is not called after the first shutdown.
> > Apart from the framework listener, other operations dont run into any
> > problems with the restarting of the runtime, so I presume restarting the
> > embedded runtime is not a problem.
> >
> > Is this something which will get fixed with the changes to the embedded
> > APIs?
> >
> >
> > Thank you...
> >
> > Regards,
> >
> > Rajini
> >
>

Re: Framework listener is not invoked after Felix is restarted

Posted by Felix Meschberger <Fe...@day.com>.
Hi Rajini,

How do you restart the framework ? Do you create the Felix instance anew for
each framework start or do start-stop the same instance multiple times ?

For better replicability and also in view of the changes that Richard is
currently implementing, I suggest you do not reuse the Felix instances but
instead recreate a new instance for each start-stop cycle.

Anyway, I assume, that you have to register the framework listener each time
you start Felix.

Hope this helps

Regards
Felix

On 6/27/07, Rajini Sivaram <ra...@googlemail.com> wrote:
>
> Hello,
>
> I have a set of JUnit tests which startup a Felix runtime in the setUp
> method and shut the runtime down using Felix.shutdown(). The tests run
> fine
> when run one-by-one (single Felix runtime startup and shutdown in a VM),
> but
> when run together (as a sequence of Felix runtime startup and shutdown
> from
> one VM), the framework listener is not called after the first shutdown.
> Apart from the framework listener, other operations dont run into any
> problems with the restarting of the runtime, so I presume restarting the
> embedded runtime is not a problem.
>
> Is this something which will get fixed with the changes to the embedded
> APIs?
>
>
> Thank you...
>
> Regards,
>
> Rajini
>