Thursday Apr 02, 2015

MVC 1.0 (JSR 371) Early Draft Review period has started!

MVC 1.0 (JSR 371) formally known as the 'Model-View-Controller Specification' has just entered the Early Draft Review period. This is significant because it is the first Java EE 8 specification to enter this phase. Kudos to the JSR 371 Expert Group! JSR 371 is ‘just’ a piece of the Java EE 8 story but this step shows that, slowly but surely, Java EE 8 is starting to take shape.

You are strongly encouraged to review the early draft of the specification, test it using Ozark, the open source JSR 371 Reference Implementation and obviously provide comments and feedback!

The MVC specification is really easy to grasp for anybody familiar with JAX-RS, the samples bundled with Ozark will also help to understand the specification. You can also check Ozark's sources and the presentation I gave a few days ago at JavaLand. 

To test the first Ozark milestone build, you need a recent GlassFish build (post 4.1 build, see here for details). Another and simple solution to test JSR 371 and Ozark is to use this script to create a Docker image with GF, Ozark and the JSR 371 samples pre-deployed.

The Early Draft Review period will end of April 30th. For specification related feedback, you can use the JSR 371 users mailing list or the JSR 371 issue tracker. For Ozark related feedback, please use the Ozark users mailing list or the Ozark issue tracker.

So what do you think of JSR 371? Also, should we use this Docker based approach to help you test other upcoming Java EE 8 specifications?

Wednesday Apr 01, 2015

Java EE @ ConFoo Canada 2015

ConFoo 2015 took place 16-20 February in Montreal, Canada. To my knowledge it is the largest developer conference north of the border. The conference has roots in PHP, but has been making an effort to better attract a Java audience hence it was important for me to support the conference. If you are a Canadian Java developer, I would consider adding ConFoo to your radar as a more convenient (and possibly cheaper) event to go to in order to stay up-to-date. Thanks to a number of community speakers such as Ryan Cuprak, Hanneli Tavante and Rodrigo Candido da Silva the Java EE presence was very strong this year. There were Java EE centric talks on JAX-RS, OAuth, cloud, Java EE 7 and Java EE 8.

I personally delivered two sessions on JMS 2 and testing Java EE applications with Arquillian in addition to a couple of lighting talks on Java EE 8/Adopt-a-JSR as well as Domain-Driven Design (DDD)/Cargo Tracker. More details on the sessions and ConFoo, including slide decks, videos and code, posted on my personal blog.

Tuesday Mar 31, 2015

Java EE @ Devoxx France

Devoxx France will take place next week in Paris. And this year, the most popular French Java conference is moving to a newer (and larger) venue: Palais des Congrés!

The overall conference agenda is impressive but Java EE is obviously well covered (see the overview below). Personally, I will co-host with Roberto Cortez a session and a Hands-on lab on the Batch API (JSR 352).  I also have another regular conference session where I will talk about Java EE 8. Last but not least, I will also participate in the Java EE BoF with Antoine Sabot-Durand, Antonio Goncalves and Emmanuel Bernard.

Finally, I will also host a (late!) BoF around one of my hobby: Home Automation and Java. Despite this, this BoF is clearly not about Java EE. The idea is to gather interested people and have informal discussions around anything related to Home Automation and Java (KNX, Z-Wave, Nest, etc.). 

Monday Mar 30, 2015

Free JPA 2.1 Cheat Sheet by Thorben Janssen

Cheat sheets can be very handy while quickly referring to a technology one uses on a daily basis, although they can be tough to read (and write!) if the technology is very extensive like JPA. Fortunately, the changes in JPA 2.1 are definitely small enough to fit on a cheat sheet. Note, just because the amount of changes are small definitely does not mean they are not important. In fact, most of the changes in JPA 2.1 have generated a good deal of interest in the community and are already proving to be well received. Very fortunately for us, Thorben Janssen has gone through the effort of putting together a 100% free cheat sheet on the changes in JPA 2.1. You can download it from his related excellent blog entry aptly titled JPA 2.1 - 12 Features Every Developer Should Know.

If you look around Thorben's blog you'll find that he is trying his best to craft it to be a valuable resource to the community, including a weekly Java newsletter. If you find the JPA 2.1 cheat sheet to be useful, please do spread the word and consider dropping a brief note of appreciation for Thorben's hard work.

Friday Mar 27, 2015

JavaOne CFP is Open - Your Invitation to Submit to the Java EE Track

It's that special time of the year again - the JavaOne 2015 call for papers is now officially open!

JavaOne will be held October 25 - October 29 in San Francisco. You can read about the details and submit here (at the time of writing the site has some minor inconsistencies that is being fixed as we speak - generally you can trust the accuracy of the information in this post when in doubt). This year I have the privilege to lead the Java EE track again along with veteran track lead Lance Andersen. My colleagues Bruno Borges and David Delabassee will also be playing key roles in the Java EE track.

Please do consider this a personal invitation from me to submit your best ideas to one of the most prestigious gatherings of the minds for server-side Java. If you have any questions, never hesitate to get in touch. If your submission was not accepted the previous years please consider this encouragement to try to improve it and submit again.

Consider the following as inspiration for submissions to the Java EE track (the only real limits of course are your own imagination on anything in the Java EE ecosystem):

  • Existing and upcoming Java EE technology JSRs and implementations
  • Cool stuff that extends Java EE in new and interesting ways
  • Case studies using Java EE 5, Java EE 6 or Java EE 7 (including migration from other technologies)
  • Best practices and design patterns for using Java EE technologies
  • Emerging trends closely relevant to the Java EE ecosystem such as HTTP 2, microservices, reactive and the like
  • Insightful research, development and analysis work in server-side Java

Note that topics like IaaS, PaaS, SaaS, elasticity, multitenancy, NoSQL, Big Data, DevOps and the like should go on the cloud track instead of the Java EE track. Do make an honest effort in applying your judgement on which track to submit on. Either way, it's not a deal breaker if you don't get it exactly right - we will figure it out for you if all else fails :-).

The CFP is closed April 29, so please do start thinking about what you want to submit very soon (note that's a very short time frame - just about a month from now). That being said do take your time - quality always matters!

Thursday Mar 26, 2015

New book: "Web Development with Java and JSF"

During JavaLand, I had the pleasure to meet Michael Müller. Michael is well known in the German Java sphere as he wrote numerous articles for various IT medias. In addition, Michael is an avid JSF user and a JSF EG member.

Michael is currently writing a book titled "Web Development with Java and JSF". Since Michael is a passionate JSF user, JSF is obviously an important topic in his book. But this is not another book about JSF only. Michael's goal is to cover Web Application development at large. That means that different but related topics are also discussed through his book. There are for examples sections on JPA, Bean Validation, Responsive Design, ... Michael also plan to touch on subject such as Web Application testing with Selenium, etc.

Michael has decided to use “a more fair” publishing approach where the book has 2 prices: a minimum and a suggested price. Based on that, the potential buyer is free to decide how much he wants to pay. This approach gives the buyer the ability to decide how much s/he think the book is really worth but this also gives the author more financial rewards as there is no intermediary between the publisher and the author.

A great deal of the book has already been written (+240 pages) but Michael is planning to add extra content.  You can read a sample here. "Web Development with Java and JSF" is available in the usual eBook formats (PDF, Mobi, ePub) and once you've bought it, you are entitled to get the updated versions for free.

Wednesday Mar 25, 2015

Forge Powered Java EE Rapid Application Development Comes to NetBeans!

Forge has been a great tool for Rapid Application Development (RAD) with Java EE (for sake of nostalgia it is basically the descendant of the awesome seam-gen tool of the Java EE 5 era). As powerful as Forge is, one of it's drawbacks had been that it is very heavily command-line driven with many commands and sub-commands to learn. As a result it can be initially unnatural for the Average Joe, very IDE centric Java developer to pick up.

A novel solution to this paradigm mismatch that the Forge team adopted is to integrate Forge into IDEs like Eclipse. I am very happy to report that such integration has finally arrived in NetBeans, perhaps making it truly accessible to the core Java EE community. Indeed the Forge NetBeans integration works out very nicely - you access Forge commands through NetBeans quick search, the otherwise CLI driven commands are rendered dynamically as regular NetBeans wizards and the commands take effect seamlessly within NetBeans including generating code and running the project. In this case, a video really is worth a thousand words (if you are having trouble viewing the embedded video below it is available here). In addition to demonstrating Forge in NetBeans the video is really a great reflection of the kind of productivity you can achieve with Java EE today.

The Forge NetBeans plugin can be installed directly from within NetBeans by using the Plugin Portal Update Center (Tools -> Plugins). You can also download it manually from the NetBeans Plugin Portal.

If you are new to Forge, the Forge site has excellent documentation for getting started including a great self-paced, self-directed hands-on lab. Enjoy - Forge really can make web development fun again and NetBeans + Forge is a truly powerful combination that's hard to beat :-).

Tuesday Mar 24, 2015

JMS 2.0 Revision A

The JMS 2.0 errata has passed the JCP executive committee ballot approval! This simple maintenance release was necessary to correct a few errors in the original JMS 2.0 specification. And now that ‘JMS 2.0 Revision A’ is done and approved, the focus is shifting towards the next version of the JMS specification, i.e. JMS 2.1.

Resources :

Monday Mar 23, 2015

Java EE 8/Adopt-a-JSR Updates: Morocco JUG!

It is truly heartwarming to see Adopt-a-JSR moving forward! Although it is still the early days a number of JUGs worldwide have already adopted Java EE 8 JSRs. The Morocco JUG had been at the forefront of Adopt-a-JSR from the very start. In fact the JUG was awarded as an "Outstanding Adopt-a-JSR Participant" for their contributions to Java EE 7. It should be no surprise the JUG is committed to helping Java EE 8 move forward through Adopt-a-JSR as well. In JUG leader Badr El Houari's own words - "Our goal is helping to shape the best Java enterprise platform ever!".

With that ambitious goal in mind the Morocco JUG started their year with a meeting on Adopt-a-JSR and Java EE 8. Held at the IBM Innovation Center in Casablanca the meeting was a full house with over ninety developers participating. Badr explained the Adopt-a-JSR program to JUG members and shared what JSRs he was hoping to support:

  • CDI 2
  • MVC
  • JMS 2.1
  • JSF 2.3
  • JAX-RS 2.1
  • JSON-B

Details on the meeting are blogged on the Morocco JUG website. The Morocco JUG also has a very helpful guide for JUG members that would like to start contributing to Java EE 8 JSRs right now.

We are sure to see great things from the Morocco JUG on Adopt-a-JSR and Java EE 8. Is your JUG adopting a Java EE 8 JSR yet :-)?

Wednesday Mar 18, 2015

Java EE Management API 2.0 (JSR 373) Spins Up

As most of you know the initial wave of Java EE 8 JSRs have been underway for a little while now, including the platform JSR itself, CDI 2, JSON-B, JMS 2.1, Servlet 4, JAX-RS 2.1, MVC and JSF 2.3. Three more Java EE 8 JSRs have been more recent additions - Java EE Security, JSON-P 1.1 and Java EE Management 2. The Java EE Management API 2 (JSR 373) had been the last of these to truly spin up and I am happy to report that it too has now gone fully into high gear under the leadership of specification lead Martin Mares. Though the initial expert group has already formed, you should still feel free to join as an expert if you want - just go to the JSR page linked above to nominate yourself.

Although it does not seem to get as much press thus far, this JSR is actually potentially one of the most interesting and useful parts of Java EE 8. For those familiar, it is essentially a modernization of the very dated "J2EE Management" (JSR 77) API. The intention of the old API was to allow for managing all kinds of resources on an application server - JMS resources, JDBC resources, JCA resources, JavaMail resources, drivers, deployment artifacts, EJBs, Servlets, servers, domains and so on. For various reasons the JSR saw limited success - some have argued that the API was overly complex, abstract and cumbersome. It certainly seems dated today as it is largely centered on EJB remote interfaces.

The new management API is a great chance to take a fresh look at the problem domain using an updated tool-set. Unlike JSR 77, the new API will make use of REST, SSE and potentially WebSocket. For those familiar with the popular GlassFish REST management interface, we can reasonably expect to see something similar. From an industry standpoint, this means being able to work with all Java EE 8 application servers using a uniform, predictable cross-platform API from all kinds of tools from simple HTTP command-line clients to Chef and Puppet, whether on the cloud or on premise. Though not strictly part of JSR 77, the new management API is also slated to handle deploying artifacts instead of simply managing/monitoring them, which is also extremely useful (for the curious, this was the domain of another very dated relatively obscure API -  "J2EE Deployment" or JSR 88).

Note that you can always participate in a JSR without officially being part of the expert group by simply subscribing to the JSR user alias. In case of Java EE Management API 2.0 that alias is users at javaee-mgmt dot java dot net - go to the Java EE Management API 2.0 java.net project page to subscribe. Also remember that you can always contribute on an even more lightweight format through Adopt-a-JSR.

Tuesday Mar 17, 2015

Java EE Container Lifecycle

Java EE defines different component/container models with their own well-defined lifecycle.  Understanding the lifecycle of those different component/container might sometime be useful. Having some visibility on component lifecycle is also useful with applications that use different types of components (e.g. Servlet and EJB) and needless to stay that this is the most common uses case. Finally, it is not just about visibility. Having the ability to also trigger certain actions based on the state of a particular component/container is also sometime required (e.g. perform some specific initialisation).

So when it comes to monitoring and managing Java EE applications, Application Servers tends to provide some custom hooks to achieve that, i.e. observe internal state (e.g. state of a particular container) and trigger management actions based on events such as a state change. Obviously, this is Application Server dependent. For example, GlassFish has Life Cycle Modules/Listeners while WebLogic has, amongst different options, WLDF Watches. So overall, this type of capability (and theirs implantations) varies greatly and is Application Server dependent.

But some of the Java EE Java APIs also provide hooks that can be used to determine in which state an actual component/container is. In terms of granularity, this approach might be a bit more limited but it has the advantage of being Application Server agnostic since it is based on standardised APIs. I recently came across 2 articles that are discussing that particular topic:

On a related matter, the discussions over the upcoming 'Java EE Management API 2.0' (JSR 373) will also be interesting to track.

Monday Mar 16, 2015

Migrating a JSF Application from Spring to Java EE 7/CDI

One of the most important things to do at this stage of the life-cycle of Java EE is highlight successful adoption stories. We have been doing just that for a long time through our adoption stories blog as well as JavaOne. JavaOne 2014 was particularly good in this regard and JavaOne 2015 looks to be even better. Indeed we hope the folks with great adoption stories that submitted last year but did not get accepted will resubmit next year. We will continue to highlight some of those sessions from JavaOne 2014 in the next few months. In this vein I'd like to highlight a very interesting real world story of migrating a JSF based web application from Spring to Java EE 7 and CDI shared by Mario-Leander Reimer of QAware.

Mario's division is a small German based project consulting practice. He was tasked by a major German auto manufacturer to undertake this migration effort (it won't take most Germans much effort to figure out who this auto manufacturer might be since Mario shares that they are based in Munich). The reasons cited for the migration include streamlining/simplifying company-wide application architecture, reducing framework explosion/dependencies, standardization and reducing cost. In just about a month Mario was able to successfully migrate over the application that made extensive long-term use of Spring to CDI and Java EE 7! Mario also made use of great CDI ecosystem tools such as DeltaSpike and Arquillian (both projects have been Duke's Choice award winners, DeltaSpike being the more recent recipient). He also used PrimeFaces with JSF.

During his talk Mario highlighted his journey in learning CDI/Java EE 7 (he was previously a heavy Spring user), the parts of CDI and Java EE he really came to appreciate as well as the challenges he faced and successfully overcame. His talk highlights the ever careful balance struck between feature bloat and simplicity in a Java EE standard like CDI as well as the power of the CDI portable extensions API when you really need to break out of what CDI provides out-of-the-box. You can see Mario's awesome JavaOne 2014 presentation below (if you are having trouble seeing the embedded video it is available here).

If you have a similarly great Java EE adoption story to share, please do drop us a note (particularly migration stories from other technologies). In the spirit of Java EE centric vendor neutrality, what Java EE implementation or tool set you choose does not matter at all and neither does which part of the globe you are in.

Friday Mar 13, 2015

Java EE 7 Hands-on-Lab Updated for You to Use!

The official Java EE 7 Hands-on-Lab is an excellent learning resource. It was initiated by my former colleague Arun Gupta (now at Red Hat). The lab starts with some skeleton code (that's mostly Java EE 5 and Java EE 6) and through a series of well-written step-by-step instructions adds a select set of Java EE 7 features to create a fairly cohesive sample web application. The instructions do a reasonable job of explaining the context and motivation for the features being added. Although it touches upon a tiny subset of what was added in Java EE 7, in my experience the lab takes about six to eight hours to complete. In the end attendees get a real sense of how developing with Java EE and Java EE 7 actually feels like and learn a few Java EE 7 features.

I just finished successfully delivering the lab once again at DevNexus 2015 (trip report coming soon). In preparation for DevNexus and beyond I made a few updates/changes:

  • I tried to make the lab entirely self-directed and self-paced for attendees by removing as many possible stumbling blocks (however minor) as possible. My goal was to make the lab as easy to go through and as standalone as possible.
  • I updated the lab to use GlassFish 4.1 and NetBeans 8.0.2. This resulted in a small number of minor code changes.
  • I polished up the code to make it as realistic as possible within the scope of a simple lab.

The first bullet point above is what I would really like to bring your attention to. Every time I have run this lab I've tried to execute it such that it requires bare minimum or no involvement from me and in fact I believe I've succeeded in doing just that. The reason this really matters is that I think this lab material has much greater potential than just something else our team does at conferences. I believe that the lab is now in a state such that anyone can go through the lab entirely on their own, by just using the public HOL page linked. More importantly I think it is possible with very little effort for someone to lead the lab in their user group or company. I highly encourage you to do so if you have an interest in supporting the Java EE community. If needed, our team could provide any help that you may need (such as being present virtually or working with you one-on-one to get you prepared). I've supplied all the resources that you should need on the public HOL page.

Do drop me a note if you have any feedback on this, if there's anything that I can improve with the lab or if you need any help.

Thursday Mar 12, 2015

Templating in the MVC JSR

One of the underlying requirements of the JSR 371 was to not re-invent any VDL (View Declaration/Definition Language) because the Java EE Platform already provides that capability in 2 different forms, i.e. JSP and Facelets. In addition, the templating solution space is already very mature (and very crowded too!), it would be a complete waste to re-invent anything around that!

So instead of spending energy in re-inventing the (template) wheel, it makes more sense to spend energy in allowing to cleaning use, from the MVC API, the existing templating solutions provided by the platform: JSP & Facelets (see the javax.mvc.engine.ViewEngine interface). 

One additional benefit of that approach is that the MVC API is not limited to just JSP and Facelets. It will also be possible to cherry pick and easily plug-in your preferred templating solution to any MVC JSR implementation.

Next to JSP and Facelets, Ozark (JSR 371 Reference Implementation) already support some additional templating solutions: FreeMarkerVelocityMustacheHandlebars and soon Thymeleaf. Some of those were contributed by Rodrigo Turini and Rahman Usta.

Do you see any templating solution missing?

If so, it's probably just one contribution away!

Disclamier: it's early days, expect things to evolve!

Tuesday Mar 10, 2015

Java EE Security API (JSR 375) Update

It took a bit longer than expected but the JSR 375 Expert Group is now formed! The EG is led by Alex Kosowski (Oracle) and is composed of the following members (companies representatives and individuals) : 

Adam Bien David Blevins (Tomitribe)
Rudy De Busscher Ivar Grimstad
Les Hazlewood (Stormpath, Inc.) Will Hopkins (Oracle)
Werner Keil Matt Konda (Jemurai)
Darran Lofthouse (RedHat) Jean-Louis Monteiro (Tomitribe)
Pedro Igor Silva (RedHat) Arjan Tijms (ZEEF) 

At that at this stage, IBM’s participation is not yet confirmed but this should be, hopefully, resolved quickly.

Now that the EG is formed, the technical discussions can take place. So make sure to watch the discussions as they happen over the JSR 375 user mailing list. The JSR 375 Issue Tracker is also a good resource to keep track of.

It is also worth to mention that this topic will be discussed during the upcoming weeks in 2 conferences. David Blevins and Jean-Louis Monteiro, both from Tomitribe and both EG members will present “Java EE Security: Let's Make Something Useful” during JavaLand (Germany).  In addition, Alex Kosowski (JSR 375 Spec Lead) will give, at Devoxx France, a session on JSR 375. So if you happen to attend one of those conferences, make sure to add those sessions to your schedule.