Tuesday Nov 04, 2014

Java EE 8 at Devoxx

Next week (Nov. 10-14), 3.500 Devoxxians from 40 different countries will come to sunny Antwerp to attend the 13th edition of Devoxx (Belgium). Devoxx covers a broad range of topics ranging from Java SE, Mobile and Web Development, Embedded... to Java on the Server. This year Server-side Java track has very good contents including a good Java EE 8 coverage. Also, this year, you have the possibility to ask, in advance, questions to any of the speaker. For that, just check a session page and click on 'Send a question to the speaker'.

You can check the full Devoxx agenda here but here are the sessions that will discuss Java EE 8.

And this is just for Java EE 8! Here are some other Java EE related sessions that are worth to mentions too.

Again, this is just an overview, make sure to check full agenda here.

Also, we are still working on the details but do expect some Java EE 8 coverage during the Devoxx Hackergarten.

Will I see you next week at Devoxx?

Monday Oct 27, 2014

MyBatis-CDI: Persistence Alternative for Java EE

ORM is a by and large proven technique that has been around for a long time now (believe it or not TopLink was created in the early nineties for Smalltalk and then ported to Java). It maximizes code flexibility and database independence while minimizing boilerplate code and allowing the construction of rich domain models. Even for relatively complex domain models and queries, ORM engines tend to generate better quality SQL optimized to the underlying database than the average Java developer would with considerable time and effort. This is precisely why JPA is the persistence standard for Java EE and why a majority of modern server-side applications use ORM (indeed almost every other major development platform including .NET and Ruby on Rails positions ORM as it's default persistence solution).

That being said, there can certainly be cases where using hand-written native SQL is necessary or desirable. Most people don't seem to realize it, but JPA has always included very good support for native queries to meet these use cases (JPA 2.1 now even includes formal support for stored procedures - the ultimate form of database bound query execution). If you weren't aware of this, you should definitely read Taudo Wenzel's excellent write-up on using JPA native queries to generate reports (a common use case for native queries).

In fact you have other options for native SQL centric persistence in Java EE applications. One of the nicest ones is MyBatis-CDI. It provides a very nice CDI based abstraction for MyBatis, making it extremely easy to use in Java EE applications (in case you are wondering MyBatis is the successor to the old iBatis project). Here is how simple MyBatis CDI code can look like:

In addition to JTA transactions, MyBatis-CDI also supports local transactions. I've personally also successfully used Apache Commons DbUtils with CDI to quickly port over a legacy application with tons of hand-written SQL to Java EE/GlassFish.

Thursday Oct 16, 2014

OTN Virtual Technology Summit is approaching. Save the date!

The OTN Virtual Technology Summit is a set of free online events covering various technical topics such as Java SE, Java EE but also Middleware, Database, etc.  Each topic will be presented by a subject matter expert coming either from Oracle or from the community (Java Champions, Oracle ACEs, ...). And during each session, a live chat will let participants ask questions and clarifications on the presented subject. So this is a really great (and free!) learning opportunity.

This time, the Java EE session will be delivered by Josh Juneau, a renowned Java EE specialist and author of 2 popular Java EE 7 books!

More details will be provided soon (detailed agenda with session abstracts, registration page, etc.) will be published soon. But in the meantime, make sure to save the date in your agenda:
  • VTS America : November 18th, 2014 – 9am to 12:30pm PST
  • VTA Asia : November 19th, 2014 – 10:00am to 1:30pm IST
  • VTS Europe : November 26th, 2014 – 9am to 12:30pm GMT

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.