Tuesday 19 October 2010

Accessing Picasa's atom feed API from Spring's REST and XPath templates

Been swearing at my screen and Google's choice of atom based API for their Picasa web albums. Flickr's REST API took 10 seconds to work out. Picasa: days...


My problem:

Trying to parse album ids from Picasa's API: code.google.com/apis/picasaweb/docs/2.0/developers_guide_protocol.html#ListAlbum.


Source picasaResponse = restTemplate.getForObject( albumsURL, Source.class, parameters );

Jaxp13XPathTemplate xpathTemplate = new Jaxp13XPathTemplate();

Collection albumIds = xpathTemplate.evaluate("//entry",

      picasaResponse, new NodeMapper(){

   public Object mapNode(Node node, int i) throws DOMException {

      Element album = (Element) node;

      log.debug("IN NODE ALBUM");

      return null;

   }

}


This never worked. It should have I thought. Trying different combinations of "/entry", "/feed/entry", "//atom:entry", "/atom:feed/atom:entry", swapping with Jaxen, etc made no impact.


Then after some googlebashing and soulsearching I solved the problem.

The Xpath template needs a namespace to resolve the atom xml. So adding this solved the problem:


Source picasaResponse = restTemplate.getForObject( albumsURL, Source.class, parameters );

Jaxp13XPathTemplate xpathTemplate = new Jaxp13XPathTemplate();

Properties namespaces = new Properties();

namespaces.setProperty("atom",

   "http://www.w3.org/2005/Atom");

xpathTemplate.setNamespaces(namespaces);

Collection albumIds = xpathTemplate.evaluate("//atom:entry",

      picasaResponse, new NodeMapper(){

   public Object mapNode(Node node, int i) throws DOMException {

      Element album = (Element) node;

      log.debug("IN NODE ALBUM");

      return null;

   }

}




Ps. code simplified and not using bean injection etc for clarity.

Friday 15 October 2010

Why IRC is essential for distributed teams

Realising more every day that IRC is essential for distributed teams.

IMs (MSN, Google Talk, Communicator, etc), Skype & Live Meeting works well but is too sheltered, it is invitational only and time constrained.

Email is recorded, too formal, noisy and too asynchronous/slow.

Yammer or Twitter is nice for distributing comments and discussions, but is too slow for actual problem solving.

To keep teams up to date or solve problems together; a group chat is essential.

For culture build and low barrier of interaction of an informal and not archived discussions; a group chat is essential.

For rubber duck statements or help in minor but blocking issues that would be less likely to ask people directly; a group chat is helpful.

For less direct interruptions than IMs or phone; a group chat message which people can respond to when suitable will improve productivity.

Even for non distributed teams, IRC is an important productivity and culture tool. Continuous inconsiderate interruptions will kill productivity, while quick but asynchronous discussions smooth over the time requirements of the person asking and the person responding.

Unfortunately IRC is just too ugly, too much unix/hacker impression, too old; for an enterprise / self important company to consider.

Alternatives like the now discontinued Google Wave, 37signals's CampFire and others exist, but an internal IRC server does solve all these issues.

Tuesday 21 September 2010

People's kids on profile photos

my football Think Ill replace my photo with my football. It is very dear to me, so it must represent me.

Will you first try to work out if you recognise the ball? Would you even care who the ball is, or just skip the post as you don't know who it is at a glance.

me and football What about a photo of me and the ball? Do you first try and work out whether I am the ball or me? Why is the ball relevant to tell you who I am, have you met my ball?


football team What about a zoomed our photo of my whole football team, they are my "family". Would anyone recognise who I am? Without zooming fullscreen?

Off course I know Ill change my profile photo to my eventual offsprings as well.

Tuesday 7 September 2010

Review of Groovy for Domain-Specific Languages

I recently read the Groovy for Domain-Specific-Languages book by Fergal Dearle. The book essentially covers what Groovy is, what DSL is and how to apply Groovy to incorporate a DSL for your applications.

After reading the book I have to agree that if you intend to create a DSL, which we basically do unintentionally all the time, then Groovy can fulfil these requirements with ease and simplicity.

The book is a easy to read book with clear text, syntax and examples without being too thick and not seem a like a javadoc of information overload. It is rather quick to read through due to the nice flow. The layout do make it a nice reference for myself in the future as it is laid out clearly and contains a large variety of working examples.

The book starts of with first explaining the concepts of what DSL is, what it means in terms of computer science history and how we already use them.

It then goes on to explain in clear but complete detail what Groovy is and does. Actually these chapters are a good introduction to Groovy book in themselves.

Dearle then procedes to explain the main technologies built on top or as part of Groovy such as the web framework: Grails, the Groovy Ant builder scripting tool: Gant, Groovy & Grails ORM database mapper: Gorm, BDD frameworks and similar technologies. This it does in enough detail so that you have a good idea what they do and can experiment with yourself afterwards.

The last half of the book Dearle then brings Groovy and the related technologies back into the DSL fold and explains why and how Groovy is excellent for DSL writing. E.g: Groovy’s dynamic nature, closures, or the multitude of “Builders” which basically are DSLs outright.

These chapters of the book has a large set of basically Cook Book examples of Groovy DSL writing, builders and finishes with how to integrate Groovy with Spring, XML, Ant and existing Java applications.

I was already aware of Groovy’s suitability as a DSL language, but I am now even more convinced of its power, ease and fit as a or rather the DSL. If you would like to have a peak at the book there is a free chapter, or why not buy the book? ( amazon.co.uk, amazon.com, Packt)

(Note: this book was also reviewed on slashdot this summer)

Thursday 26 August 2010

What more important than Productivity?

With modern day communications and old, the proliferation of open plan offices and persistence of micro management I wonder if companies really prioritise productivity enough. (This may be the same issue across business segments and professions, however I only really know IT.)

Jason Fried of 37Signals recently was interviewed about the never ending interruptions at work and how it results in longer working hours, more stress and generally lower productivity. He describes (among other things) the old fashion top-down management style's instance of continuously calling meetings to get status or decisions or walking up to you or calling to get status or feedback. With co workers doing the same as well as calling you over to solve an ad hoc problem the time to actually concentrate and get any of your own work done is almost impossible until the end of the day, and results in longer days.

The same issues I encounter all the time. Useless meetings where I only need to be conscious for 5% of the time. Using tools such as MS Live Meeting from my own desk means I can do other things during the meeting, however also the disconnected nature results in often me not quite following what others are saying and either miss opportunities for vital input I might have or context when I need to respond. It is frustrating that the closer you come to a deadline the more meetings are called for status and less work you can do.... Not very agile.

The meetings however I can deal with, it is the noise and interruptions of open plan office and with micro management that I think affects productivity the most. I did previously blog of my distaste and issues with open plan offices, and suggested solution for layout, the lagoon. Open plan in general is not compatible with developers due to its nature if "increased" communication. Open plan lowers the barrier to interrupt others which may solve your specific problem quicker however it delays not just the person you interrupted but also people nearby that was affected by your "noise". That delay and noise is very expensive for developers whom need to concentrate. But unfortunately the people that plan and evaluate the benefits of open plan offices are management, admin or finance for whom communication is paramount and the need to concentrate very short, so the lost productivity is ignored.

Jason described how the solved some of their interruption problems by using their own products, Campfire, which in general is a visual IRC and IM. This way people can ask for help or discuss subjects asynchronously and limits interruptions as people can respond when they have finished their concentration period. Sure, their individual problem is not solved immediately, but work across teams are optimised. Business critical emergencies should probably still be shouted out about though.

I certainly believe in the use of IM and would love more use of IRC and similar tools at work. I don't like the copy all emails, I detest people calling me for non urgent issues, and find people walking up to me a nuisance when it is the same people over and over again. I try to restrict phoning people for issues that are non critical to the company, as I know how inefficient it is of their time and would be annoyed if anyone did the same to me. However often management and other "communication" roles insist on this type of communication of status. ( But then again the people you need to call for status are often not good with communicating their status. E.g. not updating issue status in tools, or simple email that the issue is worked on or even email response of status when quiet for too long. )

All this disturbance usually results in that I can only really do "proper" development late afternoon. So I usually work 3-4 hours later than colleagues if I have tasks I need to finish as they can not all be done during office hours due to all the interruptions. The lost productivity across the company will vary but all this interruptions due to open plan offices and communication procedures must cost companies a lot of money!

In this time of agile projects, the agile teams usually get to decide their tools to more agile and productive. Projects still stuck with non agile often get told what tools to use. And both agile and non-agile get told what office space to use, irrespective of productivity.

Communication is important, however should not be at the cost of productivity. Agile thinking (KanBan) of focusing on few tasks is important, but always interrupting everyone else to solve your problem is not productive. Using tools to asynchronously communicate with people relevant people, limiting noise by using rooms of fewer / team related / similar people, encourage voluntary quick coffee breaks / rubber duck sessions, applying the pomodoro technique, can mitigate and solve this productivity issue, while still keep up a high level of communication.

Friday 23 July 2010

Spring MVC ExceptionHandler needs to be in same class

Had a frustrating evening (pet project) trying to get Spring 3.0 MVC's annotation based exception handler to work.

All the examples seemed straight forwards:

Just annotate a method in a controller:
import org.springframe...ExceptionHandler;
import org.springframe...ModelAndView;
import org.springframe...Controller;
....
@Controller
public class MyController {
....
@ExceptionHandler(SomeException.class)
public ModelAndView myExceptionHandler(
    SomeException exception){
  blah
}
...
}


But it just would never catch my exceptions. Very frustrating.

But in the end a google search to the end of the world where someone mentioned in the comments that the exceptionhandler method have to be be in the same class as the method throwing the exception.

Very odd restriction compared to Spring's usual very agile and generic annotation.

So I added my handlers to my abstract controller class that all my controllers extend and problem solved, with some hair still intact.

Tuesday 20 July 2010

org.hibernate.MappingException: Could not determine type for Set / List

I was simplifying the domain model of a pet project by removing an unneccesarry entity by using JPA 2.0's ElementCollection annotation:

public class SecurityDetail {

public enum AuthorityRole{
  ROLE_ADMIN,
  ROLE_SUPER,
  ROLE_USER
}
....
@ElementCollection
@CollectionTable(
  name="Authority",
  joinColumns=@JoinColumn(name="username")
)
private Set authorities;
....


However I was getting this error message:
org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: SecurityDetail, for columns: [org.hibernate.mapping.Column(authorities)]


Digging around (googling) I ended up on this blog entry: blog.m1key.me/2010/06/orghibernatemappingexception-could-not.html, which main solution is to make sure you have a newer hibernate, version 3.5.3 or later.


I use maven, with the hibernate3-maven-plugin, sql-maven-plugin and dbunit-maven-plugin to create the schema, database and to populate data. So I bumped the org.hibernate:hibernate-entitymanager dependency from 3.5.0 to 3.5.3-Final. (and fixed my own nexus repository to pull JBoss's latest jars.)

However it did not fix the problem. But by reading the comments of the blog entry above I also realised that my hibernate3-maven-plugin may be using older dependencies. So I explicitly added the recent verions of org.hibernate:hibernate-core dependency to both the plugin and the app, as well as org.hibernate:hibernate-entitymanager to the plugin as well:

<properties>
  <hibernate.version>3.5.3-Final</hibernate.version>
</properties>
....
<dependencies>
  <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>${hibernate.version}</version>
    <exclusions>
      <exclusion>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
      </exclusion>
      <exclusion>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
  <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>${hibernate.version}</version>
    <exclusions>
      <exclusion>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
      </exclusion>
      <exclusion>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
</dependencies>
....
<plugins>
  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>hibernate3-maven-plugin</artifactId>
    <version>2.2</version>
    <executions>
      <execution>
        <phase>process-classes</phase>
        <goals>
          <goal>hbm2ddl</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <components>
        <component>
          <name>hbm2ddl</name>
          <implementation>jpaconfiguration</implementation>
        </component>
      </components>
      <componentProperties>
        <persistenceunit>${project.artifactId}</persistenceunit>
        <outputfilename>schema.ddl</outputfilename>
        <drop>false</drop>
        <create>true</create>
        <export>false</export>
        <format>true</format>
      </componentProperties>
    </configuration>
    <dependencies>
      <dependency>
        <groupId>hsqldb</groupId>
        <artifactId>hsqldb</artifactId>
        <version>${hsqldb.version}</version>
      </dependency>
      <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>${hibernate.version}</version>
        <exclusions>
          <exclusion>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
          </exclusion>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>${hibernate.version}</version>
        <exclusions>
          <exclusion>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
          </exclusion>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
    </dependencies>
  </plugin>
</plugins>

Friday 16 July 2010

Groovy for DSL

Started reading through Groovy for Domain Specific Languages, a new book by Fergal Dearle. As I interested in how to apply Groovy in more enterprise applications I would have normally liked to read this book, however I was also asked to write a review of the book, so Id better read it! How to keep DSLs easy to read while easy to create and maintain with Groovy will be something I hope this book covers.

The book was also reviewed on slashdot recently.

You can read the free chapter or buy the book yourself at e.g. amazon.co.uk, amazon.com or Packt.

Any comments of others interested in Groovy, especially in the DSL area are very welcome?

Friday 2 July 2010

Skinny WAR Assembly in maven

If you want to create a "Skinny WAR" so that you can package it as part of an EAR or as in my case as part of an assembly later, then you can do this:


<plugin>
   <artifactId>maven-war-plugin</artifactId>
   <version>2.1-beta-1</version>
   <configuration>
     <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
     <archive>
       <manifest>
         <addClasspath>true</addClasspath>
         <classpathPrefix>lib/</classpathPrefix>
       </manifest>
     </archive>
   </configuration>
</plugin>


If you then later in another pom.xml want to include this war and the excluded libraries:


<dependency>
   <groupId>${project.groupId}</groupId>
   <artifactId>you war module name</artifactId>
   <version>${project.version}</version>
   <type>war</type>
</dependency>
<dependency>
   <groupId>${project.groupId}</groupId>
   <artifactId>you war module name</artifactId>
   <version>${project.version}</version>
   <type>pom</type>
</dependency>

Maven Jetty and Tomcat dependencies with JSP / JSTL errors

I use Jetty as a Maven plugin during development, but tend to run Tomcat as my deployment server. (Not sure "production" is appropiate as it's my personal server). My applications are often java MVC based utilising some form of JSP.

This combination creates a slight issue with dependencies for JSP and JSTL. If you have ever seen this error when running mvn jetty:run:

java.lang.ClassNotFoundException: org.apache.el.ExpressionFactoryImpl

Or these errors when running in tomcat when it was okay in jetty:

javax.servlet.jsp.JspApplicationContext
.getExpressionFactory()Ljavax/el/ExpressionFactory


or

org.apache.jasper.JasperException: Unable to read TLD "META-INF/c.tld" from JAR file

or

java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/catalina/loader/WebappClassLoader) previously initiated loading for a different type with name "javax/el/ExpressionFactory"

Over the last few years I have perservered and solved this flat wheel in different ways. However in my recent deja-vue I now have a tidy solution. (the project where this is visable is my up4 project. github source, demo)

I am utilising the jetty maven plugin, and the tomcat maven plugin to show how this works.


<plugin>
<groupId>org.mortbay.jetty</groupId>
   <artifactId>jetty-maven-plugin</artifactId>
   <version>7.0.2.v20100331</version>
</plugin>
<plugin>
   <groupId>org.codehaus.mojo</groupId>
   <artifactId>tomcat-maven-plugin</artifactId>
</plugin>


To utilise JSP pages and JSTL EL with e.g. Spring MVC / Struts Tiles you perhaps expect these types of maven dependencies, remembering that most containers include support for Servelet API and JSPs:


<dependency>
   <groupId>javax.servlet</groupId>
   <artifactId>servlet-api</artifactId>
   <version>2.5</version>
   <scope>provided</scope>
</dependency>
<dependency>
   <groupId>javax.servlet.jsp</groupId>
   <artifactId>jsp-api</artifactId>
   <version>2.1</version>
   <scope>compile</scope>
</dependency>
<dependency>
   <groupId>javax.servlet</groupId>
   <artifactId>jstl</artifactId>
   <version>1.2</version>
</dependency>


If you then try mvn clean jetty:run you may end up with a:

java.lang.ClassNotFoundException: org.apache.el.ExpressionFactoryImpl

A response which will solve the jetty problem is to include some jstl EL dependencies:


<dependency>
   <groupId>javax.servlet</groupId>
   <artifactId>servlet-api</artifactId>
   <version>2.5</version>
   <scope>provided</scope>
</dependency>
<dependency>
   <groupId>javax.servlet.jsp</groupId>
   <artifactId>jsp-api</artifactId>
   <version>2.1</version>
   <scope>compile</scope>
</dependency>
<dependency>
   <groupId>javax.servlet</groupId>
   <artifactId>jstl</artifactId>
   <version>1.2</version>
</dependency>
<dependency>
   <groupId>org.apache.tomcat</groupId>
   <artifactId>jasper-el</artifactId>
   <version>6.0.26</version>
</dependency>


mvn jetty:run

This should now work fine in Jetty (test in browser as well).

Now try the application in tomcat: mvn clean tomcat:run . It will moan about unable to read some the JSTL taglibs:

org.apache.jasper.JasperException: Unable to read TLD "META-INF/c.tld" from JAR file

This due to the compile scope of the jsp-api dependency, changing this to provided:


<dependency>
   <groupId>javax.servlet</groupId>
   <artifactId>servlet-api</artifactId>
   <version>2.5</version>
   <scope>provided</scope>
</dependency>
<dependency>
   <groupId>javax.servlet.jsp</groupId>
   <artifactId>jsp-api</artifactId>
   <version>2.1</version>
   <scope>provided</scope>
</dependency>
<dependency>
   <groupId>javax.servlet</groupId>
   <artifactId>jstl</artifactId>
   <version>1.2</version>
</dependency>
<dependency>
   <groupId>org.apache.tomcat</groupId>
   <artifactId>jasper-el</artifactId>
   <version>6.0.26</version>
</dependency>


Test first in mvn jetty:run , which should be okay.

Then in mvn clean tomcat:run . It starts ok, but on the first browser test this error appears:

javax.servlet.jsp.JspApplicationContext
.getExpressionFactory()Ljavax/el/ExpressionFactory


Okay, so Tomcat does not like JSTL EL dependencies as it provides them itself, so my initial respone was to have a separate profile which changed the scope of the dependency to provided for tomcat builds only. However on further reflection it turns out the spec says JSP & EL should be provided by the container. So in fact the problem lays with Jetty, and it turns out the move to eclipse.org created a licensing issue with JSP, so jetty does not include the appropiate libs. So to fix this the correct dependencies will have to be:

In your plugins section:


<plugin>
   <groupId>org.mortbay.jetty</groupId>
   <artifactId>jetty-maven-plugin</artifactId>
   <version>7.0.2.v20100331</version>
   <dependencies>
     <dependency>
       <groupId>org.mortbay.jetty</groupId>
       <artifactId>jsp-2.1-glassfish</artifactId>
       <version>9.1.1.B60.25.p2</version>
     </dependency>
     <dependency>
       <groupId>org.apache.tomcat</groupId>
       <artifactId>el-api</artifactId>
       <version>6.0.26</version>
     </dependency>
     <dependency>
       <groupId>org.apache.tomcat</groupId>
       <artifactId>jasper-el</artifactId>
       <version>6.0.26</version>
     </dependency>
   </dependencies>
</plugin>


And in your normal dependencies section:


<dependency>
   <groupId>javax.servlet</groupId>
   <artifactId>servlet-api</artifactId>
   <version>2.5</version>
   <scope>provided</scope>
</dependency>
<dependency>
   <groupId>javax.servlet.jsp</groupId>
   <artifactId>jsp-api</artifactId>
   <version>2.1</version>
   <scope>provided</scope>
</dependency>
<dependency>
   <groupId>javax.servlet</groupId>
   <artifactId>jstl</artifactId>
   <version>1.2</version>
</dependency>
<dependency>
   <groupId>org.apache.tomcat</groupId>
   <artifactId>el-api</artifactId>
   <version>6.0.26</version>
   <scope>provided</scope>
</dependency>
<dependency>
   <groupId>org.apache.tomcat</groupId>
   <artifactId>jasper-el</artifactId>
   <version>6.0.26</version>
   <scope>provided</scope>
</dependency>


mvn jetty:run & mvn tomcat:run

Voila.


Ps. If you are providing a WAR for another jetty container, you may want to create a profile section which include the provided dependencies.

Ps2. If you prefer Sun's EL libs then replace the org.apache.tomcat dependencies with:

<dependency>
   <groupId>javax.el</groupId>
   <artifactId>el-api</artifactId>
   <version>2.2</version>
   <scope>compile</scope>
</dependency>
<dependency>
   <groupId>org.glassfish.web</groupId>
   <artifactId>el-impl</artifactId>
   <scope>runtime</scope>
   <version>2.2</version>
</dependency>

Friday 25 June 2010

Ignorant or prejudiced Media?

Right at the end of the USA v Algeria match, the Algerian captain Antar Yahia was sent off for a second bookable offence. But it was a classic case of mistaken identity by the Belgian referee Frank de Bleeckere.

In the replays you can see it is 2 or 3 others that is shouting at the referee, one which looks similar to Yahia but you can see by his name it is a different player. The referee turns around and walks away as he has decided they have overstepped the mark.

Yahia then arrives and does what a captain should and pulls his players away. He is then the only player left when the referee turns back around this time with his yellow card and shows it to Yahia by mistake. This was his 2nd card and he was sent off.

Yahia is baffled but walks straight off the pitch to his credit. (This is not to say Yahia perhaps deserved another yellow card earlier in the match even red)

As this was in 90+ m, in injury time, it did not really affect the result nor did Algeria have any chance of progression, but it affects Algeria's reputation as again they have had a player sent off instead of a simple yellow card.


What is remarkable is that this has barely been mentioned in the media afterwards. Any Google searches only reveals match reports and comments again about Algeria failing to control their tempers. Yahia is stated as deserving his 2nd card due to abuse of the referee. [1] [2] [3] Had this been England, US, Italy etc the referee would be ridiculed in the papers, but Algeria.. no mention.

Monday 31 May 2010

DB2 client on Windows 7

(Unfortunetly) I have been trying to install DB2 on my Windows 7 laptop as my recent assignment is very Websphere/DB2 centric. And even the unit test rely on a DB2 database.

For some reason v9.5 of DB2 Enterprise server does not like my laptop. :(

But we have standardised VM images of the DB2/Websphere set up that I could use, which is a very good practice. However as we use the type2 jdbc driver you still need a local DB2 Client installed, which again did not work...

But my solution did work: I installed the simpler Runtime Client.

Here is the steps I took.

  1. Installed our pre configured VM image

  2. Downloaded our ready made DB2 profile configuration txt file for the VM

  3. Modified my host file to alias the hostname used in txt file correctly to my VM's IP

  4. I read "Which DB2 9.5 client connectivity option is right for you?",

  5. downloaded the DB2 v9.5 Runtime Client and installed it

  6. and applied the tips on howto import the profile configuration by command line via db2cfimp file.txt



Hope this is of use to others with DB2 + Windows 7 grievances.

Friday 28 May 2010

Pay IT people in gadgets! (Office perks)

I was talking to my collegue Rune regarding gadgets at work as an office perk as well as improving efficiency.

He was saying that IT staff (by which we mostly meant us and similar developers) love gadgets. And he would love to receive a new phone and/or pc every 6 months and thinks it actually would be benificiary to the company.

You may think that is an extraordinary unneccessary expense in hardware and install/configuration time but I think it may actually be cost effective or at least cost neutralised.

It would make staff happier and thus less likely to leave. Thus saving on reqruitement and training.

Perks are often used as a way to keep salaries down. It may reduce your salary expense which is the bulk of all company and projects costs, while still entice people to stay.

By leveraging more virtual machines the configuration costs would be reduced.

Basically we (maybe not everyone, but a large majority I think) love to tinker with new gadgets.



I know some people in my own team have left to work for companies that have an individual "gadget budget", not their only reason for leaving but a nice sweetner.

I think the cost of gadgets per year e.g £2,000 compared to salaries of £50,000 may be good retention reasons and probably can be off set against company tax etc.


Apart from job satisfaction and enjoyment, some people may be well organised or cynical to only consider salary as their only job incentive. With which they say they can join the gym they want if needed, pay for the cabin/flat/hotel for the holidays when needed, choose their own home pc etc. However I think most then just travel less, train less and have old gadgets etc and have a lesser life for it.

I love the perks I currently get with e.g. company cabins. I went 5 times this winter to skiing cabins. If I had to pay for them I may have gone only once, if that. When we had a large sports hall in our office building up until last year I played football, floorball and basketball there every week. Now since we moved office where we no longer have access to such facility I have not played floorball and basketball since, and rarely play footie as well.


Basically I am a sucker for perks, and I think most IT people would be alured by gadget perks.


Note: I have previously blogged about Why waste money with inferior equipment as so much time and therefore money is wasted due to inferiour hardware or outdated tools. Investing in new hardware and tools continously would keep those costs down, with some additional configuration cost, but savings in staff costs and the exponential maintenance cost of legacy tools and systems.

Thursday 27 May 2010

Recommended Android apps

This is a list of Android apps I use and/or recommend. As Android Market is quite a user unfriendly especially when it comes to actually find apps, distinguish quality from copycat rubbish, regional relevance etc so I hope it is of use to some people looking for tips or reviews.

All these apps are free as I live in Norway, and Google Market does not allow paid apps in Scandinavia or most of the world. Great policy.... :(


  1. Touiteur. My prefered Twitter client

  2. Locale Useful tool that changes settings on your phone depending on different conditions. I use it to lower my ringtone at work, change autolock to off at home, turn of volume during the night, switch on wifi at home, reduce brightness in evening.
    Note: Locale is no longer free so no longer recommended

  3. Wave Secure Security app that can remotely locate you lost/stolen phone and do various things such as play a ringtone to locate it, backup data or even wipe / disable the handset.
    I no longer use it as it is trialware and was worried about battery consumption.

  4. Remember the Milk I just would not function without my rmilk controlling my life

  5. Dolphin A browser. Quite useful. Not 100% switched to it from the stock one, but give it a try.

  6. Spotify Music streaming. Can't live without it.

  7. PlayNow by SonyEricsson. Music, games and app store by Sony. Quite a good selection of music. Included with my X10

  8. MediaScape by SonyEricsson. Media Photos/Music/Videos organiser and viewer. Works very well. Included with my X10

  9. TimeScape by SonyEricsson. Social and communication tool. Neat, but some scaling issue with social tools (Twitter/Facebook). Included with my X10

  10. 1881 Mobilsøk who is calling lookup tool in Norway. Works with all numbers so far.

  11. Listen by Google. My Podcast listener. Use it all the time for my JavaPosse addiction

  12. Places by Google. Very usefull lookup of local info eg resturants etc.

  13. SayMyName text-to-speach announcer of who is calling. I like it even though it really can't pronounce my sister's name: Hege

  14. SMS Popup Handy SMS previewer

  15. Compass by Google. Does what it says on the tin.

  16. SkyMap by Google. Keep forgetting to actual try it in the dark...

  17. MyTrack by Google. Cycling/Hiking route tracker.

  18. MyCityBikes Quick usefull information on how many bikes / places available city bike stands around Oslo (and perhaps others)

  19. Delicous Usefull to bookmark e.g. twitter links to look at later.

  20. Facebook yup, does facebook.

  21. Opera Mini Nice browser, but I stil use the stock Androind browser or Dolphin.

  22. TrackId by SonyEricsson. Like Shazam identifies music tracks by listening to them. Never really used either in practice. Included with my X10

  23. CallFilter Enables ignoring unknown callers.

  24. Trafikanten Excellent tool which suggest bus/tram/tube/train travell in Oslo by position and real time data.

  25. Layar Ads information about the area in your vicinity / camera view

  26. AutoLock Customises when your Android handset is locked (require pattern thing to unlock)

  27. Moxier Mail Use it to read my work Mail via MicroSoft Exchange ActiveSync

  28. Moxier Calendar Use it to read my work calendar

  29. Moxier World handy little weather tool

  30. Shopper by Google. Nice for demos but too US centric to be useful

  31. Goggles by Google. Nice for demos but too US centric to be useful

  32. Gesture Search by Google. Neat but never really used it practice

  33. Maps by Google. Included with my X10 and probably all Android handsets?

  34. Navigation by Google. Does not work in Norway

  35. Gmail by Google. Included with my X10 and probably all Android handsets?

  36. Google Talk by Google. Included with my X10 and probably all Android handsets?

  37. FourSquare Works well, although hard to add new places.

  38. Apollo Task Killer My first task killer. I use this one as my continously running auto killer

  39. Advanced Task Killer My other task killer. Which I on demand kill tasks. If you only need one, I prefer this one over the first one.

  40. Quick settings (with lowercase s) by SonyEricsson. Very handy and pretty widget for toggling wifi, bluetooth, gps and sound. Included with my X10

  41. Quick Settings handy widget for changing brightness amongst others.

  42. Currency Converter Usefull with nice charts as well. Could do with quick left/right switch button.

  43. Autopilot for Locale. Uninstalled when Locale became unavailable.

  44. WisePilot Its trialware and expired before I really used it. Included with my X10

  45. Youtube by Google. Not really used much. Nice for demos but not in practice. Included with my X10 and probably all Android handsets?

  46. eBuddy Multi channel chat client. Not used too much since Google Talk is already included with Android.

  47. Scoreboard Not used too much yet.

  48. Ringdroid Not used too much yet.

  49. ConnectBot SSH tool.

  50. Astro File manager.

  51. ES File Explorer

  52. StopWatch

  53. Unit Converter




Apps I miss from my old iPhone:
  1. TV2 Live Norwegian TV station have an app for football score updates and commentery with live video higlights

  2. Skype No Android version.

  3. Yr.no Weather app. The Android version is unstable.

  4. Kindle Think I could read some books on my 4" X10 screen

  5. iPortalen.no Not an app, but a webpage of iPhone compatible web sites. An Android version would be good!

  6. Doodle Jump

  7. SMSBank Handy little tool to see the balances of my accounts

  8. Notes

  9. NRK Radio

  10. Twitter nae Tweetie Touiteur is pretty good though.



Apps/Features I miss:
  1. Google Voice Not available outside the US

  2. Data Roaming Toggle widget

  3. Better keyboard I switch languages a lot, which was easy on the iPhone, but too many clicks in Android

  4. BBC iPlayer Region restrictions

  5. More useful Google Latitude/Foursquare/Gowalla I am only interested whom I know in the neighbourhood, and not on demand; I want to be told.

  6. MultiSIM! Hardware, but would love to switch between my Norwegian and UK SIM cards on the fly



Apps/Features I think exist but havent had time or found yet or is a paid app:
  1. Amazon ec2 console

  2. Jira overview

  3. Google Earth



Games:
  1. Air Control Addictive!

  2. Android LightSaber Compulsary

  3. Blow Up (LITE) Fun, but limited levels

  4. Chess

  5. Labyrith Lite Once calibrated it worked well.

  6. Pinball

  7. Quadrapop by SonyEricsson. Included with my X10

  8. Sodoku Free Works well

  9. Trap Quite addictive

  10. Tux Rider

  11. ThrottleCopter Simple, hard, but good.

  12. R.Thunder Lite Looks nice.

  13. Armadillo Roll Looks nice.

  14. BreakTheBlock

  15. SpeedForge 3D

  16. Space STG Galactic...

  17. Defend Homeland....

  18. Play Curling



Need to distinguish somehow how much I recommended the various apps...





Tuesday 11 May 2010

Sony Ericsson Xperia X10 1 month review

I have had my Sony Ericsson Xperia X10i for about a month now, and thought I could have a more reflected review than perhaps the one I nearly wrote just after I received it.

My previous phone was an Apple iPhone 3GS, so I can compare the X10 to maybe its more glamorous competitor. I will also compare it to my previous phones, such as the Nokia N95 8GB and other Android based phones I know.


In brief, what is the Xperia X10?
It is Sony Ericsson's first Android based mobile phone.

Key features:

  • 4" touch screen with no keyboard

  • 8.1 mp camera with LED light and face recognition

  • 1GB memory, includes an 8GB SD card

  • Sony Ericsson's own Rachael GUI on top of Android 1.6

  • Includes Sony Ericsson's TimeScape app for social network and communication overview

  • Includes Sony Ericsson's MediaScape, PlayNow and TrackID apps




Its Good points (Pros)


It is Android based. So you are much more in control of your own phone compared to e.g. the iPhone. Background apps are no problem etc.

The looks.
It is a very good looking phone. It also feels good for such a large screen. Its not bulky in your pocket. Unlike my N95! The screen is also very clear and bright.


The camera is excellent.
The iPhone camera was quite rubbish in comparison.
The X10's photos are very clear.

The N95 5MB and good lens was good, but the X10 is better.

The camera button which N95 did also have which iPhone does not have is a significant benefit. No more fidling around trying to take photos while trying to find the button on the screen with your other hand.


MediaScape is really usefull.
Android stock software has no proper media apps. But being a Sony derivative company, the X10 shines in this department. Not quite the full iPhone/iTunes interaction but Im not complaining, The PlayNow store works well. MediaScape integrates well with Picasa's online photo storage, but not flickr. Some improvements can be made, but media wise the X10 is excellent.


The GUI interface that SE has on top of Android code named Rachael works really well. It is only a thin layer on top of Android but is more slick and consistant. It integrates well with menu options and contact list etc. So well you are not really aware it is there, but makes the X10 stand out compared to a stock Android system.


The MW600 bluetooth stereo headset that comes with the phone (as well as a good pair of wired headsets) is really good. It has built in FM radio as well.


Its bad points (Cons)


TimeScape does not scale well.
It is a really good demo app. But once you start using it in real life it fails miserably. It just is not designed for people on Facebook or Twitter with more than a couple of friends (ie most people). Im no stalker, I perhaps follow 100-200 on both Twitter and Facebook which is less than most, but that already makes the TimeScape interface unusuable, just a big motion blurred scroll list. Some future updates could fix this. Such as limiting to certain Twitter lists, and facebook groups of friends for example.


The Android market, the app store on these devices is not great compared to the Apple app store.

You can't buy any apps if you live in Scandinavia which is ridicoulous. So we are limited to free ones only.

I am not sure about the quality or security of many of these, most seem like raw copies of others. There is no regional information, so the list is e.g. italian metro system info or loads of US bank apps for example, which is of no interest to me. There is few ways to find apps of interest to me, or new apps that is well liked etc.

There are some good apps though, and Ill list some in another post.


Android 1.6
The phone ships with Android 1.6 which is an outdated Android version. SE have shot themselves a little in the foot with this error and have been laughed at in the press regarding this. However I don't think it is big issue. If you are not aware of the improvements in 2.0, 2.1 etc then it is not a problem.

However they do need to roll out an upgrade. SE have announced upgrades later on this year. Which seems very slow to me. If this is how they will delay future updates as well then I slightly concerned about their policy.



No multitouch
Partly because old Android version, but apparently also because of hardware issues.
Not that big a deal for me. I don't like pinch and zoom, and tend to use my phone with one hand anyway. However I can see this is a big issue for other people.

Call quality
Call quality is fine, but some of the people say they can here themselves. Solved by lowering my volume slightly but should have been cancelled out by the microphone instead.


Battery life


The biggest minus of the X10 is the battery life.
In brief it sucks.
From a large screened touch smart phone I was not expecting miracles. But it is rubbish even compared to the iPhone.

With e.g. my N95 I charged it every 2 or 3 days.

With my iPhone I charged it every day, but even if I didn't it was still alive in the morning. Not great but acceptable.

With my Xperia X10 I have to charge it twice a day otherwise it is a dead brick in the morning.

Which is attrioucious. Initial exuberance and overuse will result in more battery drain, but now I am in a normal usage pattern and this should not be acceptable. Disabling all auto syncing, auto killing processes etc should make it last a long time, but does not.

Android does come with a nice battery analyses app. And on most large screened smartphones it is the display that kills the battery. But on the X10 the display is 3-4%, while "Phone idle" takes ~50% and "Cell standby" taks 45%!! Two processes I would not expect to kill my phone. (Maybe cell standby if I was in a bad reception area, but Im not.)


Conclusion

If the battery problem gets sorted I would recommmend it to everyone. I do love the phone, but it just frustrating that it is often dead or dying.

If you are of a technology background or gadget fan then it is better than an iPhone.

However if all you want is a swish looking touch smart phone then iPhone's consistent well polished interface and apps are better.

If you still have a Nokia or similar, upgrade now!


Monday 10 May 2010

IntelliJ IDEA on Ubuntu (with Maven , Jetty and JRebel)

I have written an howto on Ubuntu+IntelliJ+Maven+Jetty+JRebel, basically a quick quide to get IntelliJ IDEA working on Ubuntu, with Maven, the Jetty plugin for Maven and with JRebel (JavaRebel).

It assumes a clean basic Ubuntu install, and is quite terse for now. I may extend it with more example work flows etc in the future.

Comments are welcome.

Wednesday 24 February 2010

Scrum bashing - natural iterative evolution

Not throwing my weight into a current Scrum bashing trend that erupted this week, as I'm a nobody when it comes to agile. But I tend to agree some of the points and disagree with others.

It all started off with Uncle Bob responding to Chris Brookins whom was looking for some of Scrum shortcomings to present at his work.

That raised a large number of responses on the thread and in the blogsphere. People such as Jeff Anderson stated that it was time for Scrum to evolve.

Others such as Jurgen Appelo came in defense of Scrum by insisting people should stop pissing on Scrum.


Issues raised



  • No technical rules, ie no prescribed methods of insisting on CI, TDD etc.
    I dont agree with limiting Scrum to development only, but suggestions are fine, which they kind of already do.

  • Sprint lengths are too long.
    They are. But again agile carrots of emphasising e.g. 2 weeks are better than bashing teams that need longer sprints.

  • Scrum masters assume or are assumed to have to much power.
    That does happen too ften, but coaching of team members and external chickens are probably the solution.

  • CSM, Certified Scrum Masters.
    Yup the title does not help, I even got it....,
    but dropping it may result in very few taking the courses all together. Time will give a solution to this I think.

  • Backlog structure.
    Not sure this can be solved, because so many different type of organisations use scrum for a variety of usage, the items in the backlog are very different.
    Partially the problem here also lies in the pedantic use of manual physical task boards,which translate into difficulties in transferring stories/tasks.
    Also the tools available, e.g. Jira+Greenhopper, have poor support for Stories and Themes.

  • Anti management.
    Scrum and its adapters have a reputation of Anti management.
    This may be true as team members often would like to introduce Scrum for the empowering of the team in the decisions.
    But once implemented it is not so much the case.
    I would actually say it is a bit pro management, once they see the results and a clearer vision of their future. Also Scum increases management due to the team's own micromanagement and constant status reporting.

  • Automatic tests.
    It's Uncle Bob, Mr FitNesse. True, an essential part, but not always the rule.

  • Multiple teams.
    Yes, this is one point that Scrum struggles with.



Future of Scrum



I think this bashing of Scrum now is a natural evolution.

The early adopters, the evangelical Scrummers, now need a new fix, and are quite vocal in Scrum's negative points. The early sceptics, also realises Scrum does not solve everything and would like to move on.

But it is natural. RUP, then XP, Lean etc are not perfect, they are just an iterative history of continual evolution and improving methodology of teams and projects.

Scrum is not a bible to follow for the next 2000 years. But now, or rather 5 years ago it was the best thing around. It has helped a huge amount of organisations become agile. Not perfect, but a lot better than before.

We should not always jump to the new shiny thing, but it is probably time to evolve, to continually improve and never rest at least not too long.


I quite like ideas suggested by Kanban. Kanban practices more common sense. As Henrik Kniberg writes in his minibook about scrum and Kanban.

But again it is not the final evolution. And everyone should adapt their needs as appropiate. There is no need for this bashing of Scrum. But neither should we not try to improve it.

Tuesday 23 February 2010

Dream employer past and present

With the demise of Sun following the Oracle's acquisition of it (or resurection depending on your view), I remembered that Sun Microsystem was once a "dream" employer of mine.

With Sun always seemingly on the forefront of technology, inventing(or acquiring) and leading the development of tools I liked; mainly Java but also within Unix, OpenOffice, VirtualBox, MySQL, etc.. And being fond of Open Source they were my "dream" company in the 90ies and early years of 2000.

But that faded over the last decade, so I began pondering what my current dream employers would be.


Current employer


And is it wise to speak/blog about other companies than my current? Would my current employer be offended or even future employers if not mentioned?

As Ive never been known to care too much about political correctness nor company politics I plow on regardless... Anyway would I still be at a company if I did not appreciate it? Maybe when I was a developer padawan I may have had less options, but today I can pick and choose so I don't think my current employer nor future ones will be that offended. :)


Dark past


Actually when I think about it, even Microsoft was a highly thought of employer in my early years. But grew out of that! Even IBM seemed attractive to the naïve student.


Today's dream companies




  1. SpringSource

    Avid user of their framework(s).
    Met a few of their employers whom seem great advocates for the company.
    But wary of VMWare influence, too corporate?
    (Offices in Southampton and now Frimley are close to family and potential future home in Alton, Hampshire.)

  2. Atlassian

    Great tools (Jira,Confluence,etc).
    Great supporters of Open Source projects.
    Influenced by their sponsering of JavaPosse.

  3. Canonical

    The company behind Ubuntu.
    Nice ethos, even the Ubuntu name.
    But perhaps not a Java company?
    And Im defintely not a C man.

  4. Twitter

    Great tool.
    Still a small company.
    But any relevant Java?

  5. Spotify

    Great tool.
    Great solution for future music.
    Interesting future.

  6. Amazon AWS

    Amazon web service, mostly ec2.
    Use it myself for my private servers,
    written documentation on how to use ec2 for others.
    Would be interesting to work with their cloud.

  7. Remember the milk

    Maybe too small?
    But supports distributed work force.

  8. Google

    Now too large. Nice ethos.
    Great innovators.
    Too algorithmic/academic culture.
    Bad reputation for coder burn.




Dream role/position out of scope


Dream/fantasy company/employer does not make working for them an ideal job. The actual position I would work as is obviously the crucial part. Perhaps you can have a dream position in an awfull company and the other way round. I am sure there always some disgruntled workers working for even in general fantastic companies.

Other factors such as job stability, salary and other compensations, location, coworkers, potential personal growth etc are all important but all out of scope for this list.


Analysis



If I review my list they tend to be smaller companies that have one or more great applications that I use myself. Perhaps they are not great companies, they just make great tools? Quite a few are also Open Source supporters.

And they may be cool companies, but are they working with what I do? Any Java? As I move away from a fulltime developer role and more and more into a system architect role, technology should be not so relevant, but I still mostly prefer Java based solutions (Or similar, Scala, Groovy etc). Due to less need to reinvent the wheel, more mature libraries, easier employment/training of developers, and personal indepth knowledge. And I do not know if these companies use Java, or even if they do if it is a marginalised technology choice.


Summary



What is important in the end is job satisfaction and that it supports my life outside work: Family etc. A great Norwegian motto is that "you work to have spare time". Ie the reason you work is to afford having quality spare time. In addition I think it is important that you enjoy what you work with. I do, basically I get paid to do my hobby.

If I am happy in a role the company should not matter. So this list will probably stay as a "dream" list". If I ever did work for one of them, I might actually see sides of the company that might tarnish the "dream" label!

In a perfect world, my dream company would be a charity. But I would feel guilty about demanding a significant salary from such a company. So my requirement of quality of life for me and my family may lower my ethical requirement of a company. But Microsoft is no longer on my list so I have some standards.

Actually anything based in a nice spot (Caribean, Barcelona, Meditereanian, New York) would have a great chance of making my list!

Tuesday 9 February 2010

oracle java blog - netbeans

So Oracle has now finally gotten their Sun. What does this mean for me and the javasphere?

A lot of people have strong feelings about the aqcuisition/merger and some feel strongly against Oracle. I don't. I don't love Oracle, but I think Java will be fine, if not better with their stewardship.

Java



Oracle needs Java, they use it all over their own product line and obviously especially with their former Bea products Java is core to their business. So an evolving, healthy and competitive Java is in their interest.

So Java, JEE, the Java VM platform etc will be fine, with more money available than at Sun. Actually it may be better as Oracle has a lot more funding and marketing capability, and it may revive the ailing JCP?


But what about the other Sun products, and specifically those related to Java?


Glassfish


I don't use glassfish, at least not directly, so personally I have no strong feelings on how Oracle will proceede with Glassfish compared to its more corporate Weblogic.

I use Weblogic at work and either Jetty or Tomcat on pet projects at home.


Kenai


Kenai was to be killed, but read somewhere today it may be saved.
I don't use it. I have a few projects on Sourceforge, and future ones may be on SF or perhaps google code or Github.


Netbeans


Netbeans however I do use.

In the initial press release by Oracle on its plans for Sun's product line they stated it was to be focused as a scripting IDE and leave JEE, java enterprise level, to their own JDeveloper and Eclipse tools.

I use it with Maven and JEE modules so this feature strategy change would affect me very much. I dabled with eclipse for a few years, and still use when forced to at work, but prefer Netbean's cleaner interface (Its not made by IBM...)

However again in an updated press release they have a seperate java tooling page regarding their plans and they may not restrict it to that. Lets hope not.


Cloud


Oracle killed Sun's cloud computing ambitions. Fine by me. They are not into being a hosting provider.

I use Amazon's ec2 a lot, and will not miss it. However I did not know enough about its features compared to ec2 and Google's App engine. It would have to be much better than those to have been worth it. Maybe it was more like Ubuntu's cloud offering with hardware hosting?


VirtualBox


VirtualBox I do use, and glad it looks like it will be kept as is, I think.


Solaris


I have no strong feelings for or against Solaris, but keeping it competitive is probably in their interest.

The hardware and other areas I am not too bothered about. I used Sparc at university, but not since.

Other links:
http://blogs.oracle.com/devtools/2010/02/updated_faq_for_the_developer.html
http://www.oracle.com/ocom/groups/public/documents/webcontent/038563.pdf

Monday 8 February 2010

Excellent tip on how to go to sleep

(For once a non tech related posts, but still perhaps nerdy...)

I've worked out how to fall asleep quickly, and this is my simple tip:

Basically I start to think/daydream about a fantasy story. Ie something completely irrelevant but interesting.

Maybe it is by coincidence or due to other factors like getting older or simply exhaustion but it seems to work evertime. And fails everytime I don't follow these rules.

So it has to be nothing realistic or related to my real life in anyway. If I think about something in my actual life I get too upset/depressed/happy/excited and very engaged into the thinking that I don't fall asleep.


So my rules are:

  • Never think about what I did today or what I need to do tomorrow. That engages my brain too much and I can't fall sleep.

  • Don't think about regrets of the past or problems in the future, again no sleep.

  • Don't think about anyone you know whether romantically or aggressively. No good can come of that. Well maybe...

  • Don't think about work or hobbies. You minds gets too active to fall sleep.


Think about something interesting that can not upset you in anyway. Which is best if it is something not related to you at all.


The famous tip of counting sheep [2] jumping over a fence works on the same idea, but never worked for me as it was too boring. I remember a tip on a radio show that also is similar; The lady said she "thought and concentrated" about each part of her body from toes upwards step by step till she felt asleep. Doesn't work for me but is again related to concentrating on something completely irrelevant.


My thoughts/dreams are usually almost like a Hollywood film. Something not related to my real life, but I "live" in detail in these worlds. Maybe because I am a man (with a vivid imagination) that my snoozethoughts are related to wild western / jungles / space / racing cars etc but they work.

I can continue the same story for months usually because I fall asleep so quickly so never really get anywhere in the actual story line!

If trying to sleep try to block out all other thoughts and imagine yourself living a life in a place like the Avatar film, then maybe this will work for you?

If you have problem sleeping, try it!
Don't think about anything in your real life, think unrelated fantasy, and zzzzzzz.

Friday 22 January 2010

Ubuntufying Jira

This will eventually be published here: flurdy.com/docs/jira/.

But meanwhile Ill edit a draft here:



Ok. Ive "finished" the document. Please read it on my website.


Ignore below


Below is my initial draft howto, but a much more up to date version is on my site.



Why


I want to install and run Atlassian's Jira, as it is just great. Especially as I many moons ago had paid for the $10 starter pack for Jira and Confluence

I want to install and run it on an Ubuntu server.

Downloading the standalone version of Jira works very well. Atlassian has very thorough documentation of every step and issue possible.

But I want to be different... No I just like the idea of Ubuntu/debian's package system and obeying the FHS recommendation of file locations etc. So I decided to modify the download from Atlassian:

Steps



Install Jira as recommended


Launch Ubuntu (Follow flurdy ec2 docs for tips on using Ubuntu & ec2)

Install java:
sudo aptitude install sun-java6-jdk;
sudo update-alternatives --config java;
sudo echo JAVA_HOME=/usr/lib/jvm/java-6-sun > /etc/profile.d/java.sh;
sudo echo EXPORT JAVA_HOME >> /etc/profile.d/java.sh;
sudo chmod +x /etc/profile.d/java.sh

Download jira standalone

Extract and move Jira
tar xzf atlassian-jira-enterprise-4.0.1-standalone.tar.gz;
sudo mkdir /opt/atlassian;
sudo mv atlassian-jira*-standalone /opt/atlassian/jira-4.0.1

Add Jira user
sudo /usr/sbin/useradd --create-home --home-dir /usr/local/jira --shell /bin/bash jira;
sudo chown -R jira:jira /opt/atlassian/jira-4.0.1


If you are not interested in seperating the file locations etc, then you could now run Jira by launching
sudo /opt/atlassian/jira-4.0.1/bin/startup.sh
But I prefer not to...


Makign the install more FHSish



Create folder for changeable data
sudo mkdir /etc/opt/atlassian /etc/opt/atlassian/jira;
sudo mkdir /var/opt/atlassian /var/opt/atlassian/jira;
sudo chown jira:jira /etc/opt/atlassian/jira /var/opt/atlassian/jira


Move logs
sudo mv /opt/atlassian/jira-4.0.1/logs /var/log/jira;
sudo touch /var/log/jira/atlassian-jira.log;
sudo chown jira:jira /var/log/jira/atlassian-jira.log;
sudo ln -s /var/log/jira/atlassian-jira.log /opt/atlassian/jira-4.0.1/atlassian-jira.log;


Link configurations
sudo ln -s /opt/atlassian/jira-4.0.1/atlassian-jira/WEB-INF/classes/jira-application.properties\
/etc/opt/atlassian/jira/;

sudo ln -s /opt/atlassian/jira-4.0.1/atlassian-jira/WEB-INF/classes/log4j.properties\
/etc/opt/atlassian/jira/;

sudo mv /opt/atlassian/jira-4.0.1/conf\
/etc/opt/atlassian/jira/tomcat;

sudo ln -s /etc/opt/atlasiian/jira/tomcat\
/opt/atlassian/jira-4.0.1/conf



Edit configuration and enter Jira home
sudo vi /etc/opt/atlassian/jira/jira-application.properties;
jira.home=/var/opt/atlassian/jira


Move the database
sudo mkdir /var/lib/hsqldb;
sudo mkdir /var/lib/hsqldb/jira;
sudo chown jira:jira /var/lib/hsqldb/jira;
sudo ln -s /var/lib/hsqldb/jira\
/opt/atlassian/jira-4.0.1/database



Move non static tomcat files
sudo mkdir /var/opt/atlassian/jira-tomcat;
sudo mv /opt/atlassian/jira-4.0.1/work\
/var/opt/atlassian/jira-tomcat/;

sudo mv /opt/atlassian/jira-4.0.1/temp\
/var/opt/atlassian/jira-tomcat/;

sudo ln -s /var/opt/atlassian/jira-tomcat/work\
/opt/atlassian/jira-4.0.1/;

sudo ln -s /var/opt/atlassian/jira-tomcat/temp\
/opt/atlassian/jira-4.0.1/





Init script



Copy Atlassian's init.d script


Jira port


Follo Atlassian's port page.



Apache proxy



Using elements from my own tomcat+apache howto and Atlassian's Apache page