Book - OSGi in Practice
I am currently writing a book on OSGi entitled “OSGi in Practice”. This will be a free book, released as a PDF under a Creative Commons license.
Lacking a traditional publisher, I would like to ask for your help to review my book, check it for inaccuracies, run the example code, and critique my writing style. In return, you will get early access to sections of the book. All contributions, no matter how small, will be acknowledged in the foreword. I have set up a bug tracker for reporting errors and giving feedback.
Here is the download. For those who downloaded earlier previews, note that I am no longer releasing individual chapters: this is a single PDF of the whole book as it stands, albeit with several chapters missing.
Also please note that at the moment this is a very rough draft. Do not rely on it as being in any way authoritative — if in doubt, always check the specification.


jayagopi jagadeesan:
Hi Neil,
This venture of yours is long awaited. Such a book is really desired by all of us deeply interested in this exciting and “working” technology OSGi. Will provide my feedback as and when I get time to go through the chapters. Keep up this great work man! cheers, jay
April 18, 2008, 6:29 amMurad Juraev:
Dear Neil,
I agree with Jay. Developers do need such a book. And thank you a lot for choosing CCL and your valuable contribution to the Open Source Community. I am sure CCL will not prevent you from getting huge profit if you decide to publish your book in Apress, OReilly, etc.
April 18, 2008, 7:45 amMB:
Hi,
I hope this book becomes a success, nice to see a free ebook. Now some feedback;
- Maybe you could spice up the book abit like change the fonts , the chapter heading styles etc. instead of using the defaults …
- Did you compress the pdf? take a look at pg. 10, 15, the fonts are not so sharp.
April 18, 2008, 11:28 amNeil:
Hi MB, thanks for your feedback.
Regarding the fonts and style issues… yes I may play around with those later. At the moment I’m concentrating on getting the actual content written!
You’re right about the blurriness, I hadn’t noticed this before. It’s probably an artifact of the tool I’ve used to take an extract from the book, which is the LaTeX “pdfpages” package. It seems to be taking an image of the original pages and embedding them in a new PDF!
Does anybody know of a better way to extract a range of pages from a large PDF, and prepend it with a page of boilerplate?
Many thanks, Neil
April 18, 2008, 11:39 amjayagopi jagadeesan:
Hi Neil,
Just reading through your chapter 2. Easy reading and fun stuff. Well written tutorial. Just a few minor points : 1) better to rename ch-2 to “Getting Started” 2) It is better to keep the “helloworld” and “bundlecounter” bundles in separate packages, say, osgi.tutorial.helloworld and osgi.tutorial.bundlecounter. Also make the changes in the “Private-Package” entries in the helloworld.bnd and bundlecounter.bnd files. This way, the helloworld class files don’t get into the bundlecounter.jar unnecessarily. Good work Neil! cheers, jay
April 18, 2008, 12:13 pmScott Rosenbaum:
If you want to work with PDF like that, try iText.
I haven’t tested, but it should look something like this.
public static void split(File inf, int pageStart, int pageEnd, File outputFile) throws Exception {
}
April 18, 2008, 6:46 pmKevin Conner:
Hiya Neil.
Congratulations on starting this endeavour, it is a topic that has been crying out for good books. I am confident that this will be a big success for you.
I would also like to echo the thanks of others for choosing to release under CCL and look forward to reading the work as it progresses.
Good luck, Kev
April 19, 2008, 6:15 amSud:
Neil,
Thank for this effort. I’ve used eclipse for about 2 years. Your chapter on getting started with OSGi has finally helped me understand where OSGi (equinox) ends and Eclipse starts. Looking forward to the remaining chapters.
I especially like how you take the route of using Felix for your examples. It keeps things simple and clearly demystifies OSGi when using it from Eclipse.
-sud
April 19, 2008, 11:18 pmLink:
Hi, Neil. I appreciate your working on writing such a book. I begin to learn OSGi recently, and looking for a suitable book all the time. Your aticle <> has help me a lot. I hope this book will be finished as soon as possible.
April 21, 2008, 5:14 amRajkumar Vakkada:
All the best for you. I wish this book will lay the foundation for the next generation java/jvm applications
April 23, 2008, 6:20 pmron:
Thanks very much for writing this book. I’ve only read one chapter so far, and I’ve already learned a lot. I find your writing style to be very readable and I think it was brilliant to approach osgi without PDE.
April 29, 2008, 1:05 pmJean-Pierre Fortune:
Hi Neil,
Thanks for this great work! We have a strong OSGi community in France. I intend to translate it into french. What do you think?
Best regards,
Jean-Pierre
May 1, 2008, 2:42 pmRaghuram Sripada:
Neil,
Thanks for deciding to release this under Creative Commons.
All the best!!
-Raghuram
May 2, 2008, 12:05 pmNeil:
Jean-Pierre,
That would be absolutely formidable! Yes please! I will contact you by email to discuss.
Neil
May 2, 2008, 1:06 pmDanny:
This is great work! I can’t wait for the rest of the chapters to be written.
May 6, 2008, 12:33 amZiglioNZ:
Hi Neil, great work! Talking about OSGi services and Eclipse, I’ve just seen a presentation that talked about the Equinox Application Model. Is that the same as Declarative Services? If the Equinox Application Model were already available then you could have probably used Eclipse and the Equinox console for your examples
I appreciate though your OSGi rather than Eclipse -centric approach.
May 8, 2008, 5:11 amNeil:
Hi ZiglioNZ,
Thanks for your feedback. Actually the Equinox App Model is a mechanism for launching “applications” built on Equinox. One example of such an application is the Eclipse IDE itself. In fact the application model is based on the standard OSGi Application Admin service, which is documented in Chapter 116 of the OSGi Compendium specification. It is unrelated to Declarative Services.
App Admin doesn’t have anything to do with the OSGi console either, so unfortunately it doesn’t solve the problem of choosing which console implementation to use for the examples. Each OSGi framework implements its own console and they’re all a little bit different. Worse, Equinox’s console is implemented directly in the core framework JAR rather than in a separate bundle, so you can’t run it on other OSGi implementations, whereas the Felix console is in a separate bundle so you can run it on Equinox and KF. Therefore it seems to make more sense to standardise on Felix’s console for the examples.
Neil
May 8, 2008, 6:56 amJean-Jacques:
HI Neil,
Thanks, for all articles and now starting a book on OSGI =)
One of the feature that interest me on OSGI is pluggability of external module by partner for example.
However, if I want to integrate external code on a server side platform using OSGI : How it can be secured ? (Policy file could be used to deny access to some API or files) Is there any plan to handle it in API way ? How to ensure that one bundle is no going to get all resources of the server ?
Any help appreciate =)
Thanks
May 9, 2008, 9:45 amHeath:
Thanks very much for these great chapters. I especially like the documentation on the bnd tool. I really dislike using PDE build to make my bundles/plugins. I hope you can include a thorough chapter on the building a large application comprised of many bundles with bnd. Additionally, it would be nice to have a chapter on the best ways to integration-test an application comprised of many interdependent bundles, especially from a continuous integration server like cruisecontrol.
May 13, 2008, 4:56 amRobert Burrell Donkin:
Thanks for start a book on OSGi
I have some stylistic comments. I’ve done some technical reviewing in the past so I know some authors can be prickly about stuff like that. Interested in stylistic comments? If so, ok posting them in public or would you prefer private?
Robert
May 13, 2008, 11:06 pmMirko Jahn:
Hi Neil,
I like your idea of writing a book with the help of the community. I think this is a very interesting approach and case study on “open projects”. To help you with your effort, here are my first two cents…
During my work with OSGi I found the hardest part for people is not getting started with OSGi, but how to migrate their existing infrastructure into an OSGi based one. This includes not only typical design issues of the software itself, but also the build environment. As far as I can tell, there are only very few projects starting from a scratch. Maybe it is worth considering a section on that as well. I guess you have plenty of experience on that too, but if you’re seeking for input, just let me know
Mirko
May 14, 2008, 9:51 amJeff Trent:
Hi Neil,
I second Mirko’s suggestion and offer…
OSGi seems to lend itself to new development efforts. Unless you have an isolation tier in place that was developed with the foresight to delegate classloader, logging, file i/o, and object lookup / creation to it, then it seems to be a much more involved effort to transition to OSGi.
I also am bothered by how global and flat the services are. They all have equal visibility to the others and don’t support a notion of application or call context. Most enterprise patterns don’t lend well to the transition.
Regardless, I think you are doing an awesome job (and service to the developer community) with your book. Keep up the good work!
Cheers, Jeff
May 16, 2008, 5:20 pmRichard Emerson:
Neil, many thanks for this work. It really is excellent.
It’s so refreshing to read a proper well-written tutorial introduction to OSGi, especially after such a long time trying to piece together information from various specs, blog posts and mailing lists. The tone and level of the content is pretty much spot-on too.
I urge you to pitch it to O’Reilly. The OSGi world needs this book!
May 22, 2008, 2:46 pmAngelo Tata:
Hi, Neil.
I’m adding my “thanks” to the list. I’ve been digging into Eclipse programming (read “plugins”) and I’ve always wondered how to approach OSGi as a separate entity. Now there’s a clear path…
Angelo
P.S. Following Jean-Pierre example, I was thinking about a translation into Italian. Would you care to talk about it?
May 27, 2008, 11:20 amLawrence Mandel:
Neil,
Have you considered publishing with Lulu.com? I haven’t used the service but it looks like a good way to get your book into print for people who prefer this format. Plus, you can get an ISBN and perhaps even make a little money for your effort.
Lawrence
May 27, 2008, 3:21 pmChristian Rühl:
Hi Neil,
your installments from “Getting started with OSGi” were a perfect help for me with my latest project. I just wanted to say that I can’t wait to see more chapters of your new book and that I’d definetly buy one copy if you intend to publish it one day.
Thanks so much!
Chris
June 2, 2008, 12:56 pmAkira:
Hi Neil,
congratulations for your initiative. The feedback list is already getting big. In a while, this will get unmanageable for you. Why don’t you try something new and use a bug tracking system to help you writing your book?
Akira
June 9, 2008, 3:40 amJacques Ledoux:
Hi Neil,
We are early adopters of OSGi and already have written quite a bit of code as server applications. In the process, we (sometimes painfully) acquired hands on knowledge about the beast. Me and members of my team will be glad to review and comment the book. I am sure that in the process, we will acquire new insights as well.
Bravo and be assure of all our support.
Jacques
June 9, 2008, 12:27 pmCharlie:
Excellent resource! I look forward to purchasing a hard copy.
June 9, 2008, 7:00 pmThomas:
Hi Neil,
I would like to publish your book as an Eclipse help plugin on my website http://eclipsedocs.berlios.de.
Can you also publish the book as HTML for easy packaging as a help plugin?
Best regards, -Thomas
June 12, 2008, 7:17 amPawel Kowalski:
Hey Neil,
Great Book!
June 17, 2008, 7:50 amRuben:
Neil,
Thanks so much for this awesome contribution on your part. Can’t wait to the remaining chapters!
Cheers, -Ruben
June 17, 2008, 4:18 pmJosef:
Neil, Excellent work! One question on the “Introduction to Services” chapter. You give the impression that services must be Java Interfaces, whereas, if I’m reading correctly, the spec says that they can be Java classes too. Sure, we should program to Interfaces and all that…..
— Josef
June 17, 2008, 8:12 pmEelco:
Hey Neil,
Thank you for the excellent work. I read your chapters with great interest, especially your ideas about concurrency. As I am new to OSGi and concurrency I wondered with reference is behind number 13. You refer to it as invaluable and it might help me to get a better understanding about the choices you made to tackle the concurrency issues.
June 19, 2008, 8:57 amConfluence: 7000 Product Development:
OSGI und WebServices…
OSGI in Practice…
June 19, 2008, 1:31 pmMarkus:
Hey Neil,
Comment to Introduction to services on page 23
This syntax is borrowed directly from LDAP search filters, as defined in [?-> RFC 1960].
Cheers, Markus
June 30, 2008, 9:43 amBen Hutchison:
The standard of this book is excellent: well explained & organized content and a writing style that’s really pleasant to read.
July 3, 2008, 6:43 amKeesun:
Hi Nell.
I’d like to specilly thank you for this book. It is really helping me understand and study OSGi. I’m now practicing some exersices on chapter “First Step In OSGi”.
Now, I have no idea what is the volatile keyword’s role from examples. Please let me know if you have some time to explain that.
on page 38.
private volatile BundleContext context;
July 3, 2008, 9:22 amJane:
Hi,
This intro to OSGI was very helpful in getting me started using OSGI. Thanks!
I am having trouble using bind tool with eclipse. I followed the instructions as mentioned in the chapter steps chapter but when I try to “make bundle” I get “Jar is Empty” error and the reason is blank. Could you please tell me what I could be doing wrong?
Thanks a lot!
July 16, 2008, 10:28 pmTina:
What about some pointers on how best to test OSGI applications? I’m thinking here of unit-testing, as well as integration testing between components or verifying component configurations, all preferably executable in a continuous integration environment.
July 25, 2008, 12:09 pmHossam:
you are the man to publish a strong book like this ….
July 31, 2008, 7:05 amEugene:
Very helpful stuff. Thank you!
August 23, 2008, 12:28 amSlamet Cahyadi:
Firstly, I thank you for the book you’ve written. It was a really good book.
There is one thing bothers in my mind, and pardon for being rude. Are you the same person as in this small article ‘RIP Neil Bartlett’ from “http://neilbartlett.name/blog/”?
September 9, 2008, 1:50 amTim Peoples:
Thank you so very much for this excellent work. I’ve really found each chapter to be quite helpful.
When might we be seeing the next installment?
September 18, 2008, 11:47 pmJm Wowchuk:
Overall, very good! However, could I suggest you include a chapter on Preferences and Configuration? I’m happy to contribute as well.
September 19, 2008, 7:50 pmarchitecting's me2DAY:
[짱가™]의 생각…
OSGi.In.Practice?…
September 22, 2008, 8:58 amEugene:
Neil, Since you said that you don’t have a publisher, I thought you may find this useful. Have you heard of Qoop? (http://www.qoop.com/?tab=documents?) It provides on-demand printing services - you upload digital content and people can order hard copies on demand.
September 24, 2008, 1:14 amWim Jongman:
hi, great book!! Here are some edits:
Chapter 1 page 6: 5. class loader “files” to find the class page 7: par:1.2.3 first sentence gets lost in the end (at least i don’t understand it) page 11: footnote [2] Is it really impossible? You told us on page 4 that we could override the class loaders finding process page 13: 1.4 ..eliminates almost all of “the” problems…
September 25, 2008, 10:09 pmThierry Templier:
Hello,
It’s really a good idea to translate that in french. Do you work on that since May and do you need some help? Thierry
September 26, 2008, 1:22 pmMichael McGrady:
Great book. Where is the source code for the examples?
September 26, 2008, 4:53 pmIskender Yigitel:
Dear Neil, I have been following your tutorials and blog on OSGI. I must admire that your tutorials had been very useful for me. And finally this book is a very very useful for OSGI developers, and people who are interested in OSGI. Great effort. Thank you very much.
Best Regards Iskender Yigitel
October 6, 2008, 12:07 pmNeil Laurance:
Hi Neil, Attended your course at QCon/SkillsMatter yesterday (8th October), and for me it was the highlight of the day. Thanks for cutting through the hype and clearly explaining what OSGi is all about.
October 9, 2008, 10:03 amHelen Hunt:
Hi Neil, I couldn’t attend the talk at the QCon/SkillsMatter on the 8th due to other pressing commitments. However, I hope to make it this time to your next talk on Eclipse DemoCamp on 25 November.
See you all there!
October 10, 2008, 2:53 pmClaus Augusti:
Hi Neil,
just wanted to drop in and say thank you for work and licensing it under CC.
October 31, 2008, 6:31 pmThomas Singer:
Thank you, Neil, for your effort. What I really would like to read is some information about using Felix as a framework to update an application - similar to, lets say, Firefox. Also it would be of interest, to be able to define where the repository will be created, so one could use it for multiple applications on the same machine which are installed in a read-only directory (each application should have its own repository).
November 2, 2008, 6:13 pmGiovanni:
I am reading your book and I am finding it really interesting. Thanks for deciding to release this under Creative Commons. All the best!!
-Giovanni
November 5, 2008, 1:31 pmPaul Ruest:
Thank you for doing this! Nice level of detail. Very readable. Left a few requests in the bug tracking system. Definately looking forward to the chapters on Testing OSGi Bundles and Using Third-Party Libraries.
November 10, 2008, 6:04 pmAngelica:
Hi Neil, Thank you very much for your effort. Your book is very interesting. I have a special interest on the EventAdmin Service. I’m trying to remote this service using the Equinox implementation. Normally i have to implement a new service that communicates with the EventAdmin Service in order to get the remote aspect. Have you an idea, how can i do it?
Thanks & regards Angelica
November 22, 2008, 12:41 amBart:
Typo on page 94: Boolean “ANT” should be AND of course
November 24, 2008, 3:39 pmal werner:
Hi Neil,
I have found out about your publishing project on “JoelOnSoftware”. It was a great surprise for me to flick through the first 100 pages of your book, and note how much information I had actually retained during this exercise.
Your skills to kindle the readers desire to learn more abour OSGi, while keeping him alert at the same time, with an excellent introduction and good examples put you at the forefront of a fine author and communicator.
Good luck in all your future publishing projects.
Kind regards
Al:
November 27, 2008, 9:24 amcenyongh:
Hi Neil,
I have just finished the book. The content is great. But I think the layout should be improved, some paragraph is seperarated by a pretty long code which make reading the content and reading code a little bit harder.
December 2, 2008, 6:58 amSaravanan:
Hi Neil,
This timely content is both interesting and applicable to one of my projects!
I started reading it sometime ago and wondering if you have plans to include these topics as well:
iPOJO, Spring Dynamic Services and a comparision of these frameworks with Declarative Services.
January 8, 2009, 2:16 pmackerulr:
Seems the download link is broken.
Would really like to have a look at the book since the “Getting started with OSGi” articles served me well!
Thanks, Ulrich
January 10, 2009, 10:08 pmOSGi Bookshelf « The OSGi Look:
[...] OSGi in Practice, by Neil Bartlett Not complete yet, but it’s free, and it’s, in my opinion, the most well-written book on the topic. Donwload it here [...]
February 5, 2009, 5:44 amAlessio’s blog » Blog Archive » Libro gratuito su OSGi:
[...] http://neilbartlett.name/blog/osgibook/ [...]
February 13, 2009, 10:24 pmhref » OSGi in Practice -kirja:
[...] Bartlett tarjoaa hyvän perusesityksen OSGi:stä vapaasti saatavilla olevan kirjan [...]
February 23, 2009, 9:09 amTor Arne kvaløy:
Hey Neil,
Thank you so much for the OSGI book, I have found it very useful!
However, I found something that didn’t make sense to me, and it has to do with how you describe classloading in a classical J2EE application server.
On page 15 you write: ?They cause class conflicts: classes found higher in the tree always take precedence over the classes that are shipped with the application. In fact, every application in the server must now use the same version of the library.?
As far as I know this is not true. In an article called “J2EE Class Loading Demystified” at Developworks(http://www.ibm.com/developerworks/websphere/library/techarticles/0112_deboer/deboer.html) they say that the classloader at the war-level can be configured to load its own jar-files before jar-files of its parents. This is when delegation is turned off.
“When delegation is turned off, the classloader first attempts to load the class itself. If it can’t load the class, it asks its parent to load the class.”
I hope this can be useful for clarifying this issue with classloading.
Tor
February 24, 2009, 11:43 amProvisioning Amazon EC2 with OSGi « The OSGi Look:
[...] a comment » Neil Bartlett, the author of OSGi in Practice, has came up with S3Install, a a very simple runtime OSGi bundle for provisioning an Amazon EC2 [...]
March 4, 2009, 6:06 amFred Janon:
The link http://neilbartlett.name/downloads/felix-1.0.3-withsrc.zip for the book is broken
March 6, 2009, 4:54 amConheça estrutura OSGi « Razec’s LAB:
[...] Neil in: OSGi in pratice, download: http://neilbartlett.name/blog/osgibook/ Acesso em [...]
March 11, 2009, 2:29 pmRazec:
Hi Neil,
Congratulations thank you so much for the good book. Now I can understand about OSGi, I wrote in my blog a post in portuguese(Brazil) and I commented about your book.
Thank you very much =)
See yaa
March 11, 2009, 2:35 pmeldn:
THX a lot for your great work. Very Helpful!
eldn
March 11, 2009, 3:49 pmGeert Schuring:
Neil,
I’ll be reading a large part of your book, and I’d like to send you my comments. How would you like to receive them… as comments on this post, or in your mail, etc?
For starters: The line “This hinders collaboration amongst different business areas.” on page 15 doesn’t really make it clear to me why shipping all dependencies with every application would hinder collaboration between business area’s. You might want to explain that a bit further.
Hope to hear from you!
March 22, 2009, 12:50 pmRafael:
Neil,
Thank you very much for your wonderful book !
Regarding using Felix inside Eclipse, I wanted to avoid copying all Felix startup bundles in each project. So I have found an alternative.
I have all my felix.jar ans startup bundles in a fixed, read-only location (i.e. /usr/local/java/felix-1.4.2). I created a User Library Felix pointing to /usr/local/java/felix-1.4.2/felix.jar and also another user library named ‘Felix Bundles’ with all three other JARs.
Then, I only need to setup a conf/config.properties in each project. However, the paths inside this file must be edited where the startup bundles reside on disk. The run configuration needs a VM configuration argument -Dfelix.config.properties=file:conf/config.properties
March 25, 2009, 3:00 pmSlawomir Zielinski:
Hi Neil, hope you finish that book very soon - so far it is wonderful!
One little remark (for now…): on page 16 you write “Optionally, information about the minimum Java version that the bundle needs to run on.”
I assume you are writing about JRE version. But OSGi is expected to run on many platforms, including e.g. J2ME. Does the metadata contain more specific info (e.g. the required profile and its version)? I guess it does. Of course, chapter 1 is not the place to deal with details, but “Java version” says nothing.
Well, that’s chapter 1. Now I’m getting to chapter 2…
Regards, Slawek
April 4, 2009, 1:19 pmtaknev:
Thanks for taking up such an endeavor. Not yet started reading, but will update my comments once I complete it.
April 8, 2009, 6:03 pmroger schildmeijer:
errata: p.52 fourth row from the end. should be Export-Package instead of Import-Package
April 9, 2009, 7:51 pmroger schildmeijer:
page 119, section 6.3 safe publications before: “Initialise an object …” after: “• Initialize an object…”
April 12, 2009, 10:25 amOSGi Training « EclipseSource Blog:
[...] OSGi in Practice, by Neil Bartlett [...]
April 14, 2009, 4:47 pmdev:
where can i download the sourcecode of the book?
April 23, 2009, 10:08 amSlawomir Zielinski:
Page 81: “Users of non-Windows operating systems tend to know how to find their home directory already.” :)=) !!! More sentences like that, please!!! SZ
April 23, 2009, 3:26 pmSlawomir Zielinski:
page 145: “the broker will have a much longer life than the individual observers or listeners” — shouldn’t there be “observables” instead of “observers”? The same (mistake?) occurs a few times in that section.
page 96: boolean “ANT”… i.e. a little binary creature
?
Regards, SZ
April 24, 2009, 1:06 pmJared MacDonald:
Hi Neil,
It’s great to have this book - I’m about to dive in.
I am eagerly anticipating the section on testing OSGi bundles - this has been the hardest part for me in our OSGi usage so far (knowing things are in stable before you can actually start asserting anything, for example).
Thanks again, Jared
April 30, 2009, 1:43 pmrt:
Great Book, however I’m stuck on chapter 3, if anyone could help please. I copied the interface bundle, but I can’t get bnd to import it into the fixedmailbox bundle. I’m using Eclipse and the imports for the Message (and the other) interfaces are unresolved. Doing a “make Bundle” (in the fixedmailbox bundle), does not work as described in the book. All teh .java files are in error hence my package appears empty to bnd. Any ideas would be great
June 3, 2009, 9:12 pmBreton:
I ve just read chapter 1 and 2. I can already say I m very pleased to read this book. This is a very good introduction for me in OSGI world Thanks to Neil …
Breton.
June 9, 2009, 1:11 pmGary:
Neil (and others).. Hoping you could answer a quick question that reading your book raised.. I was looking for a “pattern” on how to package up some functionality and when I saw the section on Fragments I thought “this is it!”.. What I can’t seem to square is how to use Fragments with Declarative Services.. Since the fragment never gets “started” I can’t see how DS knows about the service(s) contained in the fragment. The reason I want to do this is the fragment implements an interface described by the Host Bundle.. The Host will then use the fragments implementation.. I don’t want to expose the fragment to the general public.. It’s really private to the Host.. But I didn’t want to include the impl inside the host bundle because then I’d need to swap the entire bundle if I wanted to change out the impl.. Anyways. Hoping you could explain how Fragments play with DS (if at all)..
Thanks!!! Gary
June 22, 2009, 3:26 pmGary:
By the way.. Forgot to mention this.. I love the book.. Just what I needed.
Thanks again Gary
June 22, 2009, 3:26 pmJohnny:
Nice book! Thx for sharing this!
June 24, 2009, 2:46 pmJohnny:
Nice work on the book and thx for sharing.
June 24, 2009, 2:53 pmRichard Clayton:
Neil,
This really jump-started my OSGi development. I’ve been scouring the web for information/tutorials on the different implementations and came across your book. I would have to say that it is by far one of the better technical books I have read. I know that you are publishing this under the CC license, but will there eventually be a print copy? I realize that I could just “print out” the pdf copy, but I would rather reward you for your efforts.
July 6, 2009, 1:09 pmLi Shu Qiang:
Thx Man
July 14, 2009, 1:52 amOSGi Bookshelf, update 1 « The OSGi Look:
[...] OSGi in Practice, by Neil Bartlett No big news on this side, the book is not complete yet, but it’s free, and it’s, in my opinion, the most well-written book on the topic. Donwload it here [...]
July 21, 2009, 12:22 pmLi Shu Qiang:
good book
July 23, 2009, 7:37 amWill:
Hi Neil,
Thanks for the book as well as the series on OSGi and the interview you did with InfoQ on OSGi technology.
I have a question regarding OSGi…
I am doing a project where I am using OSGi to add modularity to my application. I am following the extender based model with the OSGi framework hosted in the application itself. I am using Apache Felix. When the app starts it creates an instance of Felix and can search out and install bundles. So far this is working ok.
My question is in regards to writing the bundle extensions for my main app. The application has an api which is basically in a package org.xyz.api and bundles written for my app will need to import this package. I am confused as to how exactly this would happen. My idea is to have a ‘plugins’ folder where bundle .jars would be placed and the app can search them out and install them (which I have managed to work out successfully by deploying a simple ‘Hello, World’ bundle in there).
However, I am unsure as to how someone would develop a bundle utilizing my API package and how they would test it. I am trying to write a bundle to test this and I am stuck on how to test - If I import org.xyz.api.* in the test bundle will it compile so I can create the .jar to place in the ‘plugins’ folder and then run the app to test the bundle…?
Any assistance will be greatly appreciated. I am very new to OSGi so forgive me if I am mixing up issues. You can email me directly. Thanks.
August 1, 2009, 10:04 pmFranck:
Hi Neil,
many thanks for the book! I’m just about to try the first example but the annoying thing is that the examples are not directly usable from a copy/paste: I get text like i m p o r t org . osgi . f r a m e w o r k . B u n d l e A c t i v a t o r ; instead of import org.osgi.framework.BundleActivator;
Could you change the way the examples are written or provide alink to the source code?
Thanks! Franck
August 4, 2009, 10:20 amOSGi Bookshelf, update 1 | The OGSi Look:
[...] OSGi in Practice, by Neil Bartlett No big news on this side, the book is not complete yet, but it’s free, and it’s, in my opinion, the most well-written book on the topic. Donwload it here [...]
August 12, 2009, 9:49 amModular Java: a review | The OGSi Look:
[...] target is probably not the OSGi absolute beginner, who will benefit more from reading a book like OSGi in Practice (or the specification itself), but the OSGi practitioner who wants to start developing its OSGi [...]
August 13, 2009, 1:16 pmJosh’s prever » Adopting OSGi requires patience and money, but development flexibility results:
[...] blogs and articles, and in some recently published books, such as Modular Java by Craig Walls and OSGi in Practice by Neil [...]
August 19, 2009, 4:51 amDaniel Beck:
Hi Neil,
it is difficult to read books in the PDF format on a ebook reader (like the SONY ebook reader). would it be possible to release “OSGI in action” in the EPUB format? EPUB is a free and open standard.
Thanks Daniel
September 2, 2009, 8:09 amMike:
Where’s Neil?
Has anyone noticed that Neil has stopped answering these comments? Too bad, because in addition to a very useful book having direct access to the author for questions could be a great help.
Maybe we can try to help each other right here?
For instance I have a question I’ll pose for Neil but if anyone else has an answer feel free to jump in.
As an example I’d like to try and answer rt’s question.
rt, I have not had the problem you described. You do not have to “do” anything to get bnd to import a referenced bundle; it does this automaticaly. Here are a few things to check, make sure when you created the API bundle, you exported the packages. Also make sure you have no errors in your fixedmailbox code and you are implementing the interfaces in the StringMessage and FixedMailbox classes and have imported the API package (without the right import statements you will get build errors anyway).
Hope this helps.
Let’s try to help one another. I’m sure Neil is a busy guy.
Neil it would be great to get your input where you can, but anyway thanks for a very good book. Can’t wait to see the final product.
September 2, 2009, 10:56 pmMike:
Now for my question!
When working with the fixedmailbox example the book first has us create a bundle with only the StringMessage and FixedMailbox classes. Recall that these classes are in the org.osgi.book.reader.fixedmailbox package. We then create a bundle called fixed_mailbox.jar. So far all’s well.
Next we create a class called WelcomeMailboxActivator in the fixedmailbox package. We then create a bundle called welcome_mailbox.jar.
Now we have two different bundles built from the same packages. The welcomemailbox.jar bundle contains all the classes in the fixedmailbox package. The fixedmailbox.jar bundle contains only the StringMessage and FixedMailbox classes, as it should since WelcomeMailboxActivator was not part of the package when the fixed_mailbox.jar bundle was built.
But say we now needed to go back and rebuild the fixedmailbox.jar bundle for some reason (i.e. a change to one of the classes in the bundle). When we rebuild the resulting fixedmailbox.jar bundle is now the same as the welcome_mailbox bundle.
Does anyone think there is an error in the book and the WelcomeMailboxActivator class should have been put in a serarate package? If not, then doesn’t the two similar bundles seem to be a problem?
I’m looking at this not only from a code viewpoint, but also from a design viewpoint. I would not want to design in this way, would anyone else?
Neil if you’re still around, can you expalin?
Can anyone else?
Thanx!
September 2, 2009, 11:18 pmMike:
rt,
Another very simple reason why your bundle .jar is empty is because you have not built your project, either because you just have not built it or your source code has errors!
No build, no .class files; no .class files, no bundle!
I know there is am OSGi forum on this site, but if questions are raised here I see no reason to answer them here.
Mike
September 5, 2009, 2:39 pm3 variations on OSGi themes: part 8 « CodingAndBeyond:
[...] Bartlett, OSGi in Practice, 2009 [...]
September 7, 2009, 2:14 pmEng Sing:
Hi Neil,
First of all, thanks for making a book on OSGI and make it freely available to everyone.
I like the way you write this topic, particularly on the introduction where you describe the most difficult challenge in any engineering projects is complexity.
In fact, Java suffers the same, where the core remains simple, but on the other hand, Java EE is pretty complex. So, for you to write a topic on OSGI using a simplistic approach is remarkable.
Keep it up!
October 3, 2009, 2:58 pmAlex Dvoretsky:
Hi Nell, can you provide the draft in .epub format too? Or at least as source files (TeX)?
TIA
October 10, 2009, 6:45 pmJVerstry:
Great draft, really clear… Just make sure you include a section explaining how to start OSGi from scratch !!!
October 30, 2009, 12:01 amEddie:
good book
November 18, 2009, 6:54 amBehrang Saeedzadeh:
In Figure 1.5 at page 14, the EJB class loader and the WAR class loader are shown as siblings, however the WAR class loader should be a child of the EJB class loader, as all EJB classes are visible to WAR classes.
November 28, 2009, 6:50 amBehrang Saeedzadeh:
Thanks for the great book by the way!
November 28, 2009, 6:51 amAna Rossello:
Hi!
I´m just getting started with OSGi and I am reading your book.
I think I found a mistake in page 8 in the numbered list, point 5, I think it should say fails instead of files:
- The extension class loader files to find the class, so the application class
loader tries to find it, looking first in log4j.jar.
December 2, 2009, 8:56 amTimo:
I’m getting started with OSGi and I am reading your book. It’s increadible useful and the best I source for an introduction I came across yet.
That’s either it’s the best source available or I am just no good at finding something better. Most likely it’s a mix of both of it (though I stopped searching after I found the book…)
January 10, 2010, 2:18 amNathan Moos:
Great book. Once it’s finished, I’ll be looking forward to seeing it completed!
January 15, 2010, 2:45 amPhilipp Kursawe:
Is there a newer version of this book available as pdf? This one is from January last year. I am particular interested in the Configuration Admin and how it works with DS and the MetaType service.
January 29, 2010, 8:17 amWang Feng:
Just finish reading first 3 chapter. It’s a very good book. Thank you Neil!
January 29, 2010, 8:18 am