Thoughts on the Jigsaw debacle

July 20, 2012 § 8 Comments

Disclaimer: this is a personal piece of opinion and in absolutely no way does it necessarily reflect the views of my current employer. I have spent 13 years at Sun/Oracle (5 of which in the GlassFish team which had a modularity experience of its own) and I still care very much about the future of Java. I now work at Google.

Runtime modularity in Java has been promised since JSR 277 was filed in 2005 and I wrote how excited I was about its potential back then. Seven (7!) years, a fair amount of OSGi lobbying and politics, Sun’s acquisition, and a plan B promise later, we’ve come to this day to learn that it’ll be pushed further out to 2015 which really means 2016 for a stable release and probably 2020 for a wide adoption. After being promised Java 8 with Jigsaw in late 2012 by Oracle, we’re now taking another 3-year hit because the project missed “the train”.

About resources and goals
Jigsaw has been Mark Reinhold’s baby project for all this time (Mark is the Chief Architect of Java) and I’m now hearing excuses about staffing issues. “Oracle failed to staff Java modularity effort for years”. Hey, now that’s a much better headline! The reality I believe is that Oracle still doesn’t know why it’s doing Jigsaw and thus giving it the proper priority is hard. Modularize the JRE itself to help with JavaME and JavaFX adoption? Offer a modules system for Java’s longer-term viability? A business case can certainly be put together to shrink down the JRE to get Oracle upper management on board. On the other hand, bringing the JVM, the compiler, and the language together around a modules system seems, sadly, to be falling off of Oracle’s radar.

About that train
The common wisdom is that the Eclipse way of shipping software is the best way to get a community of developers building on a platform. You’ve probably also heard of “release early release often”. Eclipse is a very special project which is really about providing a baseline for the Foundation members to build upon and I’d argue that Eclipse IDE users on the other side are not benefiting much from this release model. When it comes to Java, we’re talking about something that also has a diverse audience and I think developers remain far more important than vendors and that a cadenced release model is actually harmful. It’s easy to agree on shipping software when it’s fully baked but the two-year cycle is really the key issue here. Oracle should be able to declare Jigsaw a strategic goal and deliver it with an extra 6 to 12 months (which, by the way, would still mean 2+ years from now!).

About the community
Jigsaw has been presented for many many years by Sun and later Oracle as a key feature in numerous keynotes and conferences and promised in Java 7, Java 8 (in fact I’ve done my share of such promotion while at Oracle) and now Java 9. That has created a lot of expectations in the community. In fact, it’s not only about Java SE as a large portion of the Java ecosystem is also waiting for a standard modularity solution: JavaME, Java EE (see this sample IBM reaction when modularity had to be removed from EE 7), Groovy and other JVM languages and probably by many developers building non-trivial applications with Java. Surely there’s got to be a better way to convey bad news to the community than “sorry, we’ve missed the train!”. In retrospect, the plan A/plan B approach was a brilliant communication plan with Plan A really not being an option and the community rallying behind Plan B. It’s often about how things are conveyed, not only about what they convey.

About open source
I hear some say that this would not have happened if Java was truly open source with a community, not a company, overlooking its destiny. First, my definition of Open Source remains. IP and governance are (ideally) orthogonal to the license and no simple solution exists for all software projects. But more importantly, this is a sad case of a project’s failed risk mitigation (sadly a very common failure in our industry). To consider that a different governance model would have changed anything is wishful thinking. Innovative carefully crafted designs always come from a very small number of talented engineers and in fact, this may even be a case where going open source and transparent was not a good idea but rather a fatal distraction.

About what’s next
As I wrote above, Oracle has the resources to declare Jigsaw a strategic goal. I can agree that it may be hard to deliver by late 2013 but waiting for 2016 is effectively killing Jigsaw and encouraging everyone to look at alternatives which will jeopardize yet even more Jigsaw’s chances of ever seeing the light of day. In fact, even Oracle is considering profiles in Java 8, an ugly band-aid if you ask me. One you’ll need to painfully tear off to get proper modularity in the platform. Jigsaw really shouldn’t be seen as “a new feature”, to me it’s really the Java reboot some people have been calling for a long time. Only a compatible one.

Now of course this is all my personal take and I don’t pretend to know what’s good for Java nor represent the community at large. So getting some hard data about what the community expects from Jigsaw would be a good start before making any decision. I believe this has not been done so far. The closest I’ve seen is the recent JAXenter poll which isn’t very scientific (self-selected, somewhat biased questions).

So in the end, if the community wants Java 8 with its updated and stripped-down content (Lambda, maybe JSR 310, what else?) in 2013, Oracle and the JCP should deliver just that. Again, it’s about meeting expectations. But shipping a Java 8.5 with Jigsaw sooner than later should also be considered. And if there really needs to be a train release model, it has to be a yearly one and not every release needs to be a major one.

In a world where standing still is perceived as fossilization, bringing proper modularity to Java is what moving Java forward ™ is really about.

Next trip – Québec!

January 1, 2012 Comments Off

My first ever work-related trip to Canada will be to Quebec this coming January 11th to deliver a presentation (in French) on Java EE.

This is an Oracle event around Java where I’ll be a speaker together with my colleague Mike Keith.

Here are the details if you are interested in attending this free event :
Oracle Canadian Java Briefing (English)
Séance d’information sur Java (French)

Taking Mission Control 4.1 for a quick spin

December 13, 2011 § 3 Comments


As Henrik, Marcus, and Markus posted yesterday, JRockit Mission Control 4.1 (download) is out and it has two interesting features I wanted to try out: early support for HotSpot and a Mac OS version.

The best (the only?) way to test both of these features without installing the JRockit JVM itself is to install Mission Control as an Eclipse (3.7) plugin using its update center.



Once you switch to the Mission Control perspective, locally running JVMs (Apple’s latest 1.6 JVM, the JDK 7 Developer Preview or OpenJDK) are all detected with “General”, “MBeans” and “Runtime” sections very much functional. It’s still early days with the Flight Recorder and Memory Leak Detector features not yet available.

Looking at a JVM running GlassFish 3.1.1, the application server AMX’s are available once you initiate a bootAMX operation.



JAVA Developer Day, développez avec Java EE 6 et GlassFish

October 25, 2011 § 5 Comments

Evénement gratuit Java EE et GlassFish la semaine prochaine chez Oracle France :

“Comment exploiter tout le potentiel de Java EE 6 et de GlassFish ? Pour cela, Oracle vous invite à un atelier pratique inédit qui vous permettra de découvrir Java EE 6 et développer avec GlassFish.”

jeudi 3 novembre 2010 de 9h30 à 16h30.
Oracle France – 15, boulevard du Général de Gaule 92715 Colombes

Au programme: présentation et labs (venir avec son portable).
Inscriptions en ligne (places limitées).

How to build a successful Java User Group (JUG)

October 19, 2011 § 3 Comments

JUG’s are an increasingly important part of the larger Java community (see recent JCP elections) and yet only a fraction of Java developers attend regular meetings (as we found out at JavaOne).

Before I start I probably should say that while I don’t have hard data to back this up, I’ve seen a large number of JUG’s be created in the past 2-3 years, more than 10 years after Java was first introduced, accounting for maybe as much as half of today’s active JUGs. In France alone, there is more than a dozen active JUGs that were created, all in the last 3-4 years. There doesn’t seem to be a shortage of interest for Java, quite the opposite.

I don’t run a JUG nor am I really active in one but I’ve been visiting many of them in the past few years (they tend to be the format that I like best), I’ve seen a good number of them take off, some crash, and I interact with several JUG leaders on a regular basis, so I thought I’d share the ingredients that I believe are key to a successful JUG.

First, you need to have a venue. It may sound obvious but the lack of a regular (hopefully free-of-charge) room for your meetings is often the reason for JUG activity going down or simply disappearing. Universities seems to be the best solution after company meeting rooms.

Second, you need sponsors. While this can cover for Pizza & Beer (or Wine & Cheese, you decide), maybe more importantly this should help you cover for your speakers expenses (travel + hotel). While those speakers employed by large companies should be able to expense their entire travel, you don’t want to miss out on the independent consultants. Another option is to have formal JUG members paying a yearly fee. This works well once you have a well established set of events, including maybe a yearly (international) conference.

Third, last, and not least – you need good content. This is content that addresses your JUG’s interests and it doesn’t have to be always about bleeding edge technology of the latest and greatest JVM language. Some folks take JUG’s as a training, others mostly as a get-together, and probably also a good chunk as a way to stay on top of what’s new in the Java ecosystem. You need to balance different topics but my recommendation would be to have a small set of folks decide on the agenda. Voting or large groups of folks deciding don’t usually work too well.

While all of the above probably applies for any technology user group, JUG’s are a bit special because they are loosely federated by mailing lists and interactions are facilitated by Sun initially and now by Oracle. If you are starting a JUG, you probably want to read about it on this all-in-one page, be listed on java-user-groups and start chatting with fellow JUG leaders, they are a great bunch and will most certainly have tips for you.

I should of course not forget to mention that you’ll need energy and passion to keep a JUG running. Lot’s of it!

October trips and a new JUG

October 17, 2011 Comments Off

JavaOne was good this year but that was just the beginning of traveling for my month of October.

I’m just back from a very well-attended inaugural session at the Lava JUG (in Clermont Ferrand, France) covering Java 7 (together with Julien) and some JavaOne 2011 news. The event had 120+ participants. So pictures here. It’s always great to hear about new JUGs popping up close to 15 years after the creation of Java (more on JUGs in a future entry).

This coming week, I’ll be in Romania:
Cluj Napoca on Wednesday 19th, 2011 in the Golden Tulip Hotel. Send email to register.
Bucharest on the next day: Thursday 20th, 2011 in the Intercontinental. See event page for details.

The week after (October 27th), I’m participating in fOSSa in Lyon, France. This is, as the name implies, an Free/Libre open source software conference and I’m happy to see that Serli’s Jerome Petit is also listed as a speaker to discuss the benefits he see for his company in their numerous open source contributions (GlassFish and others). Let this talk enlighten many others!

Java EE 6 does Java 7 with GlassFish 3.1.1, the making-of

August 24, 2011 § 5 Comments

I recently posted a screencast showing how a simple JavaEE 6 web application can take advantage of Java 7′s new language features (aka project coin). Here are more details on the code for the three Java 7 new language features shown. The full code is available here.

The first Project Coin feature shown (Java 7 refactorings start at 7:37 into the screencast) is Strings in switch statements. This is rather straightforward (a number of folks thought this was already supported) and if probably a good candidate to use with web frameworks which take user input as Strings.


String name = request.getParameter("name");
if ("duke".equals(name)) {
    vip = true;
    name = name.toUpperCase(); // let's visually recognize DUKE
} else if ("sparky".equals(name)) {
    vip = true;         // another VIP
}

becomes :


String name = request.getParameter("name");
switch (name) {
    case "duke":
        vip = true;
        name = name.toUpperCase(); // let's visually recognize DUKE
        break;
    case "sparky":
        vip = true;         // another VIP
        break;
}

Of course you can also have a default: section equivalent to an else statement.

The second feature is try-with-resources and is shown here in the initializing sequence of a stateless EJB. It uses JDBC to ping a well-known system table. The code specifically relies on the fact that multiple classes in JDBC 4.1 (Connection, Statement and ResultSet) now implement the new Java 7 java.lang.AutoCloseable interface. This is what allows for the following code requiring proper closing of resources :


@PostConstruct
public void pingDB(){
    try {
        Connection c = ds.getConnection();
        Statement stmt = c.createStatement();

        ResultSet rs = stmt.executeQuery("SELECT * from SYS.SYSTABLES");
        while (rs.next()) {
            System.out.println("***** SYSTEM TABLES" + rs.getString("TABLENAME"));
        }
        stmt.close();
        c.close();

    } catch (SQLException ex) {
        ex.printStackTrace();
    }
}

… to be rewritten as follows (resources initialized in a single statement, no closing required as the compiler takes care of it when they go out of scope) :


@PostConstruct
public void pingDB() {
    try (Connection c = ds.getConnection(); Statement stmt = c.createStatement()) {
        ResultSet rs = stmt.executeQuery("SELECT * from SYS.SYSTABLES");
        while (rs.next()) {
            System.out.println("***** SYSTEM TABLES" + rs.getString("TABLENAME"));
        }
    } catch (SQLException ex) {
        ex.printStackTrace();
    }
}

As you can see in the source code, the DataSource is actually created using a @DataSourceDefinition annotation which is a new feature in Java EE 6.

The third and final part of the demonstration uses a somewhat convoluted piece of JPA code to illustrate the multi-catch feature. For the purpose of the demo, the JPA query (also in the above EJB) uses a LockModeType.PESSIMISTIC_WRITE (new in JPA 2.0) when building the JP-QL query and adds two catch blocs for PessimisticLockException and LockTimeoutException :


try {
    List customers = em.createNamedQuery("findAllCustomersWithName")
        .setParameter("custName", name)
        .setLockMode(LockModeType.PESSIMISTIC_WRITE)
        .getResultList();
    if (customers.isEmpty()) {
        doesExist = false;
        Customer c = new Customer();
        c.setName(name);
        em.persist(c);
    } else {
        doesExist = true;
    } catch (final PessimisticLockException ple) {
        System.out.println("Something lock-related went wrong: " + ple.getMessage());
    } catch (final LockTimeoutException lte) {
        System.out.println("Something lock-related went wrong: " + lte.getMessage());
    }

}

Which can be refactored to this equivalent code using multi-catch :


try {
    List customers = em.createNamedQuery("findAllCustomersWithName")
        .setParameter("custName", name)
        .setLockMode(LockModeType.PESSIMISTIC_WRITE)
        .getResultList();
    if (customers.isEmpty()) {
        doesExist = false;
        Customer c = new Customer();
        c.setName(name);
        em.persist(c);
    } else {
        doesExist = true;
    } catch (final PessimisticLockException | LockTimeoutException ple) {
        System.out.println("Something lock-related went wrong: " + ple.getMessage());
    }


}

This new language feature is *very* useful for reflection or java.io File manipulation, not quite the most common Java EE code out there.

Of course all of the above only works with JDK 7 at runtime and if running NetBeans 7.0.1 you’ll also need to set the source level to Java 7 for the quick fixes to light up. I’ve also successfully executed this under Mac OS X using the OpenJDK Mac OS binary port.

Some resources :

Full Source code.
Screencast showing this “in action”.
String in switch statements.
try-with-resources.
Multi-catch and precise rethrow.

Video: Java EE 6 does Java 7 (with GlassFish 3.1.1)

July 28, 2011 Comments Off

Java 7 is here! and so is GlassFish 3.1.1! Get them while they’re hot!

New Java versions can sometimes take a bit of time before they’re adopted because:
a/ your IDE doesn’t support the new version and associated language constructs
b/ you’re a server-side developer and it’ll be a while before your application server supports that new version of the JDK
Well, with Java 7, things are different with the quasi-simultaneous releases of JDK 7, NetBeans 7.0.1 (coming up very soon) and GlassFish 3.1.1! Here’s a new screencast on the GlassFish Youtube Channel showing Java EE 6 development taking advantage of the project Coin features and running on GlassFish 3.1.1 and Java 7 :

Lancement Java 7 au LyonJUG ce jeudi

July 18, 2011 Comments Off

Julien Ponge et moi-même serons à Lyon pour la soirée Java 7 du LyonJUG. En attendant, voici un entretient croisé réalisé par Agnès Crépet et Cédric Exbrayat sur Java 7 et autres sujets connexes et posté sur le site Duchess France.

Rendez-vous Jeudi 19h, à l’INSA de Lyon!

Brno Oracle Java Developer Event – Success!

May 30, 2011 Comments Off

I spent last Thursday in Brno to deliver a number of Java EE talks and a keynote at the Oracle Developer Java Conference. It was great because it had a good developer feel and was similar in spirit to other community-driven conferences that I recently attended. Maybe the best part was the attendance – well over 400 (excluding Oracle employees and speakers) which is great for a first time.

Dalibor Topic fought the ash cloud and managed to reach Brno to kick off the day with a Java keynote with updates on Java 7 and current thinking about Java 8 and beyond. Doug Clarke, Java Persistence Director of Product Management at Oracle was here to cover advanced JPA features as well as recent evolution in EclipseLink with a nice multi-tenancy demo (I understand there’s a screencast coming soon). I took this opportunity to interview Doug on EclipseLink. The recording will soon be up on the GlassFish Podcast.

And of course, last but not least, the Prague web services engineering team was strongly represented and covering JAX-RS and Jersey. Given how the last session overran by more than half an hour I’d say this was a successful and engaging presentation. Both Marek (JAX-RS co-spec lead) and Jakub (Jersey lead) blogged about the event and shared code demo.

That’s a pretty poor photo there that I have but I’m hoping to see better ones given the presence of a profesional photographer (doing a keynote and three sessions I sure felt like a rockstar with photos of me taken at each of them…).

Where Am I?

You are currently browsing entries tagged with java at Bistro! 2.0.

Follow

Get every new post delivered to your Inbox.