Subversion 1.6.x on Ubuntu 9.04

July 1st, 2009

As with the situation in an earlier post, the version of Subversion that is in the official Ubuntu repository is not the latest that is available elsewhere. The version that you currently get by installing Subversion on Ubuntu via apt-get is version 1.5, and 1.6 is out.

Fortunately, Anders Kaseorg has provided a deb package for Subversion 1.6 for Ubuntu 9.04 “Jaunty Jackelope” at https://launchpad.net/~anders-kaseorg/+archive/subversion-1.6

There are versions there for hardy and intrepid as well.

Happy versioning!

JavaOne 2009 Photos

June 30th, 2009

Here’s some pictures of the JavaOne 2009 conference at the Moscone Center in San Fransisco, CA.

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Ubuntu 9.04 Jaunty – Update Manager

June 9th, 2009

I’ve been using Ubuntu Jaunty for a few weeks now.
So far, I’ve been very happy with it, and there have been some great improvements – most notably for me, the boot time – I run it on two different laptops (work and home), so I go through the boot sequence at least once a day.

There is, however, one new “feature” in Jaunty that I find unhelpful, and apparently a lot of people agree.
The update manager behavior has been changed. Instead of just showing an icon in the system tray when updates are available, Jaunty actually starts up the update manage application. Apparently, the thinking is that the system tray tends to get a lot of junk in it, and people ignore the update icon. The Ubuntu dev team wanted to make sure that people apply updates in a timely fashion, and felt that actually starting the update manager would encourage people to do so. At least they have it pop up unfocused, and behind other active windows. However, I prefer the old behavior, and don’t ignore the update icon. I also feel that a gui application like this should never be started without the user initiating it. I can just see myself in front of a roomful of people, doing a demo, and having the update manager pop up on the projector. That would be very professional :-(

To regain the old behavior, execute the following command:

gconftool -s --type bool /apps/update-notifier/auto_launch false

Default (All-Java) Tomcat Faster Than Using Apache Portable Runtime?

June 8th, 2009

I got a request from a client for performance-tuning Tomcat.
Typically, I don’t really do a lot performance tuning for Tomcat – usually, I front it with Apache HTTPD, and spend most of my performance tuning efforts on the application, not the server.

I got thinking about it, though, and remembered that there is a “native” Connector for Tomcat, so I decided to do an informal benchmark to see how dramatic the difference is.

First, the caveats – the benchmark was extremely informal, and I did it on my laptop, which was the same machine that was running Tomcat.
Your mileage will certainly vary…

I set up a simple JMeter test to launch 100 concurrent threads against Tomcat’s examples/jsp/xml/xml.jsp page, with a ramp-up time of 1 second, and to loop 10 times. So, 1000 requests by 100 concurrent users.

This was done on Ubuntu 9.04 “Jaunty”, with Tomcat 6.0.20 and tomcat-tcnative-1.1.16 on a Dell Vostro 1500 with an Intel Centrino Duo 2.4GHz cpu  and 4Gb of memory. I ran each test several times, to make sure that the JSP was compiled, and that the server was “warmed up”.

To my great surprise, the default, all-Java Tomcat installation was faster than with the addition of the native code.
It may be that when both are fine-tuned, and under heavy real-world loads, the native code may scale better, but this does leave me wondering.

Here’s the results from JMeter (all times are in milliseconds):

Avg Median 90% Min Max
Java 2 1 6 6 47
Native 33 12 80 0 561

That looks like an order of magnitude difference to me.

This just goes to prove the wisdom of the advice to measure before optimizing.

JavaOne 2009 – Thur. 6/4

June 4th, 2009

This morning’s general session was the Microsoft keynote.
Microsoft and Sun made a pretty good attempt at trying to convince the crowd the the two companies are friendly competitors, and the interoperability is the highest goal for both. It looks like they may indeed be making inroads in the data center – SOAP interoperability (finally, after all of these years) for enterprise applications. I suppose that we should be grateful for this. I am, as far as this goes. I’ll really be convinced about MS’s interoperability when then stop “embracing and extending” standards, like ODF.

Alan Bateman from Sun and Carl Quinn from Netflix presented “Hacking the File System with JDK Release 7″
They presented a whole new NIO system that has been developed for JDK 7.
Some highlights:

  • A FileRef class that is a “dumb” reference to a file, that doesn’t know the file’s path
  • A Path class that subclasses FileRef, and provides the path and methods to inspect, compare, and minipulate it. One very cool thing is that Path implements Iterable, so that you can iterate through the pieces of the path.
  • FileSystem – represents the file system, and acts as a factory for other file system objects
  • FileStore – a single device in a FileSystem
  • FileSystemProvider – not generally seen by the developer, but allows custom file systems to be implemented
  • The “legacy” File class has been retrofitted with a toPath() method for interoperability
  • new SeekableByteChannel class
  • DirectoryStream – to iterate a directory’s contents, without having to load it all into memory first – great for very large directories and network-based file systems like NFS or Samba
  • Files utility class, with walkFileTree method – does depth-first traversal, with filtering capability
  • WatchService and FileChangeNotification classes – no more polling the file system to see if something changed.
    • Path implements Watchable
  • Advanced handling of file attributes (java.nio.file.attribute package)
    • different views, depending on underlying file system implementation, e.g. BasicView, PosixView, ACLView

Don Brown from Atlassian presented “OSGI on the Web: Here’s How”
His approach (one of several possible approaches) was to integrate the Felix OSGI container into his existing plug-in framework.
He did a quick demo, which was very impressive – adding new functionality to an existing open-source forum application.
A real plus is that Atlassian has open sourced the plug-in framework, so it could be pretty easy to do this with your own app. See http://atlassian.com/opensource

The afternoon general session was presented by IBM. They showed a video that was very impressive, and must’ve cost several times my yearly salary.
Then Craig Hayman, VP for WebSphere Software, presented IBM’s vision of a “Smarter Planet”. It was mostly a sales presentation for the IBM platform, but he did talk about all of the work that IBM has done on Apache Harmony. Great project, among other things, it forms the basis of the OS for the Android phone. By the way, you can purchase a “CloudBurst Appliance” from IBM for only $45K to manage your own internal “elastic cloud” :-)

I attended a few other sessions today, but nothing particularly worth blogging about.

JavaOne is almost done. It’s been fun and informative, but frankly, I’m ready to get back home.

JavaOne 2009 – Wed. 6/3 – Afternoon

June 4th, 2009

On Wednesday afternoon, I attended the session, “Creating Compelling User Experiences”, by Ben Galbraith from Mozilla.
It was a very interesting session, with lots of quotes from user interface luminaries. My favorite was a quote from usability expert Louis C. K. – “Everything’s amazing, and nobody’s happy”.

My take-aways were:

  • Good back-end software is necessary, but not sufficient – if your software has amazing capabilites, but the users hate the interface, they probably won’t use it.
  • When thinking about user interface, break it into to categories – visual design and interaction design. Again, if your ui looks great, but is inconvenient to use, people won’t use it. If it’s easy to use, but ugly, you may also drive people away.
  • Users expect to be able to customize your software, but will be overwhelmed by too many choices, and probably will be overwhelmed even by a relatively small set of simple choices if they are layered. Much better is a choice like “Vanilla, Chocolate, or Strawberry?”. Advanced users will want more, and you should give it to them, but not force it on the majority who don’t. Provide reasonable defaults.
  • Only end-users can truly personalize your software – hence the success of GreaseMonkey, etc.

The “Maximizing Java Performance on Multicore Platforms” session was presented by Kingsum Chen, a Principal Engineer for Intel, and David Dagastine, Java Performance Lead for Sun.

While there was a little bit of discussion about multicore Java performance in general (it boiled down to “break your workload up into as many threads as your hardware/os can handle”), most of the discussion was about Sun and Intel have worked together to do extensive optimization of the JVM specifically for Intel’s new Xeon 5500.

Apparently, the work has paid off handsomely – this Sun/Intel collaboration claims an eight-fold increase in benchmark throughput in the last three years. They have also worked very hard to make Java on 64-bit architectures at least as fast as on 32-bit (and sometimes faster). Some of the optimizations include memory addressing, garbage collection, array copying, string cache, and XML transformations (they claim a 3x throughput on XML transformations).

Assuming a server with dual-Xeon 5500s running 64-bit Solaris, Linux, or Windows, the general performance recommendations include:

  • Use JVM 1.6 update 14
  • Turn on JVM optimizations (some are on by default w/ Solaris):
    • -XX:+UnlockExperimentalVMOptions
    • -XX:UseG1C
    • -XX+UseCompressedOops
  • Leverage plentiful hardware threads
  • Minimize writes to shared data
  • Run 1 JVM – optimizations don’t currently work across JVMs (they’re working on this, though)
  • Choose your garbage collector appropriately (new parallel gc now default on all platforms).
  • Use large pages ( -XX:+UseLargePages) – works by default in Solaris, may take some system-level configuration on other operating systems – can give 5% – 15% improvement.
  • Use NUMA if available (-XX:+UseNUMA)

Recommended tools included Visual VM, Lint for Java, JDump, and Intel’s VTune.
VTune was demonstrated, and was very impressive.

At dinner time, Adobe threw a party at a bar / restaurant around the corner from the conference.
It was an extremely short demo, followed by an Open Bar, free food, and about a dozen pool tables.
Happy campers all the way around.

In the evening our own (Chariot’s) Aaron Mulder led the “Birds Of a Feather” (BoF) session on Open Source tools for SOA.
It was an interesting discussion, with lots of real-world examples, and a good bit of audience interaction.

Items covered included XML mapping tools like CXF and Jersey, Messaging infrastructure including ActiveMQ and JBoss Messaging, “Re-usable Integration Logic” projects including Apache Camel and Spring Integration, and full-on ESB products like Mule, ServiceMix, OpenESB, and JBoss ESB.

The major take-aways here were:

  • You can often get away with messaging and xml mapping, or one of the integration projects, without going to a full ESB.
  • Integration projects often work out with open-source tools, but sometimes wind up moving to commercial vendors.
  • Those who do go the full-ESB route with open-source tools rarely need to go to commercial vendors.
  • SOA governance is mostly a political / organizational problem, not a technical problem. Solve the organizational problem first, then pick a tool that meets your needs. There is no magic bullet.

JavaOne 2009 – Wed, 6/3 – Morning

June 3rd, 2009

First, an observation – today, I decided to stop lugging my laptop around, and left it at the hotel – I’m fully dependent on the SunRay terminals today – the wireless connectivity left a lot to be desired yesterday, anyway
I’m sure that the virtualization network is under maximum load right now, lunchtime at the peak of the conference. I tried several times, but could not find a free Ubuntu instance in the virtualization pool, so opted for Windows 7 – of course, one was available immediately. So, not surprisingly, this group apparently prefers Linux to Windows (or was there just a smaller pool of Ubuntu instances?) Also, interestingly, OpenSolaris wasn’t even a choice on the menu today…hmmmm….

This morning, I skipped the general session – it looked like it was going to be a big ad for a wireless provider, and that was confirmed by several people that talked to who did attend, and wished that they had also skipped it.

I attended two sessions:

“Getting Serious About Build Automation: Using Maven in the Real World” was presented by John ferguson Smart from Wakaleo Consulting, in New Zealand.
The session was very well attended, and very informative.
John talked about advanced dependency management techniques, POM inheritance and refactoring, multi-module projects, and other “advanced” techniques.
He also showed Eclipse’s very nice Maven support through the use of the m2eclipse plugin, and demonsrated the use of the maven release plugin.
John finished up with a discussion of deployment automation based on maven and nexus.
Check out John’s blog at weblogs.java.net/blog/johnsmart/

Oh, and by the way, Windows 7 locked up on me while I was editing that link, and had to be rebooted – did I mention that I despise Windows? Thank goodness that WordPress auto-saves drafts, and I didn’t lose anything.

The second session that I attended was “Ajax Performance Tuning and Best Practices” by Doris Chen from Sun and Greg Murray from NetFlix (and formerly Sun).
There was too much good information to list here, but most of the best practices have been implemented (by Greg) in an open-source project named “ProtoRabbit”. All I can say is, it looks like an excellent tool – check out http://wiki.github.com/gmurray/protorabbit

JavaOne 2009 – Tues, 6/2 – Afternoon

June 2nd, 2009

I attended two sessions this afternoon.

The first was “State of the Open Web”, by Mark Pilgrim and Patrick Chanelon from Google.
Mark and Patrick discussed an impressive array of new features in HTML5 (canvas, video, and audio tags, offline apps, and client-side databases), the latest and upcoming JavaScript versions (real class semantics, with interfaces, packages, getters, setters, closures, built-in JSON parsing, JQuery-like DOM selectors, and Worker Threads, to name a few), CSS (generated content, transforms, animation, etc.), and vector graphics.

I’m sure that it was not what they intended, but my take-away from this session was that while all of this shiny new stuff looks great on the surface, browser support for it will continue to be spotty for the foreseeable future, and comprehensive client environments like Flash and JavaFX are looking pretty good in comparison. Oh wait…maybe that is what they intended :-)

The second session that I attended was Rod Johnson’s presentation on Spring 3.0
The room was large, and it was packed with eager Spring developers.

There was a lot of content presented, but the overview is that with version 3.0, Spring has been completely reworked with respect to annotations, and the recommended best-practice is to use as little xml-based configuration as you can get away with. For many applications, this may be almost zero.

Spring MVC now has first-class support for RESTful interfaces, but does not conform to JSR311 – if you want that, you can use another project, like Jersey, with Spring.

Spring now has a Flex integration project. Very interesting. I actually started working with it last week. Should be interesting to see how it pans out.

Finally, Rod talked about Roo, SpringSource’s new round-tripping code generator.
Roo approximately fills the space of the scaffolding generators in environments like Rails, Grails, Django, and friends.
What is really interesting about Roo, though, is that unlike those other environments, Roo round-trips – you can edit the generated code, and then still use Roo to modify it.  I’ve heard this claim several times before from code generators, and it’s always been a disaster. I was wondering how Roo approached the problem.

I went down to the SpringSource booth, and asked for a demo.
My question was answered. Roo can round-trip because in addition to generating Java stubs, it generates all of the real scaffolding bits as AspectJ artifacts. When you edit the generated Java code, the AspectJ artifacts remain untouched, so Roo does not get confused – it just re-inspects the Java code, and updates the AspectJ code as necessary. I’m told that as a final step, you can, if you wish, have Roo push all of the scaffolding into your Java code, and remove the AspectJ artifacts. Of course, at that point, you wouldn’t be able to round-trip any more.

Roo is integrated with SpringSource’s Spring Tool Suite (which is now free), and the integration is very slick. However, since I’m an AspectJ user, I asked for a demo of the command-line tool. It’s very reminiscent of Rails, Grails, and friends, but has context-sensitive tab-completion and more context-sensitive help than I remember seeing in the other environments.

The other really nice thing about Roo is that it generates a Maven POM. Nice touch!

JavaOne 2009 – Tues, 6/2 – Morning

June 2nd, 2009

This morning started off with the opening general session, entitled “Java – Change (Y)our World”.
Considering the current uncertain times for Java, Sun did what they needed to do at the start of JavaOne – they showed the strength and reach of Java, showed that it has a strong future, and showed that Oracle will not only support Java, but will strengthen it, and increase investment in it.

A number of heavyweights were brought out on stage, including senior folks from EBay, RIM, Sony Pictures, Verizon, and Intel, as well as, of course, James Gosling, Nandini Ramani (Dir. of Engineering for JavaFX), and, finally, Scott McNealy.

There were two main themes:
1. Java is in a strong position, will continue to grow, and will be heartily supported by Oracle.
2. JavaFX.

Number one is good to hear. I think that all of us (Java Developers) needed to hear it, even though we knew what they were going to say.

I personally have mixed feelings about number two. Sun seems to be betting a large part of the farm on JavaFX. I haven’t taken a serious look at JavaFX yet (I will soon), but that’s because I have so far considered it “yet another” user interface – Java’s attempt to play “me too” in an environment that already has Flash, Ajax, and other contenders.
Today’s demos hint that JavaFX may be more than just another “me too” technology. Time will tell.

James Gosling’s pet project, the Java App Store looks interesting too – it should be interesting to see if it gets any traction. I spoke with one of the Sun folks at the booth, and he assured me that even though the big push is for JavaFX, non-FX Java apps will be deployable to the store as well.

Mark Gerhard, CEO of Jagex, makers of the popular RuneScape (all Java) game was given a Duke’s Choice Award, as was Randy Bryant, Dean of CS at Carnegie Mellon University, for the Alice project, which teaches programming through Java.

There was, of course, Tee Shirt Tossing from the stage (no, I didn’t catch one), and at the end, Larry Ellison was presented with a gift from Scott McNealy – a set of marine signal flags that spell out “Java”, for him to use on his boat “The Rising Sun”.

This of course, is just an overview – you can see a video of the presentation at http://java.sun.com/javaone/2009/general_sessions.jsp

I attended the morning session on HADOOP, which was very interesting, and have been wandering the Pavillion (think “tradeshow floor”), checking out the exhibitors, and gathering more tee-shirts than anyone could possible wear.

JavaOne 2009 – Monday, 6/1

June 1st, 2009

I just arrived at JavaOne 2009, in San Fransisco, CA.
Got here pretty much just in time to register before the registration desk closes for the evening. Things really get started tomorrow.

My first impression upon arrival was, “wow – this is really big” (yes, this is my first JavaOne – can you tell?)

Registration was interesting – Sun obviously spent a boatload of money setting up registration – and in my case at least, it didn’t work properly. I entered my email address when asked, and was presented with “invalid registration!”. I scanned the barcode on my registration confirmation – again, “invalid registration!”. The helpful folks at the registration desk took care of it though, and I’m in.

My subsequent interactions with the conference’s technology have gone better – The “JavaCard” (I’m guessing that it’s a Java-based smart-card) worked flawlessly at the swag pickup desk.

Then, I found the bank of computers for checking email, etc.
They’re SunRay 270 thin clients, and upon inserting my JavaCard, I was presented with options for Ubuntu, Windows, or OpenSolaris desktops. There’s a big pool of these running on VirtualBox. Interesting! I’m writing this blog post from the Ubuntu desktop – I feel right at home! Read more at http://wikis.sun.com/display/DesktopVirtualization/Sun+VDI+for+JavaOne