Blogging Roller

Dave Johnson on open web technologies, social software and Java

Above: a random selection of photos from my Flickr photo-stream.

Wednesday May 26, 2010

Maven 3.0: 50% to 400% speed improvement?

A drop-in replacement with 50% to 400% speed improvement? That sounds too good to be true.

Matt Raible: The main improvement in Maven 3 is speed. It's been performance tuned to be 50% to 400% faster. Benchmarks (guaranteed by integration tests) include better: Disk I/O, Network I/O, CPU and Memory. Another new feature is extensibility so Maven is a better library rather than just a command-line tool. Now there's a library and APIs that you can use to do the things that Maven does. Plexus has been replaced with Guice and it's now much easier to embed Maven (Polyglot Maven and Maven Shell are examples of this).

Apparently it is not entirely true, at least not yet (Maven 3.0 is still in beta). I tried switching to Maven 3 for the Roller 5 build and hit several build errors related to class-loading and JPA byte-code enhancement.

Tuesday Mar 23, 2010

Maven support in IDEs

Maven Logo

I've been switching around between the Eclipse, Netbeans and IntelliJ IDEs at home and at work. I've found that fiddling around with multiple IDE specific project configurations and launchers and class-paths is no fun at all. That's one of the reasons I got interested in Maven. Yes, Maven is a build-system but it's also a sort of IDE portability solution. Maven projects can be loaded right into all the major Java IDEs as you can see in the screenshots below. IDEs can find your sources, resources, dependencies and via the Maven Jetty plugin even run your Java webapps from the IDE -- things that are not possible if you're using a custom Ant build-script as we were doing before with Roller.

Here some screenshots that show the various Maven IDE plugins and their dependency graph feature.

Roller / Maven Eclipse 3.5 / M2Eclipse

Here's Roller loaded into Eclipse via the Maven M2 Eclipse plugin.

Roller / Maven Eclipse 3.5 / M2Eclipse

By the way, if you want detailed instructions for getting Roller 5 up and running in Eclipse with the Eclipse Web tooling, check-out Harald Wellman's helpful blog on the topic: Setting up Eclipse for Roller.

Roller / Maven in Netbeans 6.8

Here's Roller loaded into Netbeans as a Maven project.

Roller / Maven in Netbeans 6.8

Roller / Maven in IDEA IntelliJ 9.0

And here's Roller loaded into IDEA IntelliJ as a Maven project.

Roller / Maven in IDEA IntelliJ 9.0

I'm not sure which I prefer yet.

Friday Nov 21, 2008

Atom news: Apache Abdera graduates

Atom logo

Congratulations to the Apache Abdera team, who've just graduated to full Apache top level project status. The don't have the new site at abdera.apache.org up yet and they're still not quite at 1.0 yet, but this is a major milestone. They've got the best Atom format and protocol toolkit around, in my opinion.

via Garett and James.

Friday Aug 08, 2008

RESTful JSF in the works?

JSF spec lead Ed Burns just pointed out that some of my Sun-internal comments about JSF have made it outside the firewall and into an issue on the JSF specification project:

On Wed, 19 Mar 2008, David M Johnson said:

I think the goal should be to make JSF applications RESTful by default, with proper use of GET and POST, i.e. only use POST when application data is changing, not for component state. Another goal should be clean, book-markable URLs that only carry path-info and parameters needed by the application logic.

That's easy and the default situation with Rails, Grails, Struts, etc. How hard would it be to redesign JSF along those lines? Would it require EJB2 -> EJB3 level changes to JSF?

I suspect work on JSF 2.0 is too far along for this kind of change now, but it's nice to hear that the idea of a truly RESTful JSF is at least under consideration.

Wednesday May 07, 2008

Struts 2 in Action

stack of struts 2 books at the JavaOne bookstore

Struts 2 is my favorite Java web framework these days; it's REST-friendly, simple, easy to use, very flexible and the only thing it has with its creaky old Struts 1.x parent is the fact that it's an action framework rather than a component framework like JSF. As most of my readers probably already know, Struts 2 is based on WebWork/XWork the framework that powers JIRA and Confluence, two of the coolest Java webapps around.

Apparently, I'm not alone in this thinking -- I keep on running into folks at JavaOne who feel the same way. But unfortunately, Struts 2 docs are lacking, so I was very happy to see two new books on Struts 2 at the JavaOne bookstore. There's Struts 2 in Action, a rewrite of the classic Manning book, and Practical Apache Struts 2 Web 2.0 Projects from Apress.

I picked up a copy of Struts 2 in Action on Monday and it looks great so far, but I've only skimmed it. I'll let you know what I think once I dig-in on the flight home.

If you're at JavaOne, check out TS-5739 - Hands-on Struts2 by Ian Roughley (author of the Apress book) today at 10:50 AM in Esplanade 307/310.

Tuesday Apr 29, 2008

Social Software at JavaOne 2008

There are quite a number of Social Software related talks at JavaOne and CommunityOne this year. You can learn about everything from building Social Networks with the Liferay portal and federated relationships with OpenSSO to creating 3D virtual works and implementing OpenSocial with Java. And, I'll finally be able to talk about what I've been working on for the past couple of months -- more about that later. [Read More]

Thursday Feb 21, 2008

Social Software for Glassfish screencast

fish1 fish2 fish3

I mentioned the Social Software for Glassfish (SSG) EA2 release before the winter break, but I never got around to posting any details. Since then some documentation has appeared, Manveen Kaur blogged it, The Aquarium too and now screen-cast master Arun Gupta has created an excellent Social Software for Glassfish screencast that walks you through the features in this very early access release. Now I don't have to say nearly as much.

Monday Jan 28, 2008

Abdera AtomPub server refactoring

I've got to carve out some time ASAP to take a close look at this. The code is in Abdera SVN and there's 20-minute implementation guide (PDF) too:

James Snell: Dan Diephouse and I have been spending the last week refactoring the Abdera server framework with the goal of making is less complicated, easier, and generally better.

Wednesday Jan 23, 2008

Yahoo Weather RSS module for ROME


Apparently, I spoke to soon about ROME being in maintenance mode. There's an all-new Yahoo Weather module for ROME from Robert "kerbernet" Cooper.

Tuesday Jan 22, 2008

ROME vs. Abdera

For Java developers starting out with RSS and Atom, here are some notes to help you figure out the differences between the Java.net ROME and Apache Abdera (incubating) projects.

ROME is a set of Java tools for parsing, fetching and generating all forms of RSS and Atom feeds. The core ROME library is relatively small and depends only on the somewhat creaky old JDOM XML parser. Available separately are modules to support various feed extensions such as OpenSearch, iTunes, GeoRSS, etc. ROME was originally developed and open sourced by Sun Portal dev team members in 2004.

ROME Propono is a subproject of ROME that supports publishing/editing entries and files to blog servers and AtomPub servers. Propono is made up of three parts: 1) a Blog Client library can publish via either the old lagacy MetaWeblog API or the shiny new AtomPub protocol, 2) an AtomPub client that publishes only via AtomPub and 3) a framework for creating AtomPub servers. Propono was developed by Ramesh Mandava and Dave Johnson, based on code from RSS and Atom in Action and open sourced as part of the Sun Web Developer Pack in 2007.

Abdera is a set of Java tools for working with Atom feeds and AtomPub protocol. This includes a parser, writers, an AtomPub client and a framework for creating AtomPub servers. Abdera's Atom feed parser uses STAX, so it uses less memory and is faster than ROME. Abdera's Atom feed support is more comprehensive than ROME's and it supports signatures, encryption, Atom to JSON, extensions for Threading, Paging, GeoRSS, OpenSearch, GoogleLogin, etc. etc. Abdera was developed by IBM and contribued to Apache in 2006.

Now let's compare frameworks. The pros and cons of ROME are:

  • Pro: complete RSS support, all of the dozen various flavors
  • Pro: it's generally simple and small, depending only one jar (JDOM)
  • Pro: easy to understand and use the AtomPub server framework
  • Pro: MetaWeblog API support
  • Con: Atom feed support not as comprehensive as Abdera
  • Con: parser uses lots of memory, slower, JDOM based
  • Con: community not as active, seems to be in maintenance mode (See also Ohloh stats)

The pros and cons of Abdera are:

  • Pro: comprehensive Atom feed support, lots more Atom extensions
  • Pro: faster more efficient parser
  • Pro: In the Apache Incubator with active and growing community (See also Ohloh stats)
  • Con: lots of dependencies
  • Con: AtomPub server framework poorly documented, overly complex (rewrite coming soon)
  • Con: no RSS support (there is something in Abdera contrib, but it's incomplete).

There you have it. ROME and Abdera folks: think that's a fair comparison? Are you a ROME or Abdera user? How would you like to see these frameworks move forward?

Wednesday Jan 02, 2008

Holiday project: JMaki for Roller

JMaki seal Over the holidays I avoided doing anything directly related to my current set of work tasks. Sun went quiet, which helped, and I ignored the messages that piled-up in the Roller user and dev lists. It was so quiet that I had time for a fun little project: a JMaki plugin for Roller.

JMaki makes it easy to use JavaScript widgets (Dojo, Google, YUI, etc.) from PHP, JSP, JSF and now Roller. To use a widget, all you have to do is call a method or include a tag and JMaki takes care of including the right JavaScript files and generating the right HTML for you. That's not all JMaki does, there's also a pub/sub facility to make it easy to wire widgets together via events, there's a proxy for fetching remote resources common table and tree data models. The theme is cool widgets with ease-of-development and that's what I'd like to see in Roller. You can read more about the JMaki value proposition on the Why Use JMaki page.

Here's an example. Below is a Roller page template that uses two JavaScript widgest, the Dojo Clock and the YUI Data Table. All it takes is a single line of template code to include each widget, and one widget is dynamic i.e. the table is populated via an RSS feed.


    <html>
    <head><title>JMaki test page</title></head>
    <body>

        <h1>JMaki test: dojo.clock</h1>
        $jmaki.addWidget("dojo.clock")

        <h1>JMaki test: yahoo.dataTable</h1>
        $jmaki.addWidget("yahoo.dataTable", "/roller/xhp?id=rss","","")

    </body>
    </html>

And here's what that page looks like when displayed by Roller:

JMaki Plugin for Roller w/Dojo and YUI

I'll write more about the plugin once I install it on this site. If you want some details about how the plugin was developed, you can read the email that I sent to the JMaki dev list: JMaki for Roller issues and suggestions. It links to the Java source code for the plugin.

Wednesday Nov 28, 2007

PHP support in Netbeans

Hadn't heard about this one until today, but Netbeans 6.1 will have plugin support for creating, editing, deploying to Apache HTTPD, running and even debugging PHP projects. Check out the details and screenshots on the Phantom Reference blog.

Here's a sceenshot from the Netbeans Wiki page on PHP:

screenshot of PHP in NB editor

Groovy support back in Netbeans

After going missing in NB 5.5, Groovy support is back in Netbeans. Basic Groovy support with syntax coloring and support for running scripts from the IDE is available in plugin form (download page) for Netbeans 6.0 (starting with RC2), read about it on Geertjan's blog.

Here's what's coming after Netbeans 6.0, Groovy project support: screenshot of Groovy NB project types

After Netbeans 6.0, the story gets better. Geertjan writes that a brand new Groovy plugin will be available in the post-6.0 builds that adds support for three types of Groovy projects: applications, class libraries and Grails webapps.

Tuesday Oct 02, 2007

Blogapps 2.1 released

RSS and Atom in Action image The next releases that I'd like to announce are the Blogapps 2.1 Examples and the Blogapps 2.1 Server.

If you'd like to learn more about the Blogapps examples and server then read The Blogapps Project article at Java.net. Here's a quick summary:

The Blogapps project hosts a collection of useful RSS and Atom utilities and examples from RSS and Atom In Action by Dave Johnson. They're designed to be useful even if you haven't read the book and they're available under the Apache License 2.0 so you can use the code in your applications and you can modify and redistribute them as you wish.

What's changed since 2.0? The examples have been updated to include the latest version of ROME Propono, which means that most of them now support the final Atom protcol spec. The server has been updated to include Roller 4.0 RC5, which also includes Atom protocol support and JSPWiki 2.4. And of course, various bugs have been fixed. Here are the release files, installation instructions and release notes.

This blog entry was posted via Atom protocol and the MatisseBlogger blog-client, which you can see in the screen-shot below (which was also posted via Atom.

screenshot of MatisseBlogger

What's next? Not sure at this point, but I will do another Blogapps release once ROME 1.0 is released.

Thursday Aug 30, 2007

OpenJPA 1.0 released

Congratulations to the Apache OpenJPA team on making their first official release since graduation. I wish I'd paid closer attention to the OpenJPA mailing lists and tested the release candidates. Oh well. I'll download and test the final 1.0 release and maybe we can get it into Apache Roller 4.0 RC2.

Tuesday Aug 28, 2007

re: Java needs an overhaul

Tim Bray: Java still remains by far the largest development ecosystem, and the selection and quality of libraries put pretty well any other language’s to shame, and it’s really fucking fast, and has superb tooling, and we know how to run it securely, and it’s Open-Source. So, if you want to move the state of the art along, a smart idea would be to work with, not against, Java.

Finally, something I can agree with on the topic.

Monday Aug 06, 2007

APP interop event today and congrats to Atomic Joe Gregorio

I wasn't paying attention and this one snuck-up on me. Today at noon Pacific Time there will be an online Atom Publishing Protocol interop event. The location is IRC on the Freenode network in the #atom channel: irc://irc.freenode.net/atom.

I'm really glad I didn't miss this announcement because I spent much of the last two weekends updating the ROME Propono and Apache Roller 4.0 implementations to work with the final version of APP (draft #17). I've got both implementations online now and ready for interop.

And in kinda sorta related news, one of the founders of the Atom effort Joe Gregorio is leaving IBM and heading over to Google. Congratulations Joe! I hope this doesn't mean you'll be leaving the Triangle behind.

Wednesday Aug 01, 2007

Finally... "go to file" in Netbeans

I've been waiting years for this one. As Roumen Strobl points out, the Netbeans 6.0 nightly builds finally include a "go to file" feature, much like CTRL-SHIFT-R in Eclipse (but in Netbeans 6.0 it's CTRL-SHIFT-O).

I'm diggin' 6.0 and it's starting to look pretty stable in advance of beta1, which is coming out this month. Grab a nightly build and check it out. According to Tor on the Java Posse the nightly builds are likely to be more stable than the most recent M10 milestone release.

Monday Jul 09, 2007

Java already built-into iPhone h/w

So says ZDNet's Ed Burnette.
Ed Burnette: Shortly after the iPhone went on sale, hardware enthusiasts started tearing into them to see what made them tick. They found that the iPhone is using an ARM1176JZF-based processor, probably the Samsung S3C6400 that operates at 667MHz. This chip sports an embedded Java acceleration engine called Jazelle.
And in closing Ed writes:
Now, if Apple can just get over its anachronistic “Java is heavyweight� beliefs, then small, efficient, hardware-accelerated Java games and multimedia for your iPhone could be just a software upgrade away.
Maybe the iPhone won't suck for developers after all.

Tuesday Jul 03, 2007

Glassfish at UNC-Chapel Hill

Glassfish NC license tag

Via the Aquarium, there's a nice Java EE and Glassfish adoption story over in Chillboro:

Adam Constabaris: A fundamental question for us in building this application was whether to use Tomcat and "soup it up" by using Spring to add services Tomcat doesn't provide itself, or whether to use a full Java EE container. We could have made it work with the servlet container approach, since our application isn't heavily "enterprisey" and we were initially reluctant to pay the complexity price of EJBs. After looking at the Java EE 5 specification, though, we saw a lot of ways we could simplify and standardize things, such as using JSF 1.2 and coding to the Java Persistence API rather than using Hiberrnate APIs directly.

Hey! I know that guy. Hi Adam.

Is there a trend towards full app servers and away from plain old Tomcat? Is it because of strong open source Java EE offerings from Sun, JBoss and Apache? I don't know, but I sure hope so.