<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>OSGI on ilikeorangutans</title><link>https://kuelzer.ca/tags/osgi/</link><description>Recent content in OSGI on ilikeorangutans</description><generator>Hugo</generator><language>en</language><copyright>© 2026 Jakob Külzer</copyright><lastBuildDate>Sun, 12 Apr 2026 14:27:24 -0400</lastBuildDate><atom:link href="https://kuelzer.ca/tags/osgi/index.xml" rel="self" type="application/rss+xml"/><item><title>OSGI, Guice, and Peaberry: first steps</title><link>https://kuelzer.ca/posts/2013/02/27/osgi-guice-and-peaberry-first-steps/</link><pubDate>Wed, 27 Feb 2013 13:59:40 -0400</pubDate><guid>https://kuelzer.ca/posts/2013/02/27/osgi-guice-and-peaberry-first-steps/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;ve been trying to get &lt;a href="https://code.google.com/p/google-guice/"&gt;Google Guice&lt;/a&gt; and &lt;a href="https://code.google.com/p/peaberry/"&gt;Peaberry&lt;/a&gt; to work in my OSGI projects for a while. Google Guice is a great dependency injection framework, and Peaberry promises to bridge the gap between OSGI services and dependency injection.&lt;/p&gt;
&lt;p&gt;However, getting Peaberry to work was not trivial, mostly because there aren&amp;rsquo;t many docs and the quality of the docs is somewhat lacking. The best piece is still this pdf &lt;a href="https://code.google.com/p/peaberry/downloads/detail?name=peaberry%20-%20blending%20services%20and%20extensions.pdf"&gt;Peaberry - blending services and extensions&lt;/a&gt;, but it&amp;rsquo;s a lot of information in very little space.&lt;/p&gt;</description></item><item><title>Type Incompatibility With Maven SCR Plugin</title><link>https://kuelzer.ca/posts/2013/02/06/type-incompatibility-with-maven-scr-plugin/</link><pubDate>Wed, 06 Feb 2013 13:59:40 -0400</pubDate><guid>https://kuelzer.ca/posts/2013/02/06/type-incompatibility-with-maven-scr-plugin/</guid><description>&lt;p&gt;Yesterday I ran into a most strange error when compiling one of my OSGI bundles:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[ERROR] Failed to execute goal org.apache.felix:maven-scr-plugin:1.7.4:scr (generate-scr-scrdescriptor) on project XXX: A type incompatibility occured while executing org.apache.felix:maven-scr-plugin:1.7.4:scr: com.thoughtworks.qdox.model.Annotation cannot be cast to java.util.List
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I saw several variations of that error and was initially clueless as how to fix it. However, I eventually found the problem:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-java" data-lang="java"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nd"&gt;@Service&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MyService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ManagedService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nd"&gt;@Component&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;immediate&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nd"&gt;@Properties&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@Property&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;foo&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;bar&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;public&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;NissanAutoDataUrlGenerator&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;implements&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ManagedService&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The mistake is that the &lt;code&gt;@Properties&lt;/code&gt; annotation takes an array as it&amp;rsquo;s parameter. Eclipse does not mark the above as an error, however, the Maven plugin is not happy about it. Here&amp;rsquo;s the correct code:&lt;/p&gt;</description></item><item><title>Apache Sling Resource Resolver Rules in a Nutshell</title><link>https://kuelzer.ca/posts/2012/11/20/apache-sling-resource-resolver-rule-priority-explained/</link><pubDate>Tue, 20 Nov 2012 13:59:40 -0400</pubDate><guid>https://kuelzer.ca/posts/2012/11/20/apache-sling-resource-resolver-rule-priority-explained/</guid><description>&lt;p&gt;If you work with Apache Sling, you have probably encountered the ResourceResolver and its configuration rules.
In short, the ResourceResolver is the part of Sling that resolves incoming requests to actual or virtual
resources. For example, if a request for &lt;code&gt;/foo/bar&lt;/code&gt; is coming in the resolver will resolve that to a
corresponding node in the JCR. However, sometimes it is not desireable to expose the internal structure of the
repository or the required external structure cannot be represented using the JCR. In that case the resolver
can be customized by installing resolver rules. Resolver rules can be modified via the OSGI configuration
editor or the OSGI ConfigurationAdmin.&lt;/p&gt;</description></item><item><title>commons-logging in OSGI Environments</title><link>https://kuelzer.ca/posts/2012/11/14/commons-logging-in-osgi-environments/</link><pubDate>Wed, 14 Nov 2012 13:59:40 -0400</pubDate><guid>https://kuelzer.ca/posts/2012/11/14/commons-logging-in-osgi-environments/</guid><description>&lt;p&gt;While working on a small toy project using Apache Felix and commons-httpclient, I kept running into the issue that there is no official OSGI bundle for Apache commons-logging out there. While most Apache commons projects either provide simple bundles or full blown OSGI implementations with Activators and Services, commons-logging is an interesting exception. If you scan the &lt;a href="http://wiki.apache.org/commons/CommonsOsgi"&gt;Commons OSGI status page&lt;/a&gt;, you will notice that there is no OSGI version for commons-logging available, and a separate section to explain why. I haven&amp;rsquo;t dug into why and how it conflicts with the OSGI classloading scheme, but I can see that being a problem. Be it as it may, there is no official OSGI bundle for commons logging.&lt;/p&gt;</description></item><item><title>OSGI Bootstrapping</title><link>https://kuelzer.ca/posts/2012/10/23/osgi-bootstrapping/</link><pubDate>Tue, 23 Oct 2012 13:59:40 -0400</pubDate><guid>https://kuelzer.ca/posts/2012/10/23/osgi-bootstrapping/</guid><description>&lt;p&gt;I&amp;rsquo;ve been working with OSGI based technology for a while now and it&amp;rsquo;s a great piece of technology. However, so far I&amp;rsquo;ve only worked with OSGI technology that runs in existing instances of the framework. A running framework is easy to deal with, but how do you get to this point? I spent some time today playing with that, and it took me a while to put it all together. So naturally, I&amp;rsquo;ll have to record my findings here.&lt;/p&gt;</description></item><item><title>OSGI Classloading Reading List</title><link>https://kuelzer.ca/posts/2012/10/12/osgi-classloading-reading-list/</link><pubDate>Fri, 12 Oct 2012 13:59:40 -0400</pubDate><guid>https://kuelzer.ca/posts/2012/10/12/osgi-classloading-reading-list/</guid><description>&lt;p&gt;I&amp;rsquo;ve been doing a lot of reading on how OSGI handles class loading. I&amp;rsquo;m starting to fully understand and leverage OSGI and I&amp;rsquo;m trying to keep my framework &lt;a href="https://github.com/ilikeorangutans/omf"&gt;Object Mapper&lt;/a&gt; as compatible with OSGI as I can.&lt;/p&gt;
&lt;p&gt;In OSGI classloading is very restricted, similar to what happens in enterprisy Java application servers, and completely unlike traditional Java applications where everything shares a single classloader. In OSGI each bundle has its own classloader and what is visible accross the bundle boundaries is subject to strict export rules. In order to use a class outside of a bundle you&amp;rsquo;ll have to explicitly declare its package as exported. There are many benefits to this strict architecture, clean architectures, reusable components and the ability to update bundles at runtime are probably the most important ones.&lt;/p&gt;</description></item></channel></rss>