<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Creating OSGi bundles</title>
	<atom:link href="http://blog.springsource.com/2008/02/18/creating-osgi-bundles/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.springsource.com/2008/02/18/creating-osgi-bundles/</link>
	<description>The voice of SpringSource</description>
	<lastBuildDate>Sat, 20 Mar 2010 12:14:29 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: OSGi bez irytacji</title>
		<link>http://blog.springsource.com/2008/02/18/creating-osgi-bundles/comment-page-1/#comment-171559</link>
		<dc:creator>OSGi bez irytacji</dc:creator>
		<pubDate>Tue, 09 Mar 2010 11:26:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/02/18/creating-osgi-bundles/#comment-171559</guid>
		<description>[...] Creating OSGi Bundles [...]</description>
		<content:encoded><![CDATA[<p>[...] Creating OSGi Bundles [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OSGi bez irytacji</title>
		<link>http://blog.springsource.com/2008/02/18/creating-osgi-bundles/comment-page-1/#comment-171560</link>
		<dc:creator>OSGi bez irytacji</dc:creator>
		<pubDate>Tue, 09 Mar 2010 11:26:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/02/18/creating-osgi-bundles/#comment-171560</guid>
		<description>[...] Creating OSGi Bundles [...]</description>
		<content:encoded><![CDATA[<p>[...] Creating OSGi Bundles [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raja</title>
		<link>http://blog.springsource.com/2008/02/18/creating-osgi-bundles/comment-page-1/#comment-171267</link>
		<dc:creator>Raja</dc:creator>
		<pubDate>Mon, 08 Feb 2010 00:23:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/02/18/creating-osgi-bundles/#comment-171267</guid>
		<description>I created bundles for third party jars using BND plugin. All packages are exported. But, still when I try to use it, I get &quot;The constructor is not accessible due to restriction on required library &quot;. Any idea on why this happens and how to avoid this?

Thanks,

- Raja.</description>
		<content:encoded><![CDATA[<p>I created bundles for third party jars using BND plugin. All packages are exported. But, still when I try to use it, I get &#034;The constructor is not accessible due to restriction on required library &#034;. Any idea on why this happens and how to avoid this?</p>
<p>Thanks,</p>
<p>- Raja.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hello world!</title>
		<link>http://blog.springsource.com/2008/02/18/creating-osgi-bundles/comment-page-1/#comment-169501</link>
		<dc:creator>Hello world!</dc:creator>
		<pubDate>Tue, 17 Nov 2009 09:25:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/02/18/creating-osgi-bundles/#comment-169501</guid>
		<description>[...] as for OSGi, you can read what Matt Raible wrote. Don&#8217;t forget to skim Costin Leau&#8217;s blog entry discussing OSGi bundles (&#8221;bundle&#8221; is just a fancy alias for &#8220;jar&#8221;, I&#8217;m [...]</description>
		<content:encoded><![CDATA[<p>[...] as for OSGi, you can read what Matt Raible wrote. Don&#039;t forget to skim Costin Leau&#039;s blog entry discussing OSGi bundles (&#034;bundle&#034; is just a fancy alias for &#034;jar&#034;, I&#039;m [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brian.h.gt</title>
		<link>http://blog.springsource.com/2008/02/18/creating-osgi-bundles/comment-page-1/#comment-167515</link>
		<dc:creator>brian.h.gt</dc:creator>
		<pubDate>Wed, 08 Jul 2009 03:07:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/02/18/creating-osgi-bundles/#comment-167515</guid>
		<description>&quot;But due to the fact that the project i was working on was not structured in a set of subprojects so that i could have used eclipse pde for my developing but rather consisted of one huge classpath during build time&quot;

Yeah, it looks like bnd works great for projects that are not structured... but I&#039;m disappointed that it doesn&#039;t work for projects that _are_ structured.

Working with Eclipse and separating your bundles into logical projects with individual manifests is, in my opinion, cleaner and more modular.  However, I have not found bnd to support this.  Hiding packages (so that two classes with the same name and package could potentially exist in separate bundles and not exported) is a feature of OSGi and using one giant unstructured src/bin folder destroys that!

In my perfect world:
1) The manifest should be maintained in only _one_ spot.  Generating it every time doesn&#039;t work well with version control or for just running your src straight out of the box with an IDE.  Saying, &quot;Oh, by the way... you have to run these ANT targets before you open Eclipse&quot; isn&#039;t fun.
2) Compiling a bundle with ANT would be easy with multiple projects, source folders, and manifests.

I won&#039;t be using bnd as a build tool.</description>
		<content:encoded><![CDATA[<p>&#034;But due to the fact that the project i was working on was not structured in a set of subprojects so that i could have used eclipse pde for my developing but rather consisted of one huge classpath during build time&#034;</p>
<p>Yeah, it looks like bnd works great for projects that are not structured&#8230; but I&#039;m disappointed that it doesn&#039;t work for projects that _are_ structured.</p>
<p>Working with Eclipse and separating your bundles into logical projects with individual manifests is, in my opinion, cleaner and more modular.  However, I have not found bnd to support this.  Hiding packages (so that two classes with the same name and package could potentially exist in separate bundles and not exported) is a feature of OSGi and using one giant unstructured src/bin folder destroys that!</p>
<p>In my perfect world:<br />
1) The manifest should be maintained in only _one_ spot.  Generating it every time doesn&#039;t work well with version control or for just running your src straight out of the box with an IDE.  Saying, &#034;Oh, by the way&#8230; you have to run these ANT targets before you open Eclipse&#034; isn&#039;t fun.<br />
2) Compiling a bundle with ANT would be easy with multiple projects, source folders, and manifests.</p>
<p>I won&#039;t be using bnd as a build tool.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2009-04-23 &#171; Niels&#8217; blog</title>
		<link>http://blog.springsource.com/2008/02/18/creating-osgi-bundles/comment-page-1/#comment-164252</link>
		<dc:creator>links for 2009-04-23 &#171; Niels&#8217; blog</dc:creator>
		<pubDate>Fri, 24 Apr 2009 06:05:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/02/18/creating-osgi-bundles/#comment-164252</guid>
		<description>[...] SpringSource Team Blog » Creating OSGi bundles (tags: bnd osgi spring tutorial) [...]</description>
		<content:encoded><![CDATA[<p>[...] SpringSource Team Blog » Creating OSGi bundles (tags: bnd osgi spring tutorial) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SpringSource Team Blog &#187; Exposing the boot classpath in OSGi</title>
		<link>http://blog.springsource.com/2008/02/18/creating-osgi-bundles/comment-page-1/#comment-143483</link>
		<dc:creator>SpringSource Team Blog &#187; Exposing the boot classpath in OSGi</dc:creator>
		<pubDate>Mon, 19 Jan 2009 20:18:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/02/18/creating-osgi-bundles/#comment-143483</guid>
		<description>[...] to the bootstrapping classpath from OSGi, without bundling it. To express package dependencies, bundles use the OSGi directive inside their manifests - mainly Export-Package and Import-Package for [...]</description>
		<content:encoded><![CDATA[<p>[...] to the bootstrapping classpath from OSGi, without bundling it. To express package dependencies, bundles use the OSGi directive inside their manifests &#8211; mainly Export-Package and Import-Package for [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bundles in OSGi &#171; Sukasom</title>
		<link>http://blog.springsource.com/2008/02/18/creating-osgi-bundles/comment-page-1/#comment-114897</link>
		<dc:creator>Bundles in OSGi &#171; Sukasom</dc:creator>
		<pubDate>Mon, 28 Jul 2008 11:15:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/02/18/creating-osgi-bundles/#comment-114897</guid>
		<description>[...] There is a new concept called &#8220;Bundle.&#8221; A bundle is actually a group of required Java files and resouces.  It is similar to a Jar file which is a zip file containing java class file and resources. However, a Jar file does not have information about OSGi which is used for managing the software component life cycle. It allows developers to add or remove a Java component (bundle) during runtime. Read here for more info on OSGi. Costin Leau wrote a good article on Bundle. [...]</description>
		<content:encoded><![CDATA[<p>[...] There is a new concept called &#034;Bundle.&#034; A bundle is actually a group of required Java files and resouces.  It is similar to a Jar file which is a zip file containing java class file and resources. However, a Jar file does not have information about OSGi which is used for managing the software component life cycle. It allows developers to add or remove a Java component (bundle) during runtime. Read here for more info on OSGi. Costin Leau wrote a good article on Bundle. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: netzooid &#187; Blog Archive &#187; Mixing JARs and OSGi Bundles with Maven</title>
		<link>http://blog.springsource.com/2008/02/18/creating-osgi-bundles/comment-page-1/#comment-111676</link>
		<dc:creator>netzooid &#187; Blog Archive &#187; Mixing JARs and OSGi Bundles with Maven</dc:creator>
		<pubDate>Fri, 04 Jul 2008 18:04:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/02/18/creating-osgi-bundles/#comment-111676</guid>
		<description>[...] Next option: What if I used BND to modify JARs inside a repository and adding headers. Now you avoid all the issues around conflicting artifact/group ids, but you open up another can of worms. If the dependency is in your local repository, then you have the issue of having a different JAR from the regular Maven repository. Checksums and signatures: broken. [...]</description>
		<content:encoded><![CDATA[<p>[...] Next option: What if I used BND to modify JARs inside a repository and adding headers. Now you avoid all the issues around conflicting artifact/group ids, but you open up another can of worms. If the dependency is in your local repository, then you have the issue of having a different JAR from the regular Maven repository. Checksums and signatures: broken. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Costin Leau</title>
		<link>http://blog.springsource.com/2008/02/18/creating-osgi-bundles/comment-page-1/#comment-102158</link>
		<dc:creator>Costin Leau</dc:creator>
		<pubDate>Wed, 02 Apr 2008 07:12:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/02/18/creating-osgi-bundles/#comment-102158</guid>
		<description>[quote comment=&quot;102133&quot;]However, I wasn&#039;t able to find any reference to the MANIFEST.MF file that has to be the first entry on the jar file?
Actually, I had a look in my jars and saw not all are following this rule. I also looked in the OSGi core spec and didn&#039;t find anything related to it. I was surprised about this one because I didn&#039;t have much problems running Eclipse RCP with some bad jars this way.[/quote]

I believe the &quot;rule&quot; of MANIFEST.MF being the first entry is more of a best practice. If I recall correctly, it depends on how the jar is created or read. Archives created with the standard Jar tool will always have the /META-INF/MANIFEST.MF as a first entry (try jar-tvf some.jar). If memory serves me right, Equinox had no problems reading Jars with misplaced MANIFEST.MF but Knopflerfish had, since it relied on JarInputStream which, I think, doesn&#039;t read the MANIFEST unless it is the first entry.
From a stream point of view, this makes sense since the manifest is supposed to describe the archive structure and thus, should be the first available data in the stream, before the actual content.

At the end of day, it&#039;s not about the OSGi spec but rather on how the jar is actually handled at low-level. One difference between the platforms, that we discovered early on in this area for example, was the difference in which folder entries are handled. An archive can contain just the selected files but not the folder entries. 
That is, only:
/a/b/c/file.txt 

vs:

/a/
/a/b/
/a/b/c/
/a/b/c/file.txt

Depending on the tool that you create/use, such &#039;synthethic&#039; entries can be created automatically for you or not - however, without them, searching a bundle jar can yield different results depending on whether the platform will consider the folder entries even if they don&#039;t exist or will use only what&#039;s available in the archive.

[quote comment=102133&quot;]
One last thing: in Eclipse, it seems like bundle naming (not the things inside the MANIFEST, I mean the jar name) is important. For example, we recently had a problem with a bundle we created &quot;asm.jar&quot;. I seem to remember we just renamed it so that the bundle was then named something like: Bundle-SymbolicName_Bunddle-Version.jar and then all went fine...
Though I didn&#039;t find any rules about bundle naming in the spec, is there any??? Could someone confirm or not that Equinox has (or may have in some situations) a special behaviour about bundle management?[/quote]
I am not aware of such a requirement in the OSGi spec or Equinox - in fact, the jars that we use in our tests have very different naming patterns and none of them resembles the one you mentioned. Maybe you are using Eclipse PDE where the jars have a certain pattern?
The actual jar name can be useful only for the bundle location (populated during install) so on bundle refresh (unless a different location in the manifest is specified), the jar is read again. But this shouldn&#039;t be affected by a &quot;&lt;name&gt;.jar&quot; style.

Hope this helps</description>
		<content:encoded><![CDATA[<p>[quote comment="102133"]However, I wasn&#039;t able to find any reference to the MANIFEST.MF file that has to be the first entry on the jar file?<br />
Actually, I had a look in my jars and saw not all are following this rule. I also looked in the OSGi core spec and didn&#039;t find anything related to it. I was surprised about this one because I didn&#039;t have much problems running Eclipse RCP with some bad jars this way.[/quote]</p>
<p>I believe the &#034;rule&#034; of MANIFEST.MF being the first entry is more of a best practice. If I recall correctly, it depends on how the jar is created or read. Archives created with the standard Jar tool will always have the /META-INF/MANIFEST.MF as a first entry (try jar-tvf some.jar). If memory serves me right, Equinox had no problems reading Jars with misplaced MANIFEST.MF but Knopflerfish had, since it relied on JarInputStream which, I think, doesn&#039;t read the MANIFEST unless it is the first entry.<br />
From a stream point of view, this makes sense since the manifest is supposed to describe the archive structure and thus, should be the first available data in the stream, before the actual content.</p>
<p>At the end of day, it&#039;s not about the OSGi spec but rather on how the jar is actually handled at low-level. One difference between the platforms, that we discovered early on in this area for example, was the difference in which folder entries are handled. An archive can contain just the selected files but not the folder entries.<br />
That is, only:<br />
/a/b/c/file.txt </p>
<p>vs:</p>
<p>/a/<br />
/a/b/<br />
/a/b/c/<br />
/a/b/c/file.txt</p>
<p>Depending on the tool that you create/use, such &#039;synthethic&#039; entries can be created automatically for you or not &#8211; however, without them, searching a bundle jar can yield different results depending on whether the platform will consider the folder entries even if they don&#039;t exist or will use only what&#039;s available in the archive.</p>
<p>[quote comment=102133"]<br />
One last thing: in Eclipse, it seems like bundle naming (not the things inside the MANIFEST, I mean the jar name) is important. For example, we recently had a problem with a bundle we created &#034;asm.jar&#034;. I seem to remember we just renamed it so that the bundle was then named something like: Bundle-SymbolicName_Bunddle-Version.jar and then all went fine&#8230;<br />
Though I didn&#039;t find any rules about bundle naming in the spec, is there any??? Could someone confirm or not that Equinox has (or may have in some situations) a special behaviour about bundle management?[/quote]<br />
I am not aware of such a requirement in the OSGi spec or Equinox &#8211; in fact, the jars that we use in our tests have very different naming patterns and none of them resembles the one you mentioned. Maybe you are using Eclipse PDE where the jars have a certain pattern?<br />
The actual jar name can be useful only for the bundle location (populated during install) so on bundle refresh (unless a different location in the manifest is specified), the jar is read again. But this shouldn&#039;t be affected by a &#034;<name>.jar&#034; style.</p>
<p>Hope this helps</name></p>
]]></content:encoded>
	</item>
</channel>
</rss>
