<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>A Day At The Races &#187; general</title>
	<atom:link href="http://blog.jetztgrad.net/category/general/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jetztgrad.net</link>
	<description>Programming was my first love, and it will be my last.</description>
	<lastBuildDate>Mon, 26 Jul 2010 22:27:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Grails on OSGi: Released Grails OSGi plugin 0.2.1</title>
		<link>http://blog.jetztgrad.net/2010/07/grails-on-osgi-released-grails-osgi-plugin-0-2-1/</link>
		<comments>http://blog.jetztgrad.net/2010/07/grails-on-osgi-released-grails-osgi-plugin-0-2-1/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 22:27:41 +0000</pubDate>
		<dc:creator>jetztgradnet</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://blog.jetztgrad.net/?p=263</guid>
		<description><![CDATA[I just released a small update for the OSGi plugin, which fixes dependency resolution for Spring DM.
Thanks to lemnitram and Klaus Baumecker for reporting it.
Spring DM 2.0 is currently only available as snapshot release (2.0.0.M1). The jars used to be available from other repositories (e.g. SpringSource Enterprise Bundle Repository (EBR)), but they have vanished, so [...]]]></description>
			<content:encoded><![CDATA[<p>I just released a small update for the <a href="http://grails.org/plugin/osgi">OSGi plugin</a>, which <a href="http://github.com/jetztgradnet/grails-osgi-plugin/issues/issue/15">fixes dependency resolution</a> for <a href="http://www.springsource.org/osgi">Spring DM</a>.</p>
<p>Thanks to <a href="http://github.com/jetztgradnet/grails-osgi-plugin/issues/issue/15">lemnitram</a> and <a href="http://blog.jetztgrad.net/2010/07/grails-on-osgi-released-grails-osgi-plugin-0-2/#comment-323">Klaus Baumecker</a> for reporting it.</p>
<p>Spring DM 2.0 is currently only available as snapshot release (2.0.0.M1). The jars used to be available from other repositories (e.g. <a href="http://www.springsource.com/repository/">SpringSource Enterprise Bundle Repository</a> (EBR)), but they have vanished, so I needed to add the Spring Milestone Repository.</p>
<p>For installation and usage of the plugin see me previous <a href="/2010/07/grails-on-osgi-released-grails-osgi-plugin-0-2/">blog post</a> and the <a href="http://grails.org/plugin/osgi">docs</a>.</p>
<p>Spring DM has been <a href="http://www.eclipse.org/proposals/gemini/">donated</a> to the <a href="http://www.eclipse.org/">Eclipse Foundation</a> by <a href="http://www.springsource.com/">SpringSource</a>, where it will be part of the <a href="http://eclipse.org/gemini/blueprint/">Gemini Blueprint</a> and <a href="http://eclipse.org/gemini/web/">Gemini Web</a> projects. This means, that Spring DM 2.0 will never be released, so the <a href="http://grails.org/plugin/osgi">OSGi Plugin</a> needs to be <a href="http://eclipse.org/gemini/blueprint/documentation/migration/">ported</a> to use <a href="http://eclipse.org/gemini/blueprint/">Gemini Blueprint</a> and <a href="http://eclipse.org/gemini/web/">Gemini Web</a> instead. This will happen in the 0.3 release. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jetztgrad.net/2010/07/grails-on-osgi-released-grails-osgi-plugin-0-2-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grails on OSGi: Released Grails OSGi plugin 0.2</title>
		<link>http://blog.jetztgrad.net/2010/07/grails-on-osgi-released-grails-osgi-plugin-0-2/</link>
		<comments>http://blog.jetztgrad.net/2010/07/grails-on-osgi-released-grails-osgi-plugin-0-2/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 00:08:32 +0000</pubDate>
		<dc:creator>jetztgradnet</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://blog.jetztgrad.net/?p=245</guid>
		<description><![CDATA[I just released version 0.2 of my OSGi plugin for Grails. The OSGi plugin is released under the Apache License 2.0.
The Grails OSGi plugin adds support to package and run a Grails application as an OSGi bundle. The bundle(s) may be run in an ad hoc assembled OSGi container or deployed to an external OSGi [...]]]></description>
			<content:encoded><![CDATA[<p>I just released version 0.2 of my <a href="http://grails.org/plugin/osgi">OSGi plugin</a> for Grails. The OSGi plugin is released under the <a href="http://apache.org/licenses/LICENSE-2.0.txt">Apache License 2.0</a>.</p>
<p>The Grails OSGi plugin adds support to package and run a Grails application as an OSGi bundle. The bundle(s) may be run in an ad hoc assembled OSGi container or deployed to an external OSGi app server such as <a href="http://www.springsource.org/dmserver">SpringSource DM Server</a>, <a href="http://eclipse.org/virgo/">Eclipse Virgo</a>, or <a href="http://karaf.apache.org/">Apache Karaf</a>. </p>
<p>See my <a href="http://blog.jetztgrad.net/grails-on-osgi/">blog series</a> for earlier thoughts and information for running a Grails application in an OSGi environment as well as concepts of and basic information on OSGi.</p>
<p>This post and the following installments of the series will show how to use the plugin and present some examples.</p>
<p><b>Installation</b></p>
<p>Simply call <code>grails install-plugin osgi</code> to install the OSGi plugin.</p>
<p><b>Usage</b></p>
<p><i>Creating an OSGi bundle from the Grails application</i></p>
<p><code>grails bundle</code><br />
<code>grails prod bundle</code></p>
<p><i>Running the bundle</i></p>
<p><code>grails run-bundle</code><br />
<code>grails prod run-bundle</code></p>
<p>The application can be accessed at <a href="http://localhost:8080/myapp-0.1/">http://localhost:8080/myapp-0.1/</a>.</p>
<p><b>Note</b>: at first start the OSGi runtime is assembled, which may take some time, while Ivy is downloading the Internet&#8230;</p>
<p><b>Note</b>: if the bundle exists, it won&#8217;t be re-created automatically after changes. So for now use parameter <code>-forceBundle</code> after changing something in the Grails app: <code>grails run-bundle -forceBundle</code>.</p>
<p><b>Accessing the bundle context</b></p>
<p>The <a href="http://www.osgi.org/javadoc/r4v42/org/osgi/framework/BundleContext.html">bundle context</a> is the primary interface to the OSGi framework. It can be used to find and register services and interact the environment.</p>
<p>The bundle context is available from Grails&#8217; parent ApplicationContext as bean <code>bundleContext</code>. It can be injected into all Spring-managed beans, i.e. all Grails artifacts, like Controllers, Services, etc.</p>
<p>In order to get a reference to the BundleContext, an artifact needs to define a reference with the name <code>bundleContext</code>.</p>
<p><b>Example</b>: controller accessing bundle context</p>
<pre>
class OsgiTestController {
    def bundleContext
    def index = {
        def bundles = []
        if (bundleContext) {
            bundles = bundleContext.bundles
        }
        else {
            flash.message = "bundleContext NOT available"
        }
        [ bundles: bundles ]
    }
}
</pre>
<p><b>Changes since version 0.1</b></p>
<ul>
<li>using Spring DM instead of Pax Web as Web extender</li>
<li>updated Apache Felix WebConsole</li>
<li> replaced (most) dependencies from bundle by OSGi bundles from the <a href="http://www.springsource.com/repository">SpringSource Enterprise Bundle Repository</a> (EBR)</li>
<li>provide access to OSGi <code>BundleContext</code> to artifacts (controllers, services, &#8230;) via Spring injection as bean <code>bundleContext</code></li>
</ul>
<p><b>How it works</b></p>
<p>In order to be a valid OSGi bundle, the application is war&#8217;ed and provided with the necessary bundle manifest headers (see <code>scripts/_Events.groovy</code> for details).<br />
The bundle can be created using <code>grails bundle</code>.  </p>
<p>The OSGi runtime is assembled in the <code>target/osgi</code> directory and uses the <a href="http://eclipse.org/equinox/">Eclipse Equinox</a> OSGi framework, <a href="http://www.springsource.org/osgi">Spring DM</a>.</p>
<p>In the current version, most libraries from </code>WEB-INF/lib</code> are replaced by equivalent OSGi bundles from the <a href="http://www.springsource.com/repository/">SpringSource Enterprise Bundle Repository</a> (EBR). Only Hibernate and Grails libs retain in the bundle. </p>
<p>Grails jars already are OSGi bundles, but they cannot currently be installed cleanly in a OSGi container, as they contain circular dependencies and some other dependencies can not be satisfied (e.g. the Radeox library used by the Grails Wiki is no longer maintained, but it shouldn't be referenced from the Grails runtime anyway...). </p>
<p>There are bundles for Hibernate but due to a bug (possibly in Equinox), Hibernate Cache can not be resolved by the Spring ORM module (see "SPR-7003":https://issues.springsource.org/browse/SPR-7003 for a description of this problem).</p>
<p>The parent ApplicationContext has been replaced in </code>web.xml</code> by an OSGi-aware variant: <a href="http://static.springsource.org/osgi/snapshot-site/apidocs/org/springframework/osgi/web/context/support/OsgiBundleXmlWebApplicationContext.html">OsgiBundleXmlWebApplicationContext</a>. It knows how to <a href="http://static.springsource.org/osgi/docs/2.0.0.M1/reference/html/service-registry.html#service-registry:export">export</a> and <a href="http://static.springsource.org/osgi/docs/2.0.0.M1/reference/html/service-registry.html#service-registry:refs">import</a> OSGi services as/from Spring beans through Spring XML files. These features are currently hidden, but they will be exposed in the next version of the OSGi plugin and made easier through the BeanBuilder DSL and the <a href="http://static.springsource.org/osgi/docs/2.0.0.M1/reference/html/service-registry.html">OSGi namespace</a>.</p>
<p><b>Roadmap</b></p>
<ul>
<li>make bundle generation configurable (e.g. include/exclude dependencies, ...)</li>
<li>make OSGi runtime created by <code>grails run-bundle</code> and <code>grails assemble-osgi-runtime</code> configurable</li>
<li>support auto-reloading of changed artifacts</li>
<li>create sub class of GrailsApplicationContext, which implements <a href="http://static.springsource.org/osgi/snapshot-site/apidocs/org/springframework/osgi/context/ConfigurableOsgiBundleApplicationContext.html">ConfigurableOsgiBundleApplicationContext</a></li>
<li>export main Grails beans and application context as OSGi service</li>
<li>export services as OSGi service (via <code>static expose = 'osgi'</code>)</li>
<li>implement deployment to <a href="http://www.springsource.org/dmserver">SpringSource DM Server</a> or its successor <a href="http://eclipse.org/virgo/">Eclipse Virgo</a>
</li>
<li>implement deployment to <a href="http://karaf.apache.org/">Apache Karaf</a></li>
<li>Spring DM has been donated to Eclipse, so it should be replaced by its successor <a href="http://eclipse.org/gemini/">Eclipse Gemini</a></li>
</ul>
<p><b>Getting around the OSGi runtime</b></p>
<p><i>Web Console</i></p>
<p>The "Felix Web Management Console":http://felix.apache.org/site/apache-felix-web-console.html provides excellent insight into the inner workings. It can be accessed at <a href="http://localhost:8081/system/console/">http://localhost:8081/system/console/</a> with user "admin" and password "admin" (<b>Note</b>: the web console runs on a different port!).</p>
<p><i>Shell Console</i></p>
<p>The command <code>grails run-bundle</code> drops the user in the Equinox Shell (press <code>RETURN</code> if you don't see the <code>osgi></code> prompt). Running <code>grails run-bundle -remoteConsole [port]</code> opens a console with telnet access on the specified port or on port <code>8023</code>, if omitted. Only a single user can use the console at any time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jetztgrad.net/2010/07/grails-on-osgi-released-grails-osgi-plugin-0-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Grails Spy plugin mentioned in Grails podcast</title>
		<link>http://blog.jetztgrad.net/2010/01/grails-spy-plugin-mentioned-in-grails-podcast/</link>
		<comments>http://blog.jetztgrad.net/2010/01/grails-spy-plugin-mentioned-in-grails-podcast/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 00:14:22 +0000</pubDate>
		<dc:creator>jetztgradnet</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://blog.jetztgrad.net/?p=218</guid>
		<description><![CDATA[My Grails Spy plugin was mentioned in the episode 103 (at 0:18:30) of Grails Podcast. Thanks, Glen and Sven!
]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://grails.org/plugin/spy">Grails Spy plugin</a> was mentioned in the <a href="http://www.grailspodcast.com/blog/id/550">episode 103</a> (at 0:18:30) of <a href="http://www.grailspodcast.com/">Grails Podcast</a>. Thanks, <a href="http://blogs.bytecode.com.au/glen/">Glen</a> and <a href="http://hansamann.wordpress.com/">Sven</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jetztgrad.net/2010/01/grails-spy-plugin-mentioned-in-grails-podcast/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Started new offline Grails Plugin Repository</title>
		<link>http://blog.jetztgrad.net/2009/09/started-new-offline-grails-plugin-repository/</link>
		<comments>http://blog.jetztgrad.net/2009/09/started-new-offline-grails-plugin-repository/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 02:04:49 +0000</pubDate>
		<dc:creator>jetztgradnet</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://blog.jetztgrad.net/?p=13</guid>
		<description><![CDATA[Plugrepo is an offline Grails (and maybe Griffon) plugin repository. It can be used as an offline proxy for the grails.org repository as well as a repository for internal plugins, which are not ment to be published.
The application is work in progress, see project page at http://github.com/jetztgradnet/plugrepo/

]]></description>
			<content:encoded><![CDATA[<p>Plugrepo is an offline Grails (and maybe Griffon) plugin repository. It can be used as an offline proxy for the grails.org repository as well as a repository for internal plugins, which are not ment to be published.</p>
<p>The application is work in progress, see project page at <a title="GitHub" href="http://github.com/jetztgradnet/plugrepo/">http://github.com/jetztgradnet/plugrepo/</a></p>
<p><a title="GitHub" href="http://github.com/jetztgradnet/plugrepo/"></a><img class="alignnone size-medium wp-image-11" title="PlugRepo main screen" src="http://blog.jetztgrad.net/wp-content/uploads/2009/07/screenshot-main-300x256.png" alt="PlugRepo main screen" width="300" height="256" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jetztgrad.net/2009/09/started-new-offline-grails-plugin-repository/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Reactivated blog</title>
		<link>http://blog.jetztgrad.net/2009/09/reactivated-blog/</link>
		<comments>http://blog.jetztgrad.net/2009/09/reactivated-blog/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 01:56:45 +0000</pubDate>
		<dc:creator>jetztgradnet</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://blog.jetztgrad.net/?p=18</guid>
		<description><![CDATA[After leaving my blog dormant for some time, I will reactivate it now. A fresh look is provided by Wordpress, which replaces the old blog hosted by Blogger.
Stay tuned for some more news.
Happy reading. 
]]></description>
			<content:encoded><![CDATA[<p>After leaving my blog dormant for some time, I will reactivate it now. A fresh look is provided by Wordpress, which replaces the old blog hosted by Blogger.</p>
<p>Stay tuned for some more news.</p>
<p>Happy reading. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jetztgrad.net/2009/09/reactivated-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello, world!</title>
		<link>http://blog.jetztgrad.net/2008/02/hello-world/</link>
		<comments>http://blog.jetztgrad.net/2008/02/hello-world/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 12:40:00 +0000</pubDate>
		<dc:creator>jetztgradnet</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://blog.jetztgrad.net/?p=3</guid>
		<description><![CDATA[Trying to build the perfect web application involves a lot of effort. Technical aspects as well as design have to be considered.
This blog is basically meant to track my work in progress and helps me to collects links, thoughts and findings regarding web applications, including application frameworks, infrastructure, and network related information. Maybe it even [...]]]></description>
			<content:encoded><![CDATA[<p>Trying to build the perfect web application involves a lot of effort. Technical aspects as well as design have to be considered.</p>
<p>This blog is basically meant to track my work in progress and helps me to collects links, thoughts and findings regarding web applications, including application frameworks, infrastructure, and network related information. Maybe it even proves to be useful to other people as well.</p>
<p>So, to myself, happy blogging <img src='http://blog.jetztgrad.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jetztgrad.net/2008/02/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
