Wednesday Apr 30, 2014

4,000 posts later : The Aquarium

This is a special post! Today, we will really not talk about Java EE 7, HTML 5 or any recent conference. Today's post is devoted to this blog, The Aquarium, as this post marks an important milestone in its life, i.e. this is the 4,000th TA post (*)! 4,000 might be a lot but if you count in vigesimal (base 20), that's only A00. So everything is relative!

The Aquarium was launched in December 2005. You can still see the the first post here. So The Aquarium, or TA as we internally called it, was launched more than 3,000 days ago, 3066 days ago to be precise. That is 8 years, 4 months and 23 days ago! So it is a good opportunity to look back as a lot of things has changed since then...

To put things in perspective, in December 2005 we were still using J2EE 1.4 and Java SE 5! Java SE 6 was launched a year later in December 2006 while Java EE 5 was finalised in May of the same year. At the same time, the first release of GlassFish was released.  2006 also marks the open-sourcing of Java. So clearly, 2006 was a pivotal year!

A lot of things have changed since then... At that time, we were talking about J2EE. We went trough important evolutions as we evolved from EJB 2.1 (J2EE 1.4) to the now easy to use EJB 3.x components model. Back in those days, we didn't had at our disposal technologies such as JPA, CDI, JAX-RS, WebSocket, Bean Validation, etc. It was another era! Since then, a lot of water went under the bridge! In all those years, Java EE has unarguably evolved towards a leaner, more robust, easier to use enterprise platform. Java EE 7 has been finalised mid of last year while Java SE 8 has been launched a few weeks ago. In parallel, the work on Java EE 8 and Java SE 9 has already been started.

A lot of things have changed since then... The first release of GlassFish was released in 2006 as the Java EE 5 Reference Implementation. 7 years later, GlassFish 4.0 was released as the Java EE 7 Reference Implementation. The thing that has not changed in all those years is the fact that GlassFish, the Java EE Reference Implementation was, is and will remain Open Source!

A lot of things have changed since then... but despite that, there are still a few people that are using Java SE 5 and there are still a few people referring to the platform as J2EE! :(

A lot of things have changed since then... the Java eco-system has evolved too. A JavaOne T-Shirt is a good way to look at some of those evolutions in that space.

A JavaOne T-Shirt - Circa 2004-2005 

A lot of things have changed since then... In 2005, it was embarrassing to put JavaScript on a CV. JavaScript on a CV is now a 'must-have'.

A lot of things have changed since then... The Java EE Platform is now more popular than ever. Over those years, The Aquarium has grown to become an information hub for the Java EE Community. One thing hasn't changed, it is the spirit. There is team working behind The Aquarium, it is really a team effort. And you, the community reading The Aquarium is really our reward! So on behalf of all the people involved in The Aquarium over all those years, thanks a lot! It's because of you that The Aquarium is what it is today. Without you and your continued support, the work behind TA would be useless and irrelevant.

And to reach even more community members, we continue to expand the channels for the Java EE platform : Twitter, Facebook and Google+.

Tuesday Apr 29, 2014

Java EE 7 Tutorial Updated

One of the best resources for learning Java EE is the official Java EE 7 Tutorial. Besides being fairly comprehensive and well-written it is 100% free and online.

You may or may not be aware of this but the tutorial is actually also actively updated from time to time. The tutorials team finished just such as update recently. The update mainly consists of a non-trivial number of small fixes including to the chapter on EL 3. You should also look forward to the printed version of the tutorial being available soon!

For details of the update, feel free to check out the recent post on the tutorials blog.

Monday Apr 28, 2014

GlassFish 4 on the Raspberry Pi

For those that remember the very early days of Java, the language was conceived with embedded systems in mind (anyone still remember the concept of Java powered toasters?). While as far fetched as that seemed at the time the emerging field of the Internet of Things (IoT) and Machine-to-Machine (M2M) communication is promising to finally make that dream a reality. It may or may not also surprise you that Java EE has a key part to play in this area as you need many of the Java EE services in order to use embedded devices effectively. Fortunately modern Java EE application servers like GlassFish can run well on very small embedded platforms like the Raspberry Pi (if you still live in the "J2EE era" this probably also seems like science fiction).

Oracle's own Mark Heckler has a very well written and maintained blog post on how to do this almost from scratch. If you are an IoT and GlassFish enthusiast it is an excellent resource worth checking out.

Friday Apr 25, 2014

The JavaOne Java EE Track: Thanks, a Sneak Peek and an Invitation

As you know the JavaOne CFP is now closed. I want to take this opportunity to thank all of those that submitted their thoughtful topics and all those who considered submitting. We had the highest number of JavaOne CFP submissions in the recent few years. This is a testament to your passion for the Java community and it is a great start on the road to keeping JavaOne a true success.

In terms of the Java EE track we now have all the raw material we need to construct a strong selection. In the next few weeks we will be working hard with the review committee to carefully sort through all the submissions we have at hand. You should begin to hear back as to decisions on your submissions around early Summer.

I want to remind you now not to be discouraged if you don't get the response you are hoping for. You should remember that you are competing against some of the best and brightest of Java at a global scale - especially so in the Java EE track. As much as we would like for things to be perfect in the end all of this is also based on all too fallible human judgement applied through a fairly intricate process designed with checks, balances and fairness in mind. If your session does not get accepted this year, you should definitely consider honing your submissions and trying again next year. If you are indeed selected I hope you see it as the testament to your abilities and good fortune it truly is. Either way, I hope you will consider coming to JavaOne to experience the incredible talent, energy and intellect in the air.

Invited Speakers/A Sneak Peek
One of the things we are doing differently for JavaOne this year is that we have a small number of well-deserved invited speakers. Besides helping us put together some early content this is a great way to give credit to some of the folks in the community. The following are the folks we have the honor to invite to the Java EE track this year with a bit of a sneak peak about what they will be talking about (as some of you know we have also invited a small number of folks personally to submit via the normal CFP process in addition to these super stars):

Adam Bien needs little introduction. He has been a key Java EE advocate, author, JCP expert and Java Champion for a long time. His passion for Java EE, knowledge as a consultant and skill as a presenter have few parallels. Adam will be talking about just how lightweight Java EE application design can be and other topics.

David Blevins also needs few introductions. He is an excellent speaker, a long-time JCP expert, Java EE advocate and powerhouse developer behind the highly innovative Apache OpenEJB and TomEE projects. David just recently founded Tomitribe, a company offering commercial support for TomEE. David will be talking about exactly why Java EE is a game changer developers should be enthusiastic about and other topics.

Patrycja Wegrzynowicz is the founder and CTO of her own company, a strong technical mind, a JavaOne veteran and a regular speaker at many conferences worldwide. Just some of her interests include patterns/anti-patterns, security, persistence and performance tuning. Patrycja will be sharing her insight on performance tuning techniques for complex JPA 2.1 domain models and other topics. We anticipate her talk would be interesting and valuable to many of you.

Arun Gupta is the former "GlassFish Guy", prolific Java EE advocate, author and blogger. He now enjoys a well-deserved and coveted role as the head of developer advocacy at Red Hat. A great deal of the current success of the Java EE and GlassFish communities can be attributed to Arun's tireless hard work, boundless energy and infectious enthusiasm. We are very honored to have Arun talk about some lessons learned from real world Java EE 7 deployments and other topics.

Anatole Tresch is a key engineer at Credit Suisse and one of the few brave souls with enough initiative to lead JCP JSRs despite not working for a major technology vendor. We are very proud to invite Anatole to talk about the Java EE configuration effort that he is currently helping launch. He definitely deserves the support of the Java EE community and has much to offer in terms of insight on Java EE and the JCP. We look forward to seeing him at JavaOne.

Keep in mind that JavaOne is now already open for registration. There are definitely some advantages to registering early. JavaOne Content Chair Stephen Chin outlines the reasons in an excellent recent blog post.

I hope to see you all at JavaOne. In the meanwhile as always if you have any questions never hesitate to reach out.

Thursday Apr 24, 2014

Reminder : Virtual Developer Days - Java 2014

The first occurrence of the Java Virtual Developer Day for 2014 will take place in less than 2 weeks! So if you plan to attend, it is time to register!
Not only you will have a chance to learn about the latest evolutions in the Java space, i.e. Java EE 7, Java SE 8 and Java Embedded. You will also have the opportunity to interact and ask questions to various experts.  And the best part is that VDD are free to attend so do not miss this opportunity!

To cope with the different Time Zones, the VDD will be run 3 times :
  • May 6th : 9:00 a.m. - 1:00 p.m. PDT / 12:00 p.m. - 4:00 p.m. EDT / 1:00 p.m. – 5:00 p.m. BRT
  • May 14th : 9:00 AM  - 1:00 PM BST/  10:00 AM  - 2:00 PM CEST / 12:00 Noon - 4:00 PM GST /  12:00 Noon - 4:00 PM MSK 
  • May 21st : 8:30 AM - 12:30 PM IST  / 11:00 AM  - 2:30 PM SGT / 1:00 PM  - 4:30 PM AEDT 
The complete agenda and the registration details can be found here.

Wednesday Apr 23, 2014

Webcast: Migrating from GlassFish to WebLogic


As previously announced, WebLogic Server is where Oracle is focusing it's commercial support efforts, supporting the increased delivery of bug fixes, new features, and Java EE 7 APIs.  Which is something our customers are keen to experience.

We will continue to invest in GlassFish as the reference implementation for the Java EE platform, which will continue to be a good option for users to deploy their applications using an open source product.  We will continue to develop and release the GlassFish Open Source Edition.

We are seeing that many GlassFish customers and users want to be on (or move to) a supported application server. Customers of Oracle GlassFish Server may now start planning the migration with ease, and users of GlassFish Server Open Source Edition can start studying the when's and how's of such migration.

Which is why for those who are looking forward to experiencing the feature-rich Oracle WebLogic application server, I will give you in this developer webcast an overview of Oracle WebLogic Server and take a sample Java EE application to walk you through the most common migration scenarios to get your applications redeployed on WebLogic. You will hear about:

  • WebLogic Installation Process, Architectural Concepts, and Clustering Setups
  • Migration of Common Java EE Resources (JDBC, JMS)
  • Seamless GlassFish to WebLogic Redeployment
  • Advanced Classloader Analysis and Configuration
  • Shared Libraries
  • Tools to automate massive migrations
Date: Wednesday, April 30, 2014
Time: 10:00am PT / 1:00pm ET
Register for free online event today

Watch the webcast, and if you have questions, send to me over Twitter at @brunoborges and I will be happy to answer them!

Tuesday Apr 22, 2014

New book: Java EE 7 with GlassFish 4 Application Server

The third edition of David Heffelfinger's Java EE book has been recently released. This updated edition is covering the latest version of the Java EE Platform, i.e. Java EE 7.

The book gives a wide introduction on the Java EE Platform and its major APIs in their latest version: JPA 2.1, EJB 3.2, JSF 2.2, CDI 1.1, JMS 2.0, JAX-RS 2.0, Beans Validation 1.1, JAX-WS 2.2, etc. The book also cover 2 of the APIs introduced in Java EE 7 : the WebSocket API and JSON-P.

So if you are new to Java EE 7 or if you have been stuck on an older version the platform, reading this book will give you a good technical overview of Java EE 7, its main APIs and they works. It will give a solid overall understanding of Java EE 7 to rapidly start. You will then be able to deep more easily in the Platform and its APIs.

NB : The book samples are using GlassFish 4 but most of the content of the book is also applicable to any other Java EE 7 application server... that's the beauty of the Java EE!

Friday Apr 18, 2014

CDI 1.2 Released

As you know, CDI 1.1 is an important part of Java EE 7. You may be happy to know that the CDI specification just releases another minor point release - 1.2. As you can imagine the release contains a small number of fixes and clarifications. If you are surprised that a technology that is part of the Java EE platform had an independent release, you really shouldn't be. Although for various practical reasons Java EE technologies are usually synchronized with the platform JSR, individual JSRs are completely free to follow their own release schedule. Past examples include JSF and JAX-RS (and quite possibly JCache now).

The detailed list of changes are outlined on the CDI specification site.

Thursday Apr 17, 2014

GlassFish Story by Rakuten/Makito Hashiyama

Rakuten is one of the largest e-commerce platforms in Japan and perhaps the world. They chose GlassFish to form a core of their extensive (24 X 7) platform. Makito Hashiyama, the lead for the Rakuten marketplace platform shared their adoption story at the JavaOne 2013 Sunday GlassFish community event - check out the video below:

Makito detailed how GlassFish enabled Rakuten to handle the peak load of one of the biggest online sales events in Japan. By tuning GlassFish worker threads on a (42 X 3) instance cluster Rakuten was able to process 12,000 transactions per minute despite having a high latency external system dependency. Makito mentioned that one of the key reasons Rakuten adopted GlassFish for their platform was because of early support for Java EE standards such as JAX-WS. He also mentioned that beyond simply using GlassFish Rakuten regularly contributes patches into the GlassFish code base. You can check out the details of his story on the GlassFish stories blog.

Do you have a Java EE/GlassFish adoption story to share? Let us know and we will highlight it for the community.

Wednesday Apr 16, 2014

JSON Schema

We often tends to compare JSON against XML, i.e. JSON is simple, XML is not so simple. JSON is light, XML is heavyweight, etc. But there are still reasons to prefer, in certain cases, XML over JSON : e.g. transformation capability, XML extensibility, validation, ...

A question I sometime get when I talk about JSON-P support in Java EE is what about Schema? The works around JSON Schema standardisation is progressing but right now, this is still a draft specification. Nevertheless, this is something that you can already start to use. For example, this post shows how-to generate JSON Schema with Eclipse Link MOXy today.

As said earlier, the JSON Schema space is evolving, there are works that needs to be done at various levels but we can expect, over-time, an improved support for JSON Schema in the Java ecosystem. 

Tuesday Apr 15, 2014

Asynchronous CDI Events?

CDI events are a very powerful feature that enable loose coupling in a very simple and type-safe way. One aspect of CDI events that surprises many folks is the fact that they are synchronous rather than asynchronous. The surprise is perhaps fairly natural as similar event systems are usually asynchronous. Piotr Nowicki explores the issue in a very well thought out post exploring the various options for making CDI events asynchronous using plain Java EE features such as EJB @Asynchronous, Singleton locks and JMS. Exploring this issue further is probably very timely with the gradual rise of node.js/Reactive Programming.

Very encouragingly CDI 2 specification lead Antoine Sabot-Durand himself mentioned asynchronous CDI events as a possibility in his personal CDI 2 wish list. He suggests adding an asynchronous flag to the @Observes annotation. A possible downside to this is that the consumer rather than the producer makes the decision to go asynchronous. Another possibility is putting the asynchronous marker on the producer possibly using the type annotations facility introduced in Java SE 8:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
public class EventProducer {
@Inject Event event;
public void doSomething() {
MyEvent e = new @Async MyEvent(); = "This is a test event";
e.eventTime = new Date();;
public class EventConsumer {
public void afterMyEvent(@Observes MyEvent event) {
// .. Insert event logic here
view raw hosted with ❤ by GitHub

What do you think about the issue and the possibilities? This is the time to sound off as the horizons for CDI 2 are emerging.

Monday Apr 14, 2014

David Heffelfinger's Java EE/GlassFish Adoption Story

David Heffelfinger is the Chief Technology Officer of Ensode Technology and an ardent US based Java EE/GlassFish advocate. He has authored no less than four titles on Java EE/GlassFish. David shared a Java EE/GlassFish adoption story at the JavaOne 2013 Sunday GlassFish community event - check out the video below:

He detailed how he convinced a long time customer to upgrade their application servers and use Java EE/GlassFish with PrimeFaces by hacking together a quick demo. Using the combination of Java EE 6, GlassFish, PrimeFaces and NetBeans allowed him to lead a relatively inexperienced team in delivering the first version of the application in just three weeks. David also mentioned that using GlassFish as a learning tool helps keep his skills sharp and in-demand as GlassFish adopts the newest Java EE APIs faster than the other options. You can check out the details of his story on the GlassFish stories blog.

Do you have a Java EE 6/GlassFish story to share? Let us know and we will highlight it for the community.

Friday Apr 11, 2014

Non-blocking I/Os in Servlet 3.1

With the advent of platforms and frameworks such as Node.js, Vert.x, ... and more generally the rise of the Event-driven programming paradigm, asynchronous non-blocking I/Os are becoming more and more important in today's web applications.

Prior to Servlet 3.0, Servlet were synchronous. Servlet 3.0 (part of Java EE 6) added support for asynchronous request processing but only with ‘traditional’ I/Os (i.e. blocking I/Os) but this approach can sometime limit the scalability of an application.

The support for non-blocking I/Os has been added for Asynchronous Servlet in Servlet 3.1 (JSR 340 - part of Java EE 7). The net result is that the number of connections that can simultaneously be handled by the Servlet Container is greatly increased. This improves the resources utilization and the overall Web Container scalability.

It should be mentioned that other features haven added to the Servlet 3.1 such as support for the HTTP 1.1 Upgrade Mechanism. This new capability is used, for example, by the WebSocket API (JSR 356) to upgrade an existing HTTP connection to a TCP based WebSocket connection. In Servlet 3.1, the HTTP Upgrade Mechanism can also use non-blocking I/Os.

This article and this JavaOne session explains how asynchronous non-blocking I/Os in Servlet 3.1 The JavaOne session also covers the HTTP Upgrade mechanism and the other additions to the Servlet 3.1 API (various security enhancements and other miscellaneous features).

Thursday Apr 10, 2014

JSF + AngularJS = AngularFaces?

In case you haven't noticed, there's a pretty big shakeup going on in the world of Web UIs. Powered by several factors, JavaScript/rich client frameworks like AngularJS appear to be presenting a serious challenge to the server-side stalwarts of JSF, Spring MVC and the like. What will happen in the long run is anybody's guess.

In the meanwhile we can expect great thought experiments like the one represented by the recent survey results on the future of the view layer in Java EE applications put together by none other than editor Kevin Farnham. Anyone that understands the Gartner Hype Cycle will likely observe that the crest of inflated expectations are probably already in full swing for JavaScript frameworks. In fact I would say that the reactions of the readers if anything was a bit muted in favor of server-side frameworks as were some of the more well thought out comments that Kevin highlights. Another very interesting data point is the surprisingly good support for adding a new action-based/MVC web framework to Java EE in our own Java EE 8 community survey results.

One of my most recent talks titled JavaScript/HTML5 Rich Clients Using Java EE 7 actually tackles some of these very questions. Based on my years of experience working with a wide variety of clients and feedback from some JavaScript rich client early adopters I know well, it looks to me that the near future is likely one of mutual coexistence. In fact I think a very common scenario in the very near term is probably islands of JavaScript/rich client functionality in otherwise server-centric UIs. The ever vibrant JSF ecosystem is actually already busy trying to figure out this interesting puzzle. One of the most interesting such pilot projects is AngularFaces. It combines JSF and AngularJS in a way that almost makes it look too easy. If this is an approach that interests you, it is definitely a project worth checking out, not to mention the blog entry linked.

Do you have an opinion or insight on this you'd like to share? Now is a great time to express it or at least start thinking about it.

Please note that any views expressed here are my own only and certainly does not reflect the position of Oracle as a company.

Wednesday Apr 09, 2014

Method Validation in Bean Validation 1.1

Although it's a point release Bean Validation 1.1 brings a number of important features to Java EE 7. Easily the most important such feature is method validation. Beyond helping enforce design-by-contract in key service layer API classes (typically implemented in EJB3 or CDI) method validation plays an important role in helping ensure valid input to remote client endpoins written in JAX-RS and WebSocket. Hardy Ferentschik of the JBoss community explains the feature well. There's also the 15-minute Bean Validation 1.1 presentation by specification lead Emmanuel Bernard on the GlassFish videos YouTube channel as well the slide deck for my own lighting talk:

If you are interested in how method validation might be used in a realistic scenario with JAX-RS and WebSocket, feel free to dig into my example application on GitHub demostrating how Java EE 7 can be used with JavaScript MV* frameworks (in this case AngularJS).