The motivation for this thread is that I am experimenting with an OSGi
enRoute project that uses the Apache Aries SPI-Fly dynamic weaving
libraries to play an MP3 file. The example project is on github at:
https://github.com/axiopisty/com.github.axiopisty.plarpebu. This project
has 5 enRoute modules:

   - JavaFX API
   - JavaFX API Provider
   - Media Player API
   - Media Player API Provider
   - Application

What I have noticed is that when I use 'osgi.enroute.debug.api' I can use
the debug commands in the gogo shell to successfully load, play, pause, and
stop the media player. The application will successfully play an MP3 file.
However, when using the GUI to 'load' the MP3 file an exception occurs that
indicates something is not working right with the SPI Fly dynamic weaving
integration. I have not been able to figure out why the 'load' operation
works successfully when using the gogo shell, but does not work when called
from the GUI. I'm wondering if it might have something to do with the
bundle start levels because according to the SPI Fly documentation, "any
OSGi Bundle that uses the OSGi 4.3 WeavingHooks, the weaver bundle
(org.apache.aries.spifly.dynamic.bundle) needs to be active before any
bundles that need to be dynamically woven. OSGi start levels can provide a
mechanism to control this."

My suspicion is that because the JavaFX provider is a DS component with
scope SINGLETON and immediate = true, that this bundle is activated before
the dynamic weaving bundle in the runtime, which is probably causing the
problem described.
So my question is, when using bnd, is there some directive or syntax that
can be used with the -runbundles directive that indicates the bundle start
level?

I would greatly appreciate your help figuring out why the media player
service I created in this example works successfully from the gogo shell,
but not from the gui, all within the same runtime application.

Sincerely,
Elliot
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to