Geertjan's Blog

  • May 8, 2007

JavaOne Day One

Geertjan Wielenga
Product Manager
Woke up tired and groggy in the wee hours. Jetlag and hangover are not a good sleep's best friend. Watched some movies on the hotel TV. Some are really excellent. By now I must've caught up with most of the better movies produced over the past year. I highly recommend Breach, Man of the Year, and The Number 23, though the latter was slightly freaky. Over the past few days I 've seen many other movies on the hotel TV, with thanks to my buddy jetlag, but can't remember the others off hand, so they must have been average. At some point, I fell asleep again, waking up several hours later, part way into the Sun Technical Session, which I would've arrived at in the final few minutes, so didn't bother. Received an e-mail in bed, telling me that the OpenJDK announcement had been made, so pushed the NetBeans Tutorial live as agreed. Finally made my way to the conference center and hung out in beanbag land, catching a few minutes of Rich Green with a mobile phone in his hand.

US Department of Agriculture

Then met with NetBeans evangelist Ashwin Rao and Olaf, who is from the US Department of Agriculture (USDA). His team has developed on top of the NetBeans Platform since 3.6. The application looks really awesome, making full use of as much of the IDE as possible. The application is called "Object Modeling System" and is written for scientists for the analysis of wind, water, and erosion models. Initially the USDA had their own framework that did something similar to the NetBeans Platform, but maintaining it became too much work. I'm going to be meeting with Olaf again and probably doing a technical interview with him soon. That will be published on http://www.netbeans.org soon thereafter. I'm hoping for lots of tips and tricks from him and some pretty screenshots!

Packaging Applications for Ubuntu

Then I went over to "TS-7361: Packaging a Java Application with Ubuntu". On the way, I bumped into Mark Harman, who is building an application on top of the JFugue API, just as I am doing. I'd invited him to join Dave Koelle, myself, and other music-related programmers this evening for dinner. Got to the presentation, not extremely crowded, but then packaging Java applications for Ubuntu is a pretty narrow topic. Jeff Bailey provided a conceptual overview and then Harpeet Singh explained how things went when he packaged Glassfish for Ubuntu. His part of the talk was really practical and I noted down pretty much most of what he said, after he finished talking at some length about Glassfish and all its components. So, here's what you need to do if you want to package a Java application with Ubuntu.

  1. Decide on the number of packages you will provide for your application. For example, if you have platform-specific binaries, they go in their own separate packages. It is also good to subcomponentize, so that the end user can be very selective and only choose those packages that are really needed. For example, in the Glassfish context, JAXB is a separate package because some might want to use JAXB without using the rest of Glassfish. Harpeet explained that Glassfish was collapsed from 18 parts to 4 packages: messaging queue, derby (people should be able to work off JDK5, which doesn't bundle Derby), some system-specific Glassfish utility, and then the entire Glassfish itself.

  2. Figure out licensing, which is especially tricky if you have multiple subcomponents. Often one doesn't have a choice, but when one does, the legal issues might be complex. For example, JAX-WS has its own license. So, in the case of Glassfish, they needed to deal with licensing issues for each of the 18 parts.

  3. Identify the Ubuntu component to which you want to deliver. For example, "multiverse".

  4. List your dependencies. For example, JDK 5.

  5. Package everything up. This is the technical bit I came to the session for. I learned the following:

    • Use system tool dh_make. This creates default Debian files like controls, rules, changelogs.

    • Use debuild from the devscripts package.

    • Modify the rules file to write build rules.

    • Modify control file to define runtime dependencies for your packages.

    • Modify prerm and preinst to add preinstallation scripts.

    • Modify postrm and postinst to add postinatallation scripts.

    Quotable quote from Harpeet: "What I like is that the user downloads and installs, without needing to do any configuration. And the application starts up by default." This means that his preinstallation script ensures, among other things, that when Glassfish is installed, its 'domains' are created. (These are Glassfish-specific folders with user-specific content.) When you uninstall, you probably don't want to purge the domain, hence, this kind of requirement goes in the postinstalltion removal script. Then Harpeet showed a series of files, which were pretty interesting. He showed a control file and a rules file, to show what they look like. They seemed pretty readable to me.

  6. Sign your packages, upload packages to the Ubuntu server, using a tool called dput. For information on this part of the process, see http://revu.tauware.de/. Then you receive feedback from Ubuntu folks, make the requested changes, upload again, get more review comments, upload again, etc., until everything is stable and of a sufficient quality for distribution via the Synaptic Package Manager.

After that useful walk through of everything required, it was back to Jeff Bailey, who ended with a "Lessons Learned" section. The lessons learned reflected what Harpeet had already said, such as that you need to make sure to get your licensing issues sorted out at an early stage. The whole session's key "take home" message was that packaging is non-trivial but worth it. Why is it the right thing? Because it means you're doing the right thing for your users and you're widening the audience for your software architecture. When the technical session was over, I talked a while with Trung, who was there as well. Talked about packaging, but more about Groovy and Grails, in which we're both interested, in terms of tooling support for NetBeans IDE.


Next I had agreed to meet with Toni at the java.net booth in the Pavillion. He had told me he was going to do a presentation there on his https://jarvis.dev.java.net/ project. It turned out that the java.net people have a whole program of short "mini talks". They're really excellent, half an hour each, which is much more bite-size than the hour long BOFs and technical sessions. As luck would have it, I arrived half an hour early, just as RIFE creator Geert Bevin was setting up for his presentation, which happened to be right before Toni's. So I enjoyed a very cool presentation on continuations. He is excellent when he compares continuations to "Save Game" in video games. Basically, to paraphrase him, don't you want to save the game right before you try to slay the dragon? And what specifically do you want to save? The location and your possessions, not the whole game. You also want to be able to reload the game at that particular point where you saved it. The game is the application, the save game is a continuation, the progress within the game is the location in the program, and possessions such as potions and swords represent the state of the application. Transferring this analogy to a web application, you don't want to save everything, you want to capture the progress of one particular person, with the state of the action, but the server is unchanged and stays running. One captures from where the function starts, not the entire application, which is known as a partial continuation. All very interesting.

Afterwards I showed Geert the Rich Client Programming book. He seemed interested in working through the chapter on web frameworks, so he'd be able to create a plugin for RIFE for NetBeans IDE. That would be great. I've been planning to do something similar, but haven't had the time recently.

Jasper Report Visual Designer

Toni very enthusiastically presented Jarvis to the world. He explained everything about it, such as the fact that it is based on the Visual Library API, the XML MultiView API, and the Jasper Report JARs. He was extremely positive about the Visual Library API, saying that even if the audience was not interested in his visual designer, they should definitely give the Visual Library API a look. To me, Toni's work on Jarvis is the best external non-company based NetBeans development work I've seen. And it came totally from himself (and one or two others in Munich) without prompting by anyone from Sun or NetBeans. The coolest part is that his visual designer for Jasper Reports can be integrated into any application based on the NetBeans Platform. So, it isn't only relevant for NetBeans IDE, but for other applications too. In fact, someone had asked him whether this was possible, and wanted to actually go ahead and do that. That is pretty cool and further evidence of the pluggability of NetBeans modules. One very cool feature he showed was the ability to drag an image from outside the IDE, i.e., an image in his filesystem, and drop it within his report. One can also drag a table from the Runtime window and drop it into a report. He said he wanted to make the visual designer increasingly component-based, so that the drag and drop items will increasingly focus less on fields, but more on tables and higher-level items like that.


Other things that happened or that I did today:

  • Gave a book to Kirk Pepperdine from TheServerSide.com, so that he can review it. He was really positive about getting it and impressed by its general look and feel. I'm looking forward to his review, which he said could be posted in a variety of places, beyound TheServerSide.com.

  • Signed up for a mini-talk at the java.net booth. It is scheduled for 11.30 tomorrow, goes on to 12.00 and will introduce you to the JFugue Music NotePad. It will kind of be a warm up for my part of the technical session on Thursday at 10.55.

  • Met Greg Doench from Prentice and arranged a book signing. It will take place at the bookstore on Thursday, from 10.30 to 11.00, right after Tim and Jarda's TS-3742: Modular Programming with the NetBeans Platform

I also attended the JMaki technical session to see Greg Murray in action, as well as Ludo and Craig McClanahan. It was interesting to see. It was cool when I talked to Ludo afterwards, when he told me that I was "committer number 3" in the JMaki world (i.e., the first after Greg and Ludo), for some spontaneous documentation that I wrote for the JMaki project page, this time last year.

And right now, the final part of today, I'm in the OpenJDK session, listening to Mark Reinhold talk about the current status of the OpenJDK project. Read a really good blog entry by Dave Bristor, called Working on OpenJDK using NetBeans on the OpenJDK project in relation to NetBeans IDE. Building the OpenJDK sources under Solaris, is described in an interesting blog entry here. I like the idea of Sun wanting to build a community around the JDK. Looking forward to writing lots of little (and not so little) tutorials around the OpenJDK in the coming period.

I don't think I'll be attending any more technical sessions or BOFs today, because I'm going out to dinner with Dave Koelle, from JFugue, and several other music-related programmers right after this session. It's been a good if slightly hectic day, but very educational with lots of opportunities to follow up on.

Cool moment of the day. Wow, Mark Reinhold has just said some very nice praiseworthy things, in the middle of his technical session, about the Getting Started with OpenJDK in NetBeans IDE tutorial! What a nice way to end today's JavaOne report.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.