tag:blogger.com,1999:blog-80275224136924982262024-03-05T20:10:53.981+00:00Coding softwareA blog for me to muse on developing software.Alasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-8027522413692498226.post-43848089284279929342011-09-29T10:42:00.000+01:002013-07-31T13:49:23.249+01:00Is the Ω problem really a problemAt the OSGi Community event last week (and on a blog post[1]) Alex Blewitt outlines "the Ω problem". The basic thesis of this problem is that Enterprise OSGi adoption is being hindered because all the relevant projects have unintelligible names based on "<i>greek letters and astrological</i>". He quotes Apache Aries, Eclipse Libra, and Apache [Felix] Gogo as examples. As a committer on Apache Aries and as someone involved in Enterprise OSGi I take some small exception to being singled out like this.<br />
<br />
<b>What's in a name? That which we call a rose</b><br />
<b>By any other name would smell as sweet.</b><br />
<b><br /></b>
I spend far too much of my life arguing over names. The trouble with names is the barrier of entry to the debate is so low everyone can engage and voice an opinion. So are names important? The answer is I think yes and no. In a (slightly tetchy) twitter exchange (which was all my fault) I asked Alex how he would like to fix the problem, how to apply the fix to the Apache Aries JNDI module. His suggestion was:<br />
<br />
<ul>
<li>Apache Naming for OSGi</li>
<li>Apache JNDI for OSGi [2]</li>
</ul>
<br />
There are a few potential issues with this proposal. These complicate the matter rather than prevent the names being used, but they need to be considered:<br />
<br />
<ol>
<li>OSGi is a registered trademark of the OSGi Alliance. While it is valid to use OSGi in product or project names in some cases you need a lawyer to know what they are. As a result putting OSGi in a name is somewhat tricky. (I hate to bring lawyers into this, but it is worth mentioning)</li>
<li>The Apache Aries JNDI module does not provide a Naming Service which could be implied by the former name. I've had many conversations with people who assume Apache Aries JNDI provides a name service. When I point out that the response is typically "oh yes, that makes sense".</li>
<li>It doesn't really fit with the Apache way of doing things. The ASF is a federation of projects this means that you can have multiple projects doing the exact same thing. While this might sound odd there are several potentially competing projects; Apache CXF and Apache Axis2 for example are both Web services stacks. This means it is completely valid to have multiple implementations of the OSGi JNDI specification. This might seem odd, but it is possible that the Apache Felix project and Apache Aries might both choose to implement the same specification. This then becomes a problem using names like those suggested because there are two things in Apache that should have the same name. I can't speak for Eclipse, but it could easily be the same thing there.</li>
</ol>
All this really highlights is the problems associated with naming. The most likely best improvement based on Alex's suggestion is "Apache Aries JNDI for OSGi" which isn't a huge improvement. This leads me onto a second observation.<br />
<br />
In Alex's blog he identifies Spring Data, Spring Web services, Apache Commons Lang as good names, and Apache Aries as bad, but this isn't comparing like with like. If we deconstruct the good names they follow this pattern:<br />
<br />
<brand> <function><br />
<br />
The "brand" in the names is "Spring" and "Apache Commons"; the function is "Data", "Web services", "Lang". If we look at two items from the bad list (and I'm choosing the two I have some familiarity with) the quoted names are the brand and do not denote the function. The two I'll quote from are Apache Aries and Eclipse Gemini. Both these projects have the following:<br />
<br />
<ul>
<li>Apache Aries Blueprint</li>
<li>Apache Aries JNDI</li>
<li>Eclipse Gemini Blueprint</li>
<li>Eclipse Gemini Naming</li>
</ul>
The project or brand is Apache Aries, the function is Blueprint and JNDI.<br />
<br />
So back to the original title of my blog post. "Is the Ω problem really a problem". For me the answer is no. Naming is hard, and I am sure we haven't got it right, but the names of things aren't the problem. I think there are some real problems here that need to be addressed, but we need to focus on those rather than deciding that naming a project Apache Aries, or Eclipse Gemini is weird (or by implication of not being good, bad).<br />
<br />
Before I sign off I think some of the problems we have to address for adoption of Enterprise OSGi:<br />
<br />
<ul>
<li>Explain to people the benefits</li>
<li>Better integration into more Application Servers.<br />In fact since WebSphere Application Server, Apache Geronimo, Glassfish and JBoss OSGi are all doing this perhaps it is making people aware of what is out there.</li>
<li>Better support for the a la carte model familiar to many experience OSGi people.<br />I think there is a debate to be had around this. In the enterprise world a la carte is more complex than in previous OSGi arenas. You can certainly have an a la carte model for an application that uses Servlets, JPA, transactions and Blueprint (we have a sample in apache aries that builds its own runtime like this) in reality once you have done this you have pretty much built your own application server at which point you should be looking to reuse what others have done.</li>
</ul>
Alasdair<br />
<br />
[1]<a href="http://alblue.bandlem.com/2011/09/omega-problem.html">http://alblue.bandlem.com/2011/09/omega-problem.html</a><br />
[2]<a href="https://twitter.com/#!/alblue/status/118763089289158656">https://twitter.com/#!/alblue/status/118763089289158656</a><br />
<br />
P.S. I'm too anal not to point out the following minor errors in the list of names in Alex's blog:<br />
<br />
<ul>
<li>Apache RegExp is really called Apache Jakarta RegExp (this is retired and in the Apache Attic)</li>
<li>Apache Gogo is really Apache Felix Gogo</li>
<li>Apache Sigil is really Apache Felix Sigil</li>
</ul>Alasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.com4tag:blogger.com,1999:blog-8027522413692498226.post-33260992802737892922011-08-25T21:56:00.001+01:002011-09-04T23:26:01.054+01:00Blueprint 101 - destructionI have recently come across a couple of cases where a blueprint bean destroy method takes a long time to run. This has resulted in undesired behaviour. In both cases the destroy method took over 5 minutes to run and then failed with a runtime exception.<br />
<br />
So what was going on? In this case the destroy method ended up invoking a service that had been injected from a <reference> element. Lets look at a quick example. </reference><br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0ZKPStw1vc0YTeDZjBwhMhddLdCDlenSgTgxwB1UNVgs9vpNYWhFnOxypZbo8l5ofwpHIV9ohNfBpFYV4vUB5Z_Qir6s6Joj14mfCUoEVm1q5D6lq-EtX__i4pWRwjsNaT270N6Rtmiw/s1600/bp-2-bundle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="84" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0ZKPStw1vc0YTeDZjBwhMhddLdCDlenSgTgxwB1UNVgs9vpNYWhFnOxypZbo8l5ofwpHIV9ohNfBpFYV4vUB5Z_Qir6s6Joj14mfCUoEVm1q5D6lq-EtX__i4pWRwjsNaT270N6Rtmiw/s320/bp-2-bundle.png" width="320" /></a></div><br />
In this diagram bean A in the left hand bundle uses bean B in the right hand bundle via a service relationship. Bean A's destroy method calls out to bean B. In blueprint service references are damped, this means that if the target service has gone it blocks the call for a timeout period (the default is 5 minutes) until a replacement can be found. If no replacement is found an unchecked exception is thrown.<br />
<br />
The most common reason for the destroy method of bean A being invoked is that the left hand bundle has been stopped. If only the left hand bundle is stopped then this will work just fine, but both are stopped then the right hand bundle must be stopped before the left hand bundle. The problem is there is no way to enforce this shutdown order.<br />
<br />
So having outlined the problem the question that will come up is "how to solve it?". The answer is to not call a service in a destroy method. This is quite simple, but doesn't help if you really need to call that service. Instead of placing this call in the destroy method though you can make use of another feature in blueprint called a reference listener. A reference listener gets called when a matching service is initially bound to a reference, or when a service is unbound (if a service is replaced the unbind method is not called, but the bind method will be called to indicate the service has been replaced). Moving the tidy up out of the destroy method and into a reference listener will ensure the call can succeed. The reference listener is called irrespective of the order of the left and right hand bundles being shutdown.<br />
<br />
Using a reference listener is slightly more complicated, it involves a little more XML. Instead of defining:<br />
<div class="Apple-style-span" style="background-color: #cccccc; font-family: 'Courier New', Courier, monospace; margin: 10px; padding: 10px;"><bean class="my.example.BeanA" destroy-method="destroy"><br />
<property name="service" ref="serviceRef"/><br />
</bean><br />
<reference id="serviceRef"<br />
interface="my.example.BeanBInterface"/></div><br />
you define the following:<br />
<br />
<div class="Apple-style-span" style="background-color: #cccccc; font-family: 'Courier New', Courier, monospace; margin: 10px; padding: 10px;"><bean id="beanA" class="my.example.BeanA"><br />
<property name="service" ref="serviceRef"/><br />
<bean><br />
<reference id="serviceRef"<br />
interface="my.example.BeanBInterface"><br />
<reference-listener ref="beanA"<br />
unbind-method="unbindBeanB"/><br />
</reference></div><br />
The signature of the unbind method should be <i>public void unbindBeanB(my.example.BeanBInterface)</i>, it could also take a <i>ServiceReference</i>. Normally blueprint does not allow beans to have cycles, that is bean A depends on bean B which depends on Bean C, as is clearly shown in this case. However the blueprint specifically specifically requires blueprint container implementations to support this kind of cycle.<br />
<br />
Making this change removes the ordering constraint between the two bundles and produces a more resilient system.<br />
<br />
Alasdair<br />
<br />
<b>Updated</b> 4th September 2011: Updated to correctly describe the behaviour of a reference listener when a service is switched.Alasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.com0tag:blogger.com,1999:blog-8027522413692498226.post-88902978532713761172011-08-08T22:22:00.000+01:002011-08-08T22:22:10.953+01:00Blueprint 101 - Brief introduction to BlueprintI haven't said much in a long time, and once again I'm back promising to do better, and probably failing. However I am back and the main reason I'm back is I have been having a lot of questions recently about blueprint, and some problems people are hitting. Since my responses have mostly been in the privacy of my email program I though I should start sharing. Hence the Blueprint 101 title of this blog post. Rather than go over the basics below is a quick video I was "forced" into doing for the Enterprise OSGi channel on YouTube. I suggest you jump to 12 seconds in after I've gone from the screen and the slides appear.<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="349" src="http://www.youtube.com/embed/ZWRASZEwNS8" width="560"></iframe>Alasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.com0tag:blogger.com,1999:blog-8027522413692498226.post-77058938107605450202011-03-15T11:39:00.000+00:002011-03-15T11:39:12.230+00:00Bio from a colleagueI hate writing bios. I pretty much avoid doing it at all costs. So one of my colleagues decided to help out by providing me out for the <a href="http://www.websphereusergroup.org.uk/wug/meeting/31/">UK WebSphere User Group</a> meeting for March.<br />
<br />
<i>Alasdair was sent to us from the future to encourage OSGi adoption & prevent the threat we know as Maven, that in 2025 would become SkyNet, a build system of such complexity that it became self aware, and realised that the main cause of build breaks were us, humans. In the last few years however, he has replaced his primary directive with one to bake cookies for mankind, in the hope that by supplying cookies, the threat can be averted without requiring the termination of Mankind. Alasdair holds many qualifications, including a Ma(Baker) in cookie making, and a 100m swimming certificate from junior school.</i><br />
<br />
Somehow I think I'll pass.Alasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.com1tag:blogger.com,1999:blog-8027522413692498226.post-24258163071728975152011-01-19T23:33:00.004+00:002011-01-19T23:51:11.433+00:00Creating a Web Application Bundle Using MavenBefore explaining how to create a Web Application Bundle (WAB) it is worth reviewing what a WAB is. A WAB is basically a bundle that is structured like a WAR, but with OSGi classloading rules. It is a valid bundle, and also looks like a valid WAR (although it doesn't necessarily end in the .war extension, usually .jar is good enough).<br />
<br />
A typical WAB might look like this:<br />
<div class="Apple-style-span" style="background-color: #cccccc; font-family: 'Courier New', Courier, monospace; margin: 10px; padding: 10px;">META-INF/MANIFEST - containing all the normal OSGi info<br />
WEB-INF/web.xml - the normal web deployment descriptor<br />
WEB-INF/classes - class files and resources visible via the classloader<br />
WEB-INF/lib/a.jar - a jar file<br />
index.html<br />
index.jsp<br />
images/icon.png<br />
style/style.css</div><br />
The important thing about this is <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">META-INF</span>, <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">WEB-INF</span> (and <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">OSGI-INF</span>) are special in that content is not served up. As a result you want program metadata and classfiles to be in here, since they don't make up part of the web content. The web content goes into the root of the bundle.<br />
<br />
Prior to the latest release of the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">maven-bundle-plugin</span> you could either use the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">maven-war-plugin</span> to generate a war with a manually created manifest, or you could create a <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">maven-bundle-plugin</span> at which point you would not end up with a valid WAB. You would get the classes, resources and static content mixed together in the root of the bundle. This did not produce good WABs.<br />
<br />
With version <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">2.2.0</span> of the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">maven-bundle-plugin</span> which was released this week by the <a href="http://felix.apache.org/">Apache Felix project</a> we have a new option. We can tell the plugin we want to create a WAB.<br />
<br />
It is important to understand how the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">maven-bundle-plugin</span> builds WABs to get this working. The <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">maven-bundle-plugin</span> under the covers makes use of the <a href="http://www.aqute.biz/Code/Bnd">bnd tool</a>. To get it to build you tell it you want to create a WAB and it relocates everything on the classpath so it is in <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">WEB-INF/classes</span>.<br />
<br />
If you take the approach we did in the <a href="http://aries.apache.org/">Apache Aries project</a> for the 0.1 and 0.2 releases your project might be structured with java source in <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">src/main/java</span> and static content in <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">src/main/resources</span>. The upshot of this is if you just specify the following in the configuration for the maven-bundle-plugin:<br />
<br />
<div class="Apple-style-span" style="background-color: #cccccc; font-family: 'Courier New', Courier, monospace; margin: 10px; padding: 10px;"><_wab/></div><br />
All the static content moves into <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">WEB-INF</span>, this is obviously a bad thing because it is no longer served by the web container.<br />
<br />
So what we did for the 0.3 release was we moved the static content from <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">src/main/resources</span> and into the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">src/main/webapp</span> directory. Then we added the following:<br />
<div class="Apple-style-span" style="background-color: #cccccc; font-family: 'Courier New', Courier, monospace; margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; padding: 10px;"><_wab>src/main/webapp/</_wab></div>This means everything in <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">src/main/java</span> is compiled and put in <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">WEB-INF/classes</span>. Everything in <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">src/main/resources</span> is put in <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">WEB-INF/classes</span>. This is pretty much what you would expect because these locations are used to put files that are loadable via the classloader. The content in <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">src/main/webapp</span> is then placed in the root. In fact in this scenario you put the web.xml in the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">src/main/webapp/WEB-INF</span> directory, and if your WAB contains blueprint your blueprint would go in <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">src/main/webapp/OSGI-INF/blueprint</span>.<br />
<br />
AlasdairAlasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.com4tag:blogger.com,1999:blog-8027522413692498226.post-29967683244313136812010-09-30T11:00:00.000+01:002010-09-30T11:00:34.150+01:00Creating Enterprise OSGi apps for Apache AriesI was recently at JavaZone in Norway and JavaOne in San Francisco presenting on OSGi and Apache Aries. I gave a demo of how to create an enterprise OSGi application. The application I demoed the creation of was the blog sample from Apache Aries. That sample is built and created using maven, so I moved it into eclipse.<br />
<br />
In the next few blog posts I will describe the steps involved in creating this sample using the tools and running them in eclipse.<br />
<br />
AlasdairAlasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.com1tag:blogger.com,1999:blog-8027522413692498226.post-49986110678062969042010-09-17T06:58:00.002+01:002010-09-17T07:10:23.252+01:00Developing OSGi Applications with Apache AriesYesterday I blogged on how to get the free OSGi Applications tools from IBM Rational working on Eclipse 3.6 Classic. Having got the tools created the next step is to define a target platform. A target platform is the set of bundles you want to build and run your application with. Since Eclipse is a big OSGi application it already comes with a built in target platform for developing eclipse plugins. Since we are trying to create an enterprise OSGi application this isn't any good. We need a new one, but the tools don't come with one for free. In this post I will go through the steps involved in setting up a target platform for developing OSGi applications.<br />
<br />
Before going on you'll need maven. You may have it already, but if not you can get it from the Apache Maven <a href="http://maven.apache.org/download.html">download page</a>.<br />
<ol><li>The first step is to get a "runtime" from somewhere. The quickest way to get something quickly and easily is to build the Apache Aries Blog sample assembly. This can be downloaded from <a href="https://svn.apache.org/repos/asf/incubator/aries/trunk/samples/blog/blog-assembly/pom.xml">subversion here</a>. Download it into an empty directory.</li>
<li>In the empty directory run <code>mvn</code>. This will download all the bundles required to run the Apache Aries Blog sample. The bundles will be in the target subdirectory.</li>
<li>In eclipse you need to open the preferences pane and navigate to Plug-in Development > Target Platform. Click the Add button. </li>
<li>This opens a wizard with 4 radio buttons. You want to start with the first option titled <code>Nothing</code>.<br />
<br />
<div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9odIpTLpae3bezgoiw3GPNDVXOKx27bia7wvO4QmvfY6_Ut-6ALIKBBTPU74X6WAzDpxw20_WGTkpa36qe5iNpYUuCJSAFuJzOE5PkcDOojEy5cAJ4ST_Qkg-jhJcsKEqDRtUtpt3-7s/s1600/wizard.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9odIpTLpae3bezgoiw3GPNDVXOKx27bia7wvO4QmvfY6_Ut-6ALIKBBTPU74X6WAzDpxw20_WGTkpa36qe5iNpYUuCJSAFuJzOE5PkcDOojEy5cAJ4ST_Qkg-jhJcsKEqDRtUtpt3-7s/s320/wizard.png" /></a></div></li>
<li>The next page is the target platform configuration panels. The first step is to choose a name. I have gone with Apache Aries.<br />
<br />
<div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqFIpNFBsDBBfMW3XskAwgPv6Ty76912DTHO3Qh9a3PoKlPu-SjlOhS3CJwVguKjtsvp5lBYbvEQLqo-vgUtq4Bz1wZmfo3hNVeTdyfC_cIFiWnZTPmxGc8pycIV_nGs5_ZlNJ4yM5IkM/s1600/choosename.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqFIpNFBsDBBfMW3XskAwgPv6Ty76912DTHO3Qh9a3PoKlPu-SjlOhS3CJwVguKjtsvp5lBYbvEQLqo-vgUtq4Bz1wZmfo3hNVeTdyfC_cIFiWnZTPmxGc8pycIV_nGs5_ZlNJ4yM5IkM/s320/choosename.png" /></a></div></li>
<li>Right now the target platform has no bundles, so we need to add the directory of bundles we got from step 2. Click the Add button. A wizard will appear with 4 options, select the <code>Directory</code> option and click next. Then browse to the target directory generated in step 2.<br />
</li>
<li>We now have bundles we can build against, but this isn't going to help run any tests. Some of the Apache Aries bundles depend on javax.transaction. The problem is javax.transaction exists in the JVM, but only contains a few exceptions from the package which causes bundles wanting to use javax.transaction problems. to fix that we need to configure the target platform. This is fixed by going to the Arguments tab and adding the following as a vm argument:<br />
<br />
<code>-Dorg.osgi.framework.system.packages.extra= javax.transaction;version=1.1.0, javax.transaction.xa;version=1.1.0 -Xbootclasspath/p: ${target_home}/geronimo-jta_1.1_spec-1.1.1.jar<br />
</code><br />
This does two things. The first is it tells the OSGi framework to export the JTA packages at version 1.1, which is the version expected by Apache Aries, and the second thing it does is add the extra classes onto the JVM boot classpath. <br />
<b>Note:</b> I added some spaces into the example to ensure it wraps on the blog. The only space that should exist when copied into the dialog is the one before <code>-Xbootclasspath.</code><br />
<br />
<div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhf6W22EAxHsyTtBfZrhE8uK0EHxs558xQ3a1-5c9i3xfNBILFwBA2gqHgI3DUT7WbxIrD-z-IVvRMKMioM2Jy_QFUU4PjV8Y25k5GHSBXvrO2NGAPwtDnuMPzXlqWTFCjMcr2r0x-u03s/s1600/environment.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhf6W22EAxHsyTtBfZrhE8uK0EHxs558xQ3a1-5c9i3xfNBILFwBA2gqHgI3DUT7WbxIrD-z-IVvRMKMioM2Jy_QFUU4PjV8Y25k5GHSBXvrO2NGAPwtDnuMPzXlqWTFCjMcr2r0x-u03s/s320/environment.png" /></a></div></li>
<li>Now you are done and can click the Finish button. The last thing to do is to make the new Target Platform the active platform. You can do this by checking the checkbox next to the platform you just created.<br />
<br />
<div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZNcOWdz8_55MNo-MthZeY3aoB15K9btM95xvCl6kO-088pK-PlskREyyupr3OM7Aw-gUiFJTPODqrjZvpnAGUCHK3I0zPAac6PN4Kcc0dg4JipthVXGR1eto1G1QPI5b7JSFUyww2Hyc/s1600/activate.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZNcOWdz8_55MNo-MthZeY3aoB15K9btM95xvCl6kO-088pK-PlskREyyupr3OM7Aw-gUiFJTPODqrjZvpnAGUCHK3I0zPAac6PN4Kcc0dg4JipthVXGR1eto1G1QPI5b7JSFUyww2Hyc/s320/activate.png" /></a></div><b>Note: </b>If you add or remove a bundle from the platform directory you will want to come back and hit the reload button to get Eclipse to notice.</li>
</ol>Now you are ready to start developing your bundles, and when you want to test your application you can use the OSGi Framework Run configuration in eclipse. If you want to add more bundles to the runtime just drop them into the directory from step 2 and then reload the platform.<br />
<br />
I'll blog another time about using the tooling to create a simple application.<br />
AlasdairAlasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.com8tag:blogger.com,1999:blog-8027522413692498226.post-74012074035540511552010-09-15T20:03:00.002+01:002010-10-29T20:40:07.528+01:00Using the OSGi Applications Development Tools in Eclipse 3.6 ClassicI have been using Eclipse since version 1 days so I always download the classic install. I understand what is included in the box and it works for me. I then use things like the Helios software site, or eclipse marketplace to get the other stuff I need.<br />
<br />
So recently I decided to download the IBM Rational tools for OSGi Application Development from eclipse marketplace. I am a committer on Apache Aries and am involved in integrating this into WebSphere Application Server.<br />
<br />
These tools assist the creation of enterprise OSGi applications and as such are based on the Web Tools Platform (WTP). I'm not sure exactly why, but I found working out which WTP packages from Helios I needed was a little hit and miss, so I thought I would record which packages I grabbed.<br />
<br />
So I started from the Eclipse Classic 3.6 download and used the helios software site to grab the following packages:<br />
<br />
<ul><li>General Purpose Tools/Marketplace Client</li>
<li>Web XML and Java EE Development/Dali Java Persistence Tools</li>
<li>Web XML and Java EE Development/Eclipse Faceted Project Framework</li>
<li>Web XML and Java EE Development/Eclipse Faceted Project Framework JDT Enablement</li>
<li>Web XML and Java EE Development/Eclipse Java EE Developer Tools</li>
<li>Web XML and Java EE Development/Eclipse Web Developer Tools</li>
<li>Web XML and Java EE Development/Eclipse XML Editors and Tools</li>
<li>Web XML and Java EE Development/Eclipse XSL Development Tools</li>
<li>Web XML and Java EE Development/JavaScript Development Tools</li>
<li>Web XML and Java EE Development/JavaServer Faces Tools (JSF) Project</li>
<li>Web XML and Java EE Development/JST Web UI</li>
<li>Web XML and Java EE Development/Rich Ajax Platform (RAP) Tooling</li>
</ul>After downloading and saving you can then use the Eclipse Marketplace to find the OSGi Application Development Tools. After searching for OSGi for me it was the top item.<br />
<br />
<b>Update:</b> You can also just grab the eclipse distribution for Java EE development which means you don't need to do all this.<br />
<br />
Good luck<br />
AlasdairAlasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.com7tag:blogger.com,1999:blog-8027522413692498226.post-9223418069056880992010-06-01T23:35:00.001+01:002010-06-15T21:16:49.130+01:00Macs and SpywareWhen I got home this evening I decided to catch up on the latest Apple news and I found out about this security "bulletin" from a company called Intego. They provide security software for Mac OSX. At first I was thinking of complaining about their original blog post which is written to maximise fear. The announcement is <a href="http://blog.intego.com/2010/06/01/intego-security-alert-osxopinionspy-spyware-installed-by-freely-distributed-mac-applications/">here</a>. They say the risk is High, they describe several really scary effects and they say it is attached to software available from reputable download site such as MacUpdate. They gave no indication of what applications they found it attached to, but they have since fixed that <a href="http://blog.intego.com/2010/06/01/preliminary-list-of-applications-that-install-osxopinionspy-spyware/">here</a>. Based on this I would say the "risk" is low because the app/screensaver seem quite specialist.<br />
<br />
So what am I pissed enough to blog about. The discussion on <a href="http://www.macrumors.com/2010/06/01/antivirus-firm-warns-of-new-mac-os-x-spyware-application/">macrumors</a>. This is why I don't read discussions on sites like this. They just make my blood boil. I'll admit to being a bit of an Apple fanboi (I have an iPhone, 2 macs and an iPad), but the superior condescending crap that gets pushed out is terrible. There is a lot in the thread I'm going to ignore, but I feel like commenting on some posts. Most of these things I'm going to highlight are expressed by multiple people, but I just chose one at random to highlight.<br />
<ol><li><a href="http://forums.macrumors.com/showpost.php?p=10015497&postcount=113">It isn't Apple's fault the user is stupid</a>.<br />
So I'm not going to claim it is Apple's fault, but to claim that this kind of problem is the users fault and that you can't do anything to cope with a "stupid" user is both wrong and insulting to most computer users. It isn't that they are stupid, but that they have a specific goal in mind. Also as is observed in a few other posts there is no evidence that the user is told the spyware is being installed, certainly on windows you usually don't know, it just gets put on there by the installer of the app you want to use. At the end of the day Operating Systems need to take some effort to ensure the user does not hang themselves, just throwing your hands up and saying "the user is too dumb" leads to badly designed and insecure systems. In essence yes people are stupid, but you need to take that into account and minimise the amount of rope you give them.</li>
<li><a href="http://forums.macrumors.com/showpost.php?p=10015855&postcount=174">Don't ever install free software</a>.<br />
Well this is almost too dumb a question to respond to. I agree you need to be careful with what you install, but you can get this kind of crap from paid for software, and ignoring free means you'll miss out on great applications like eclipse, emacs, apache https server, MSN Messanger, Google Chrome, Firefox. I could go on and on and on, but we need a sense of perspective. It isn't free software that is the issue, but software whose supporting business model relies on duplicity. If it is free you should always ask how and research it. </li>
<li><a href="http://forums.macrumors.com/showpost.php?p=10015522&postcount=119">Who knows what an installer does</a>? <br />
This was a rare ray of light he is spot on. When you install (on windows or Mac) and application that asks for root access once you've given it root access you don't know what it is doing. This comes down to trust. You give an app installer root access you are trusting them and they can break the trust. These apps are not ones I would trust, but how do you tell? In my view the best way to solve this is if all mac apps were installed as app bundles. Then you can choose to install them by putting them in Applications (which will mean giving Finder admin access).</li>
</ol>So Rant over for now, at least until the next time I read the comments on a "news" website like this.<br />
<div><br />
</div><div>Alasdair</div>Alasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.com0tag:blogger.com,1999:blog-8027522413692498226.post-64801466457939568892010-02-24T19:49:00.000+00:002010-02-24T19:49:19.879+00:00OSGi DevConYesterday I and many members of my team took a trip up to Hammersmith to attend OSGi DevCon. Attached to the <a href="http://jaxlondon.com/">JAX London</a> conference it is a day of talks and tutorials on the dynamic module system that is OSGi. This was the first time OSGi DevCon had been run in the UK so it was a great opportunity to head down and see what was being said. In addition <a href="http://ianrobinson.blogspot.com/">Ian Robinson</a> was going to spend 30 minutes talking about <a href="http://incubator.apache.org/aries/">Apache Aries</a>, an Apache incubator I am a committer on.<br />
<br />
Looking back on the agenda I realise I did not actually attend that many of the OSGi talks. I bumped into some people I know from the <a href="http://uk.osgiusers.org/">OSGi UK User Forum</a> and took the time to find out what they are doing.<br />
<br />
I missed the keynote, which I hear was very good by Ted Neward. I had aimed to arrive for the first OSGi talk at 10:30 and arrived in time. Shaun Smith from Oracle gave an overview of the soon to be released OSGi JPA2 spec which I had been keeping an eye on, so I didn't learn anything new, but it was well presented with some slick slides.<br />
<br />
I then went to Mike Keith's (also of Oracle) talk titled "OSGi and Java EE: Friends or Foes?" which I think was slightly misnamed. It was more of an OSGi for Java EE developers talk. It had a good introduction to OSGi and talked about how the OSGi Enterprise Expert Group are working on bringing Java EE standards to OSGi so they work nicely in an OSGi environment. Despite knowing what he presented it was done with a flare of humour that made it really enjoyable.<br />
<br />
After lunch I sat in on a talk about the Eclipse API tooling. These are some extensions for the PDE tooling to detect when an incompatible change to the API are made. It all looks very interesting and I am hoping to take a look at the tools ant integration, but because it was built to support the Eclipse API and as a result is built around the Require-Bundle capability of OSGi, not Import/Export-Package capability. As a result the tooling is of limited (if any) value to an OSGi developer. This is a shame, but I am assured that they are working on the problem. They are also working on bringing this to normal Java projects in eclipse, but in my view they would be better off supporting Import/Export-Package first. Of course I was invited to contribute to the tooling, but that would be problematic.<br />
<br />
While I was in a few sessions in the afternoon the subject material wasn't particularly interesting to me. It wasn't until the Tools panel that I got interested again. Improving the tools for OSGi development seems to be one of Peter Kriens pet projects. I happen to use both PDE + ant and maven + bnd in different environments and from my perspective the PDE + ant combination beats the maven + bnd combination hands down, but I appear to be in the minority (I am told that once I have been using maven for eight years I will love it as much as I love ant). I was a bit disappointed by the tooling panel. I was hoping for a little more discussion and idea sharing, but there was not much of that. Perhaps the most interesting part was when a member of the audience asked for some standard headers to encode information on where the source code repository is located, and where to raise issues when bugs are found. Since I am primarily a closed source developer it is not something I care too much about, although I do understand the problem. Peter Kriens' view is that the source should be in the OSGi bundle and that jar file size is no longer an issue. I disagree with this view very strongly. First off when you consider an application the size of eclipse adding the source into every bundle will increase the download size of eclipse significantly. While for an individual bundle it might not be an issue, for a whole application it gets to be significant. The second problem is one of contamination. Not all Open Source licenses are compatible and some can cause significant contamination issues, viewing or understanding the source could prevent or cause issues if you work on other projects. As a result I think having a URL in the bundle metadata is absolutely the right solution, once it is there any debug tools can use it for debug, but you can have a policy in the tools to prevent it.<br />
<br />
The final two sessions were on what is coming in the OSGi Alliances enterprise spec and about Apache Aries and Eclipse Gemini. It is difficult for me to be objective on these talks because I've been so heavily involved in defining the enterprise spec, and am an Apache Aries committer.<br />
<br />
In the end I had a very enjoyable day which was only let down by the late finish (I got home after 1am). Not all the talks were interesting, but they never are and being attached to JAX London meant that if a particular session didn't interest you there were others sessions you could attend.Alasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.com2tag:blogger.com,1999:blog-8027522413692498226.post-89681575948293445932009-08-31T17:00:00.000+01:002009-08-31T17:00:00.193+01:00APIs and versioningCreating good, reusable APIs is hard, really hard, you just won't believe how vastly hugely mindbogglingly hard it is. You just need to look at the Java API to realize this. The Java API is probably the main reason that Java has taken off and been the success that it is. It contains a wealth of utilities that ease and speed up development.<br /><br />While there are a huge number of wonderful things about the Java API it has some examples of truly terrible API design. You can probably find that somewhere it breaks every rule in the "Effective Java" book (for sale on <a href="http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=dp_ob_title_bk/177-0560224-4457451">amazon.com</a> and <a href="http://www.amazon.co.uk/Effective-Java-Second-Joshua-Bloch/dp/0321356683/ref=pd_cp_b_0/278-6462570-8373602">amazon.co.uk</a>, and cheaper in the UK than the US for a change).<br /><br />One example is the java.util.Properties. A properties object is supposed to be a set of keys and values (like a map) where the key and value are both strings. The problem is it extends Hashtable which means you can pass it to anything that takes a Dictionary, or Hashtable. While this may seem useful it means that you can use non-string values. This can cause problems if the getProperty method is later used.<br /><br />This kind of problem is inevitable because API design is so hard. So what can we do to "fix" things in the future? There are (at least) two ways to cope:<br /><ol><li>Maintain the API forever. This is probably the most common solution. Java is full of old, deprecated, or discouraged APIs. Hashtable, Dictionary and Vector have been replaced with Map, HashMap, List and ArrayList, most of the Date class has been deprecated.<br /><br />The problem with this approach is that people often still use these older APIs, even though there are better alternatives.<br /></li><li>Version the API. A non software example of what I am thinking of the PS2 contained the old PS chip as an I/O controller and the PS games were run on that.<br /><br />Java does not support versioning itself, but can be supported by making use of <a href="http://www.osgi.org">OSGi</a>. OSGi is a modularity system that is built on top of Java. OSGi is split into a core and a set of optional services. The core is implemented by <a href="http://www.eclipse.org/equinox/">Eclipse Equinox</a>, <a href="http://felix.apache.org">Apache Felix</a> among others. Running an application inside of OSGi allows you to provide two different, and incompatible versions of the API in the same JVM and allow the user to select the version they work with.<br /></li></ol>I plan on blogging some more about OSGi in the future. WAS has been built on top of OSGi since version 6.1, and I was part of the team that made this happen. While I thought that I would be done when we shipped 6.1 as an expert in the Hursley development lab I keep being dragged back, so I thought I would start blogging about my thoughts on the subject.<br /><br />AlasdairAlasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.com0tag:blogger.com,1999:blog-8027522413692498226.post-60940292425257124992009-08-30T00:03:00.002+01:002009-08-30T00:14:12.992+01:00New WebSphere Messaging Redbook<div style="padding-left: 20px;">On Monday this week I got a call from goods inwards at work to tell me I had a package for me from Poughkeepsie. This was a surprise, I wasn't expecting anything, and although I do know people who work in Poughkeepsie if they were going to send me something they would have mentioned it. So down I trotted to pick up my package, and as it turned out seven other packages for people I work with.<br /><br />The package contains a copy of the new <a href="http://www.redbooks.ibm.com/Redbooks.nsf/RedbookAbstracts/sg247770.html?Open">WebSphere Application Server V7 Messaging Administration Guide</a>. Well I say new, it was published in July, but I didn't realize. The book was reviewed by several people who work on developing WebSphere Messaging, hence me walking back with seven copies of the book.<br /><br />The best thing about the Redbook is that although you can purchase it, you can also download it for free as a <a href="http://www.redbooks.ibm.com/redbooks/pdfs/sg247770.pdf">PDF</a>, or view it <a href="http://www.redbooks.ibm.com/redbooks/SG247770/wwhelp/wwhimpl/js/html/wwhelp.htm">online</a>.<br /><br />Another good resource for WebSphere Messaging users everywhere.<br />Alasdair</div><br />Originally posted to the <a href="http://webspheremessaging.blogspot.com/2009/08/new-websphere-messaging-redbook.html">WebSphere Messaging Blog</a>. I'm re-posting here because I contributed to this one by providing information for and reviewing the security chapter, so I want to shout about it. I have helped write two Redbooks, and have reviewed several others. I really enjoyed each and every opportunity. If you ever get a chance to go on a residency go, the six week residency I did five years ago was one of the best experiences of my professional life.<br /><br />AlasdairAlasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.com0tag:blogger.com,1999:blog-8027522413692498226.post-23762055447473387612009-08-29T21:55:00.004+01:002009-08-29T22:12:07.802+01:00Re-determinationIt has been almost a year since I last posted here. I intended to blog more often, but after WAS v7 was released I was asked to contribute to the <a href="http://webspheremessaging.blogspot.com/"><span class="blsp-spelling-error" id="SPELLING_ERROR_0">WebSphere</span> messaging blog</a>, and I ended up blogging there instead. Although I have written the most blog posts on the <span class="blsp-spelling-error" id="SPELLING_ERROR_1">WebSphere</span> messaging blog I wouldn't say my record there has been amazing either. The main problem I have is coming up with content.<br /><br />So where does that leave me, well my 4<span class="blsp-spelling-error" id="SPELLING_ERROR_2">th</span> blog post is a re-determination to start blogging here again. I'm going to aim for one post a month, but I am planning to expand the scope from just being about using and developing WAS to software and software in general. Not sure if I will change the name of the blog yet.<br /><br />Take care<br />AlasdairAlasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.com0tag:blogger.com,1999:blog-8027522413692498226.post-56161831525464297602008-09-26T21:14:00.005+01:002008-09-26T21:30:46.440+01:00WebSphere Application Server v7One of the things I always find odd when talking to customer is that I introdue myself with some varient of:<br /><p style="margin-left: 10px; margin-right: 10px;">Hello my name is Alasdair Nottingham and I am a developer for WebSphere Application Server, I am responsible for ...</p>The customer then can assume that either IBM is paying me for doing nothing but sit around twiddling my thumbs, and occasionally talking to customers, or that I am working on the next release of WebSphere Application Server. Of course I cannot comment, or talk about whether their will be a next version, or what will be in it. Everyone knows that there will be, so it is rather odd.<br /><br />Well finally I can start to talk about what I and several hundred people spread across three contents, five countries, and nine labs have been working on for the last two years. WebSphere Application Server v7 is here. Woo Hoo!<br /><br />You can get a trial version <a href="http://www.ibm.com/developerworks/downloads/ws/was/learn.html">here</a>, and Tom Alcott has a developer works article covering the <a href="http://www.ibm.com/developerworks/websphere/library/techarticles/0809_alcott/0809_alcott.html">major new features</a>. As usual my area of interest, messaging, is bairly touched on (we did a lot more than the four highlights in the article), but I am sure that the new <a href="http://webspheremessaging.blogspot.com/">WebSphere and Messaging blog</a>, and this one will rectify that.<br /><br />Oh, and as observed by <a href="http://david.currie.name/archives/2008/09/24/new-websphere-blogs">David Currie</a> people are being encouraged to blog about v7 and what has come, so expect a lot of posts on the <a href="http://webspherecommunity.blogspot.com/">WebSphere Community Blog</a> in the coming few months.<br /><br />AlasdairAlasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.com0tag:blogger.com,1999:blog-8027522413692498226.post-79512938727877245622008-09-22T23:17:00.002+01:002008-09-22T23:32:50.882+01:00WebSphere User Group UK meeting in EdinburghLast Wednesday I had the pleasure of speaking at the Edinburgh WebSphere User Group meeting. It was the first time I have been to Edinburgh in 10 years and a trip was long overdue (although I would have prefered to have more than a day there).<br /><br />It was the second time I have spoken at an event and I find it a little daunting. Mostly when I speak with customers it is one on one which makes it much easier to ensure that the customer gets what they need from the meeting. With a presentation to a room of 20 or more people it is much harder to know if the pitch was well received or not. In this case I think it was well received because I had two sessions and both were equally full of people.<br /><br />I was supposed to be co-presenting with Simon Kapadia who is the ISSW security lead in EMEA, but he was infected by a nasty virus days before the WUG, so I had to present his content which was a significant challenge, having only seen half slides four hours before having to present them.<br /><br />The big news of course was the v7 release of WebSphere Application Server which is due out this Friday (26th September). After two years it was great to be able to talk about it in the open. When talking to customers and saying you develop the app server, but essentially having to deny the existence of whatever the next version will be is very odd.<br /><br />AlasdairAlasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.com0tag:blogger.com,1999:blog-8027522413692498226.post-88447851416099849802008-09-08T21:02:00.002+01:002008-09-08T21:07:24.612+01:00The obligatory first boring intro postHi,<br /><br />Having looked back over my personal blog I notice that I only have 5 posts about what I consider "work", i.e. WebSphere Application Server, Java coding or IBM. That is out of a total of 72 posts over two years (my personal blog is 2 years old on Friday).<br /><br />I was originally planning on posting the WebSphere related posts to the WebSphere Community Blog, but unfortunately that has not been possible for over a year now.<br /><br />So I'm just going to run a trial. The trial will be to separate the "work" related posts, which are few and far between, from my personal posts where I rant about stuff. I hope that by doing this I will post more about WebSphere than I did when it was one post (I am aiming for a post a month).<br /><br />So lets see how it goes (massive immediate readership).<br />AlasdairAlasdair Nottinghamhttp://www.blogger.com/profile/06330919572281729613noreply@blogger.com1