Friday Oct 10, 2014

JSON Binding, Slides from JavaOne 2014

At JavaOne 2014, there were several sessions covering Java EE topics. One of the most expected features in Java EE 8 is the JSON Binding API. Martin Grebac from the Expert Group shared his slides with the proposals (yes, lots of code already!) for this API and also details how you can participate and be involved in the development and specification process for JSR 367 - JSON-B.

Get the slides now from JavaOne 2014 (PDF) and follow these links below to participate:

Wednesday Oct 08, 2014

The Java EE 7 Tutorial

"The only thing that interferes with my learning is my education." (Albert Einstein)

The Java EE 7 Tutorial is one of the lesser-known gem. It is an extensive tutorial that covers the Java EE platform and its different APIs. The nearly 1.000 pages of the Tutorial might looks a bit daunting for newcomers. But let's be clear, one doesn't have to go through the complete tutorial! The tutorial has been structured in a way to make it easy to learn specific aspects of the platform. And last but not least, the Tutorial also covers more advanced parts of the platform such as JCA for example. In short, the Java EE Tutorial is a great ressource to learn the Java EE platform at large but also learn more specific aspects of Java EE. The tutorial comes in 3 flavours, a free online version and free PDF version but also a 2 tomes based books edition (paper & Kindle version). 

The Tutorial also bundles many samples that demonstrate specific API but also a few sample applications that shows how to use and combine the different API's to build a complete application. The samples can be download from the SVN repository but also using the GlassFish update center. The following short screencast shows how to install the samples in NetBeans using the GF update center. It's easy, the samples are just a few clicks away!

It should be mentioned that that the Tutorial and its samples have been recently updated for the release of GlassFish 4.1 (see here for more details).

And if you find any issue on the Tutorial or on one if its samples, please make sure to fill a Jira ticket. That input is valuable to continue to maintain and improve the Java EE Tutorial!

Tuesday Sep 09, 2014

GlassFish Server Open Source Edition 4.1 Released!

GlassFish Server 4.1 Open Source Edition is available for download! This release of the world's first Java EE 7 application server includes multiple new and valuable features and updates. Here is a quick look at what's new:

  • Updated Platform Support.  This release adds support for Java 8, CDI 1.2, and WebSocket 1.1. GlassFish, the world's first Java EE 7 application server, maintains leading compatibility with the latest Java EE specifications.
  • Improved Developer Experience.While GlassFish 4.1 remains an open-source only release, quality and a productive developer experience remain a key focus.  GlassFish Server is made up of over 20 sub-projects (like Tyrus, Jersey, WeldEclipseLink, and more). Each of these projects adds features and bug fixes, over 1,000 in all! Thanks to those developers who participated in the GlassFish 4.1 FishCAT program to make GlassFish even better!  A special shout out to Joonas Lehtinen, who found a bug that caused GlassFish to fail to boot on Mac OS X 10.10 (Yosemite)!
  • New Features.  Here's a list of some of the most important updates in this release.
    • Tyrus (WebSocket 1.1 RI).  Now supports the WebSocket 1.1 specification, which adds a couple of APIs for improved support for Lambda expressions. Tyrus adds some features above and beyond the specification, like throttling the number of open sessions, metrics exposed through JMX, client reconnect, proxy support, optimized broadcasting of a message to all open sockets, and more. 
    • Jersey (JAX-RS 2.0 RI). Updated with some impressive new features. Jersey brings the OAuth support originally available in Jersey 1.1, and adds a new client-side API for OAuth 1 and 2 support. Jersey has also improved diagnostics with better error reporting, exposes Jersey metrics over JMS, and per-request tracing to a log file or to the HTTP reponse header. Jersey also adds client-side server-sent event reconnect support.
    • OpenMQ (JMS 2.0 RI). Open MQ adds support for communicating over WebSocket. There are two types of WebSocket clients that are supported. First, mqstomp, which adds support for any WebSocket client that supports the STOMP 1.2 protocol. Second, mqjsonstomp, which enables a (WebSocket) client to send JSON formatted messages using the STOMP 1.2 protocol. 
  • Java EE 7 SDK. The Java EE 7 SDK has been updated to make it more approachable overall. First, it is shipped as a zip bundle, offering a very simple installation process. The SDK also bundles GlassFish 4.1 and now supports Java 8. Last, the Java EE 7 SDK bundle includes updates to both the Java EE 7 Tutorial and Java EE 7 First Cup.

  • [Update] Netbeans 8.0.1 available for download; bundles GlassFish 4.0.1. 

In summary, GlassFish 4.1 offers updated platform support, improved developer experience, new features and is bundled in the refreshed Java EE 7 SDK. GlassFish 4.1 can be downloaded from glassfish.org, and the Java EE 7 SDK can be downloaded from the Oracle Technology Network (OTN). 

Wednesday Aug 13, 2014

Introducing DeltaSpike 1.0

It is disappointing to come across the occasional mindset that Java EE somehow limits you to using only what is in the standard and nothing more. This is really not the case now and never was. Java EE is intended to provide a stable, open, compatible and reliable core that the ecosystem can build upon without the risks of vendor lock-in or monopolies. The idea is to provide a seamless platform that just works for the vast majority of cases. The ecosystem on the other hand is free to innovate and extend much farther beyond the standard core, ideally to cover every reasonably conceivable use case. The standard can then draw from well understood, successful use cases and bring those back into the core. To this end, almost every Java EE API today is designed with extensibility in mind. In fact, extensibility through CDI and CDI portable extensions in particular was a core goal for Java EE 6.

DeltaSpike is one of the projects that demonstrates these principles in action. For those unaware, it is a consolidation of Seam 3, Apache CODI and a few smaller projects. It is a set of portable CDI extensions that provide useful features for Java EE applications. In fact, the DeltaSpike team has already been instrumental in standardizing some of the innovative changes in Java EE 7. The project just released version 1.0 and it is a great time to check it out if you haven't done so already. Veteran Java EE advocate Arun Gupta has an excellent write-up on DeltaSpike 1.0.

Here are just some of the things that are in DeltaSpike 1.0 right now:

  • Many Java EE 7 features that you can use in Java EE 6 such as @Transactional, @TransactionScoped, CDI support in bean validation/JSF converters, @ViewScoped in CDI and so on.
  • An excellent higher level abstraction for reducing boilerplate in JPA based repositories.
  • A simplified, pluggable security framework for Java EE.
  • Simple integration with Quartz 2.
  • Injecting common Servlet objects.
  • Many, many more...

A great place to start is actually the excellent DeltaSpike site. The project is almost entirely community driven, completely vendor-neutral  and very friendly to contributors. DeltaSpike was nominated for the Duke's Choice Awards this year - they certainly deserve to win.

Thursday Aug 07, 2014

Java EE 101 Using GlassFish 4 and NetBeans

While a lot of folks (our team included) spend most of their efforts spreading the good word on Java EE 7 and now increasingly Java EE 8, sometimes it helps to get back to the basics. This is especially true for beginners to Java EE and GlassFish. This point is fortunately not lost on Andrew Pielage of C2B2 consulting (the good folks that run the London GlassFish user group). In this extremely well written blog post Andrew explains step-by-step how to write, deploy and run a very simple web application using GlassFish 4 and NetBeans. He uses Windows in his instructions and I know that will actually be helpful to many of you since most corporate desktop environments still standardize on Windows.

If you know someone who could benefit from the nicely done entry, do make sure to share it. As such, there's few write-ups out there that are so basic and yet so incredibly helpful to the right person.

Tuesday Aug 05, 2014

JCP News (July)

Welcome to the second installment of the JCP news focused on the server side. And despite the summertime, July has been a busy month!

We now have the first Java EE 8 component JSR: JSR 365 (Contexts and Dependency Injection for Java 2.0). The CDI 2.0 JSR has passed the review ballot so the EG can now be formed and start the technical work. Check here to see what the CDI 2.0 plans are.

In addition, several JSR draft proposals have been published to gather feedback before they are submitted to the JCP: JMS 2.1Servlet 4.0JSF 2.3 and JSONB.

Those 5 JSRs (CDI 2.0, JMS 2.1, Servlet 4.0, JSF 2.3 and JSONB) are targeted for inclusion in Java EE 8. We are still in the early days but we can now start to see a path towards Java EE 8!

On the Java EE 7 front, JSR 356 has recently passed the maintenance release ballot : Java API for WebSocket 1.1. The upcoming GlassFish 4.1 (Java EE 7 Reference Implementation) should include a Tyrus release (JSR 356 RI) that supports WebSocket 1.1.

In July, ZEEF has joined the JCP as a Corporate Member, Zeef will be represented by Arjan Tijms who is well known in the Java EE community. I am sure Arjan's knowledge on security, JSF and Java EE in general will be extremly valuable!

Finally, the 'Broadening JCP Membership' JSR (JSR 364) has posted an Early Draft Review. You should definitely check this JSR as it is key for the future of the Java Community!

Monday Jul 28, 2014

David Blevins' Java EE Sessions at JavaOne 2014

For the Java EE track at JavaOne 2014 we are highlighting some key sessions and speakers to better inform you of what you can expect, right up until the start of the conference.

To this end we recently interviewed David Blevins. Although not as well known as some of the other folks in the Java EE community, David has been instrumental in the ecosystem for a very long time. He has been the powerhouse developer behind the innovative OpenEJB project and a key committer on many other Java EE related Apache projects including OpenWebBeans. Over the years he has ardently advocated for Java EE and directly contributed to many Java EE expert groups including EJB 3.1, EJB 3.2, Java EE 6 and Java EE 7. More recently he launched Apache TomEE - a project that turns the Tomcat vs Java EE debate on it's head by creating a Java EE certified application server squarely focused on Tomcat users. David is also a JavaOne Rock Star. We are very honored to have David speak at JavaOne and interview him on his sessions this year:

David has several key sessions on the track:

  • Java EE Game Changers: It never fails to surprise me how many pretty intelligent folks still associate Java EE with J2EE (a technology now more a decade in the past). Many of these folks don't realize just how much has changes especially since Java EE 6 and certainly as of Java EE 7 and beyond. This session is primary geared towards these folks and outlines why Java EE and the JCP today is a fundamental game changer. You probably should attend even if you are already a Java EE fan - besides covering key evolutions David will also cover forward looking ideas that are on his keen radar to keep moving the platform forward.
  • Apache TomEE, Java EE Web Profile, and More on Tomcat: If you are a current Tomcat user curious about Java EE, this is a session you shouldn't miss. Using live coding, David will show exactly how the real world Java EE development experience using TomEE looks like. He will also explain the fundamental value proposition of Java EE/TomEE and explain some of the technical details of how TomEE is made possible. 
  • Java EE 8 Community Update and Panel: This panel is intended to be an open forum for discussing Java EE 8. The panel consists of both some implementors like David/TomEE and some key independent folks in the community. The panel will be moderated by my colleague Bruno Borges. The idea is to encourage panelists to interact with each other and the audience - so bring your questions, comments and ideas!

Besides David's sessions, we have a very strong program for the Java EE track and JavaOne overall - just explore the content catalog. If you can't make it, you can be assured that we will make key content available after the conference just as we have always done.

The early bird offer for JavaOne expires August 1st so if you plan to come to JavaOne it would be wise to register early now and save some money for yourself or your organization. I certainly hope to see you there.

Friday Jul 25, 2014

Using Server-Sent Events (SSE) with Nothing More Than Servlet

As many of you know, HTML 5 Server-Sent Events (SSE) stands between the two extremes of completely stateless REST/HTTP and fully bidirectional WebSocket. It is a relatively simple mechanism that allows for sending data from the server to the client once a connection is established via plain HTTP. An interesting side-effect of this basic simplicity is you could conceivably use SSE with nothing more than the plain Servlet API. The downside of taking this approach is that you don't have the much higher level, easier to use specialized APIs for SSE such as the ones long included in Jersey (and now being proposed as part of Java EE 8).

The GlassFish team's own Shing Wai Chan explores the idea of using SSE from plain Servlets in an excellent recent post. The post is a very good way of understanding how SSE actually works under the hood. Besides demonstrating the basics of SSE from an HTTP perspective, the post also shows the JavaScript SSE API available on the browser as well as using the Servlet 3 async API and Java EE 7 concurrency utilities with Servlet based SSE.

Wednesday Jul 16, 2014

Java EE @ UberConf

UberConf was held June 24 - June 27 in Denver, Colorado. For those unaware, this is essentially the largest single annual event under the NFJS umbrella and to a certain extent the culminating point of the US based tour. Unlike the usual NFJS events that are squarely locally focused, it's intent is to be a national/international conference. Consequently it has a larger set of attendees, speakers, tracks and sessions. This year's event was very vibrant and clearly a success by all measures.

I had six talks total over three days, essentially back-to-back. I had excellent attendance for all my sessions and had many of the same folks staying for multiple sessions which is always a very good sign. I did talks on Java EE 7/Java EE 8, the Cargo Tracker Java EE Blue Prints, JMS 2, aligning Java EE 7 with the HTML 5/JavaScript Rich Client landscape, JAX-RS 2 and aligning Java EE with the NoSQL landscape. I also helped out with Arun Gupta's excellent Java EE 7 lab. More details, including slide decks and code, posted on my personal blog.

Monday Jul 14, 2014

VRaptor 4: A CDI Based MVC Framework for Java EE

As you may know one of the surprising results of the Java EE 8 survey was the desire for an action oriented MVC framework for Java EE. What many folks may not be aware is that there are actually a few action oriented web framework solutions out there that are already very aligned with Java EE. One such solution that really stands out is VRaptor.

Built on top of CDI, it has some very interesting defaults geared towards ease-of-use/productivity. It also supports key Java EE APIs such as JPA and JTA. To build a bit more awareness for the web framework, key commiter Rodrigo Turini recently wrote an excellent article on InfoQ. It is a very well-written article that serves as a good getting started guide with the innovative framework. Rodrigo will also be talking about VRaptor 4 at JavaOne 2014.

Jersey MVC has also long provided a very similar action oriented solution based on top of JAX-RS. All of these solutions could certainly be used now and serve as valuable input to any future effort to standardize an action oriented web framework in Java EE.

Monday Jun 30, 2014

Introducing the Java EE Squad!

One of the most satisfying things that I've seen personally over the years is the steady growth of the Java EE community, by and large independent of vendors. Today you have so many key folks in the community like Adam Bien, David Blevins, Antonio Goncalves, Markus Eisele, Peter Pilgrim, Arjan Tijms, David Heffelfinger, Josh Juneau, Bauke Scholtz (aka BalusC)  and Werner Keil just for starters that publicly advocate for and strongly support Java EE. This is a far cry from the largely vendor driven affair that was J2EE and frankly virtually unimaginable even in the Java EE 5 time period when I first decided to become active in the community myself as an independent. Java EE is most fortunate that many of these folks contribute directly back to the standard through JCP expert groups.

To this list of prominent names I am very happy to add another - Rudy De Busscher and his newly formed Java EE Squad. Don't let the name fool you - as Rudy explains in the blog entry linked, the squad isn't about contention or an antagonism to anything in particular. In fact that would be against the true spirit of Java EE that is open, inclusive, pluralistic and supportive of an ecosystem that may take any form it wishes while advancing the goals of choice, vendor-neutrality, stability, ease-of-use and compatibility though an open community standard.

The goal of the squad is most benign and community friendly - to educate through presentations, courses, articles and blogs from a small group of contributors. Perhaps it makes sense for you to even explore joining the group and adding to the growing voice of the Java EE community?

As the group marches forward we will highlight them here just as we highlight the many other parts of the community.

Wednesday Jun 18, 2014

JavaOne Java EE Track Content Finalized (A Detailed Preview)

I am very pleased to share with you that the JavaOne Java EE track content is now finalized. In this brief but detail-rich entry on my personal blog, I want to take this opportunity to tell you a little bit about the track, key content and star speakers this year. The collective passion and dedication of all the folks that submitted helped us construct a very strong offering for the community at large. JavaOne is a key part of the global Java community far beyond the walls of Oracle and all of you are a large part of keeping it successful.

I hope to see you all at JavaOne. In the next coming weeks and months we will be sharing more details on the Java EE track, content and speakers at JavaOne. Lastly having been on the other side of the fence I know as much as you might come to JavaOne, it might not be a practical reality for you for a variety of good reasons. I want to remind you that we make a point to make JavaOne content openly available to all. That being said I want to tell you that you should make the pilgrimage to JavaOne at least once as a Java developer.

Friday Jun 13, 2014

Java EE Basic Training with Yakov Fain

Those of us that have been around Java/Java EE for a little while sometimes tend to forget that Java is still an ever expanding ecosystem with many newcomers. Fortunately, not everyone misses this perspective, including well-respected Java veteran Yakov Fain. Yakov recently started a free online video tutorial series focused on Java and Java EE for absolute beginners. The first few parts of the series focused on Java SE but now Yakov is beginning to cover the very basics of Java EE. In a recent video he covered:

  • The basics of the JCP, JSRs and Java EE
  • How to get started with GlassFish 4
  • The basics of Servlets
  • Developing Java EE/Servlets using Eclipse and GlassFish

The excellent video is posted below. The slides for the tutorial series generally are available here. If there are folks you know that would benefit from this content, please do pass on word. Even if you are an experienced developer, it sometimes helps to sit back and review the basics...

It's quite remarkable that someone of Yakov's stature took the time out to create content for absolute beginners. For those unaware, Yakov is one of the earliest Java champions and one would be very hard pressed to match his many contributions to the Java community. The tutorial demonstrates his continued passion, commitment and humility.

Wednesday Jun 11, 2014

Why JSF Matters (to You)

      "Those who have knowledge, don’t predict. Those who predict, don’t have knowledge."

                                                                                                   – Lao Tzu

You may have noticed Thoughtworks recently crowned the likes of AngularJS, etc imminent successors to server-side web frameworks. They apparently also deemed it necessary to single out JSF for righteous scorn. I have to say as I was reading the analysis I couldn't help but remember they also promptly jumped on the Ruby, Rails, Clojure, etc bandwagon a good few years ago seemingly similarly crowning these dynamic languages imminent successors to Java. I remember thinking then as I do now whether the folks at Thoughtworks are really that much smarter than me or if they are simply more prone to the Hipster buzz of the day. I'll let you make the final call on that one. I also noticed mention of "J2EE" in the context of JSF and had to wonder how up-to-date or knowledgeable the person writing the analysis actually was given that the term was basically retired almost a decade ago. There's one thing that I am absolutely sure about though - as a long time pretty happy user of JSF, I had no choice but to speak up on what I believe JSF offers. If you feel the same way, I would encourage you to support the team behind JSF whose hard work you may have benefited from over the years.

True to his outspoken character PrimeFaces lead Cagatay Civici certainly did not mince words making the case for the JSF ecosystem - his excellent write-up is well worth a read. He specifically pointed out the practical problems in going whole hog with bare metal JavaScript, CSS, HTML for many development teams. I'll admit I had to smile when I read his closing sentence as well as the rather cheerful comments to the post from actual current JSF/PrimeFaces users that are apparently supposed to be on a gloomy death march. In a similar vein, OmniFaces developer Arjan Tijms did a great job pointing out the fact that despite the extremely competitive server-side Java Web UI space, JSF seems to manage to always consistently come out in either the number one or number two spot over many years and many data sources - do give his well-written message in the JAX-RS user forum a careful read. I don't think it's really reasonable to expect this to be the case for so many years if JSF was not at least a capable if not outstanding technology. If fact if you've ever wondered, Oracle itself is one of the largest JSF users on the planet. As Oracle's Shay Shmeltzer explains in a recent JSF Central interview, many of Oracle's strategic products such as ADF, ADF Mobile and Fusion Applications itself are built on JSF. There are well over 3,000 active developers working on these codebases. I don't think anyone can think of a more compelling reason to make sure that a technology is as effective as possible for practical development under real world conditions.

Standing on the shoulders of the above giants, I feel like I can be pretty brief in making my own case for JSF:

  • JSF is a powerful abstraction that brings the original Smalltalk MVC pattern to web development. This means cutting down boilerplate code to the bare minimum such that you really can think of just writing your view markup and then simply wire up some properties and event handlers on a POJO. The best way to see what this really means is to compare JSF code for a pretty small case to other approaches. You should then multiply the additional work for the typical enterprise project to try to understand what the productivity trade-offs are. This is reason alone for me to personally never take any other approach seriously as my primary web UI solution unless it can match the sheer productivity of JSF.
  • Thanks to JSF's focus on components from the ground-up JSF has an extremely strong ecosystem that includes projects like PrimeFaces, RichFaces, OmniFaces, ICEFaces and of course ADF Faces/Mobile. These component libraries taken together constitute perhaps the largest widget set ever developed and optimized for a single web UI technology. To begin to grasp what this really means, just briefly browse the excellent PrimeFaces showcase and think about the fact that you can readily use the widgets on that showcase by just using some simple markup and knowing near to nothing about AJAX, JavaScript or CSS.
  • JSF has the fair and legitimate advantage of being an open vendor neutral standard. This means that no single company, individual or insular clique controls JSF - openness, transparency, accountability, plurality, collaboration and inclusiveness is virtually guaranteed by the standards process itself. You have the option to choose between compatible implementations, escape any form of lock-in or even create your own compatible implementation! Open standards like JSF also tend to have strong out-of-the-box tools/IDE support.

As you might gather from the quote at the top of the post, I am not a fan of crystal ball gazing and certainly don't want to engage in it myself. Who knows? However far-fetched it may seem maybe AngularJS is the only future we all have after all. If that is the case, so be it. Unlike what you might have been told, Java EE is about choice at heart and it can certainly work extremely well as a back-end for AngularJS. Likewise, you are also most certainly not limited to just JSF for working with Java EE - you have a rich set of choices like Struts 2, Vaadin, Errai, VRaptor 4, Wicket or perhaps even the new action-oriented web framework being considered for Java EE 8 based on the work in Jersey MVC...

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

Thursday May 29, 2014

GlassFish/Java EE Community Open Forum Tomorrow!

Still have lingering questions on the goals and future of GlassFish? Want to know a little more about the upcoming GlassFish 4.0.1 release? Something on your mind about Java EE 8/GlassFish 5? You have a golden opportunity to pose your questions and speak your mind tomorrow!

The good folks over at C2B2 have gone through a lot of time and effort to organize a very useful online event for the London GlassFish User Group - they are having me answer all your questions online, in real time, "face-to-face". Steve Millidge of C2B2 will be moderating the questions and joining the conversation. Did I mention the event was online, free and open to anyone?

The event is tomorrow (May 30th), so make sure to register as soon as possible through the C2B2 website (the registration page has more details on the event). It will be held at 4:30 PM BST / 11:30 AM EST / 8:30 AM PST - you must register to participate. Hope to talk to you tomorrow?