Friday Aug 29, 2014

JavaOne: Java EE Community Update and Panel

 At this JavaOne 2014 edition, one of the coolest things Java EE developers might be interested to engage with is definitely the Java EE Community Update and Panel CON2131. In this panel developers will have the opportunity to hear from major vendors who support and invest in the Java EE Platform what they have to say about the plans for Java EE 8 as well its future, discuss hot topics (why not talk about Microservices?) and how these relate to Java EE and many other great things. Or maybe what their current products have to offer and even some of their roadmaps!

What would you like to ask in this panel? Fill this form!

Representing major vendors, and a community member, we will have:

Vendor Representative Twitter
Oracle Cameron Purdy @cpurdy
Red Hat Mark Little @nmcl
Tomitribe David Blevins @dblevins
IBM Kevin Sutter @kwsutter
Community * Adam Bien @adambien

This panel will start with a brief Community Update to share with attendees current plans of Java EE 8 from the JCP Expert Group, but what we have differently from previous editions of such panel, is that you have the opportunity even if not attending JavaOne, to ask vendors whatever you want.

Send us questions by filling this form and we will pick the best ones to ask them during the panel. And don't forget to follow @Java_EE on Twitter!

Thursday Aug 28, 2014

Spotlight on GlassFish 4.1: #8 WebSocket Client Reconnect

Spotlight on GlassFish 4.1' is a series of posts that highlights specific enhancements of the upcoming GlassFish 4.1 release. It could be a new feature, a fix, a behavior change, a tip, etc.

#8 WebSocket Client Reconnect 

There are various libraries to improve the WebSocket capabilities of a client in the JavaScript space. WebSockHop is one of them, one of its feature is a 'automatic reconnect' facility. That's useful for JavaScript WebSocket client endpoints.

A similar capability has been introduced in Tyrus and GlassFish 4.1. A Tyrus based WebSocket client can now register a ReconnectHandler. This handler provides 2 methods (onDisconnect() and onConnectFailure()) that will greatly simplify the handling of dropped connection. Check this Client reconnect example from the Tyrus User Guide.

Additional ressources:

Wednesday Aug 27, 2014

Java EE 8 Takes Off!

A big day for Java EE - Java EE 8 is now officially launched as JSR 366 via the JCP process. As you might have expected the primary focus areas are HTTP 2/HTML 5 support, CDI/managed bean alignment, cloud support and Java SE alignment.

Here is some of the very high level content:

Web Standards

  • HTTP 2
  • Server-Sent Events (SSE)
  • JSON binding
  • Action oriented web framework to complement JSF
  • More support for Hypermedia
  • Looking into further JSF alignment with JavaScript/CSS frameworks like Bootstrap, Foundation and jQuery
  • Enhancements to JSON-P, WebSocket and JAX-RS

Managed Bean/CDI Alignment

  • CDI 2
  • Container services such as EJB style declarative security and scheduling made available to managed beans/CDI generally
  • MDB style CDI based declarative JMS message listeners
  • Pruning some of the older EJB 2/CORBA APIs
  • JAX-RS alignment with CDI


  • Configuration
  • Multitenancy
  • Simplified security
  • REST APIs for management and monitoring

Java SE

  • Taking advantage of features available such as repeating annotations, lambda expressions, the Date/Time API, type annotations, Completable Futures and so on.

This of course is just the high level initial plan and there will be many other changes included such as updates to JSF and JMS as well as the addition of JCache/data grids. Do make sure to check out the JSR page on for details. Now is the time to start getting involved or at least begin to think about it.

Besides the platform JSR, a number of APIs targeted to Java EE 8 have also now been filed, each under their own JSR. Check out the details on each JSR page:

More Java EE 8 JSRs will be soon to follow. As always we will keep you informed here as things move forward, so stay tuned and let us know what you think.

Tuesday Aug 26, 2014


The Model–View–Controller (MVC) pattern has been used for several decades to implement user interfaces. And when it comes to MVC Web frameworks, those can be categorized as action-based or component-based. JavaServer Faces is a component-based MVC framework.

Through the survey, the community has expressed interest in an action-based MVC approach. Santiago Pericas-Geertsen has recently posted a draft proposal for a JSR ('MVC 1.0 JSR') that would define a MVC action-oriented framework for the Java EE platform. This MVC JSR is not intended to replace JSF (component-oriented) but offers, instead, a different approach to building Web applications on the Java EE Platform.

One of the goals of the MVC JSR is to leverage existing platform technologies where it makes sense (e.g. CDI and Bean Validation seems obvious candidates for the Model part).

The initial though was to define this (action-based) MVC framework in the JAX-RS specification but after initial feedback and discussions, the general consensus was that a separate JSR would be more appropriate. Technically, JAX-RS is still one of the option for the Controller part but everything is open and will have to be discussed in the EG. The outcome of those discussions might be that something else is needed for the Controller, or that there's a way to define a Controller independently of the underlying technology and JAX-RS would then be 'plugged' in, we will see... One thing is clear, defining a new template language is not in the scope of the MVC proposal!

We have strong team to lead the MVC JSR : Santiago Pericas-Geertsen (who is also the JAX-RS Specification co-lead) and Manfred Riem (who is also the JSF Specification co-lead). They will, for sure, get support from other community participants (e.g. Red Hat).

In terms of planning, Santiago is looking for supporters before he submits the proposal to the JCP. The JSR itself is aligned with the Java EE 8 planning.

Monday Aug 25, 2014

A Fresh Look at CDI Events

Type safe events have been one of the most elegant and innovative features in CDI for a long time. For some odd reason however they seem to continue to be fairly under-appreciated and not written about that often. It's very good to see CDI specification co-lead Antoine Sabot-Durand recognizing this and aiming to do something about it. In his most recent blog post, Antoine wrote up an excellent refresher on CDI. He covers the basics of events, some of the more advanced features as well as some best practices. The blog post actually covers some of the more fine grained changes in CDI 1.1 and CDI 1.2. Antoine also briefly talks about some of the possible enhancements to events in CDI 2.

It's definitely well worth a read if you are already a CDI fan or just beginning to explore it. Do pass the link on if you know anyone that may benefit from it. Note that the upcoming GlassFish 4.1 release will support CDI 1.2.

Friday Aug 22, 2014

Java EE @ NFJS Central Iowa Software Symposium Des Moines

As some of you may be aware I recently joined the well-respected US based No Fluff Just Stuff (NFJS) Tour. The NFJS Central Iowa Software Symposium was held August 8 - 10 in Des Moines. The Des Moines show is one of the smaller ones but still was good overall. It is one of the few events of it's kind that take place this part the country so it is extremely important.

I had five talks total over two days, more or less back-to-back. I had decent 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, WebSocket, the Cargo Tracker Java EE Blue Prints, JavaScript + Java EE and NoSQL + Java EE. More details, including slide decks and code as well as my NFJS tour schedule, posted on my personal blog.

Thursday Aug 21, 2014

Spotlight on GlassFish 4.1: #7 WebSocket Session Throttling and JMX Monitoring

'Spotlight on GlassFish 4.1' is a series of posts that highlights specific enhancements of the upcoming GlassFish 4.1 release. It could be a new feature, a fix, a behavior change, a tip, etc.

#7 WebSocket Session Throttling and JMX Monitoring

GlassFish 4.1 embeds Tyrus 1.8.1 which is compliant with the Maintenance Release of JSR 356 ("WebSocket API 1.1"). This release also brings brings additional features to the WebSocket support in GlassFish.

JMX Monitoring:

Tyrus now exposes WebSocket metrics through JMX . In GF 4.1, the following message statistics are monitored for both sent and received messages:

  • messages count
  • messages count per second
  • average message size
  • smallest message size
  • largest message size

Those statistics are collected independently of the message type (global count) and per specific message type (text, binary and control message). In GF 4.1, Tyrus also monitors, and exposes through JMX, errors at the application and endpoint level.

For more information, please check Tyrus JMX Monitoring

Session Throttling

To preserve resources on the server hosting websocket endpoints, Tyrus now offers ways to limit the number of open sessions. Those limits can be configured at different level:

  • per whole application
  • per endpoint
  • per remote endpoint address (client IP address)


For more details, check Tyrus Session Throttling.

The next entry will focus on Tyrus new clients-side features.

Wednesday Aug 20, 2014

Using the Java SE 8 Date Time API with JPA 2.1

Most of you are hopefully aware of the new Date Time API included in Java SE 8. If you are not, you should check them out right now using the Java Tutorial Trail dedicated to the topic. It is a significantly leap forward in processing temporal data in Java. For those who already use Joda-Time the changes will look very familiar - very simplistically speaking the Java SE 8 feature is basically Joda-Time standardized.

Quite naturally you will likely want to use the new Date Time APIs in your JPA domain model to better represent temporal data. The problem is that JPA 2.1 will not support the new API out of the box. So what are you to do? Fortunately you can make use of fairly simple JPA 2.1 Type Converters to use the Date Time API in your JPA domain classes. Steven Gertiser shows you how to do it in an extremely well written blog entry. Besides explaining the problem and the solution the entry is actually very good for getting a better understanding of JPA 2.1 Type Converters as well. I think such a set of converters may be a good fit for Apache DeltaSpike as a Java EE 7 extension?

In case you are wondering about Java SE 8 support in the JPA specification itself, Nick Williams has already entered an excellent, well researched JIRA entry asking for such support in a future version of the JPA specification that's well worth looking at. Another possibility of course is for JPA providers to start supporting the Date Time API natively before anything is formalized in the specification. What do you think?

Tuesday Aug 19, 2014

Spotlight on GlassFish 4.1: #6 Java API for WebSocket 1.1

'Spotlight on GlassFish 4.1' is a series of posts that highlights specific enhancements of the upcoming GlassFish 4.1 release. It could be a new feature, a fix, a behavior change, a tip, etc.

#6 Java API for WebSocket 1.1

JSR 356 (Java API for WebSocket) has recently passed the Maintenance Release ballot, this Maintenance Release fixes an important issue when Java SE 8 Lambdas are used (see here). GlassFish 4.1 will include an updated version of Tyrus (JSR 356 Reference Implementation) to bring the WebSocket API level to the latest version of the specification, i.e. WebSocket API for Java 1.1.

It should be mentioned that the Tyrus version included in GlassFish 4.1 also brings additional features. Some of those will be highlighted in upcoming entries.

Monday Aug 18, 2014

Ed Burns' Servlet 4/HTTP 2 Session 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 Ed Burns. Ed is a veteran of Sun and now Oracle. He has been and is instrumental in pushing the JSF ecosystem forward as specification lead. Besides his specification lead work Ed is well regarded as an author and speaker on his own right. In addition to carrying the JSF torch Ed will be co-leading the key Servlet 4 specification for Java EE 8, along with Servlet specification guru Shing Wai Chan. The primary goal of Servlet 4 is to enable the fundamentally important changes in HTTP 2 for the entire server-side Java ecosystem. We wanted to talk to Ed about his Servlet 4 session at JavaOne 2014 and HTTP 2 generally:

The details for the Servlet 4 session can be found here. Ed has several other key sessions on the track that we hope to talk to him about separately in the near future:

  • What’s Next for JSF?: In this key session, Ed will be sharing the next steps for the continued evolution of the JSF specification in Java EE 8.
  • Where’s My UI? The 2014 JavaOne Web App UI Smackdown: The UI space for web applications, especially in the Java ecosystem continues to be as hotly contested as ever. This is especially true with the (re)introduction of JavaScript based rich client frameworks like AngularJS. This lively panel brings together experts representing the diverse schools of thought for web UIs. Ed will be representing JSF of course. Neal Ford will moderate the panel as an independent and hopefully reasonably neutral party.
  • Adopt-a-JSR for Java EE 7 and Java EE 8: Adopt-a-JSR has been a reasonable success for Java EE 7. With Java EE 8 we are planning to strengthen it far more as away of getting grassroots level participation in the specification efforts. This session will introduce Adopt-a-JSR, share how it worked for Java EE 7 and what we plan to do with it in Java EE 8. Ed will be sharing his perspectives on Adopt-a-JSR for both Java EE 7 and Java EE 8.

Besides Ed'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.

Friday Aug 15, 2014

Java EE@Java Day Taipei 2014

Java Day Taipei 2014 was held at the Taipei International Convention Center on August 1st. Organized by Oracle University, it is one of the largest Java developer events in Taiwan. This was another successful year for Java Day Taipei with a fully sold out venue. In addition to Oracle speakers like me, Steve Chin and Naveen Asrani, the event also featured a bevy of local speakers including Taipei Java community leaders. Topics included Java SE, Java EE, JavaFX and Big Data.

I delivered a keynote on Java EE 7/Java EE 8 as well as a talks on aligning the JavaScript ecosystem with Java EE 7 and using NoSQL solutions in Java EE applications. More details on the sessions and Java Days Taipei, including the slide decks and code, posted on my personal blog.

Thursday Aug 14, 2014

Spotlight on GlassFish 4.1: #5 NetBeans support

'Spotlight on GlassFish 4.1' is a series of posts that highlights specific enhancements of the upcoming GlassFish 4.1 release. It could be a new feature, a fix, a behaviour change, a tip, etc.

#5 NetBeans support

NetBeans has always had a very solid Java EE support. The next NetBeans update will introduce support for GlassFish 4.1. As usual, 2 NetBeans 8.0.1 distributions (the 'Java EE' and the 'All' bundle) will embed a pre-configured GlassFish 4.1 install to simplify things.

The exact NetBeans 8.0.1 release date is not yet known but it's certainly not too far away! In the meantime, you can always download and use the latest NB nightly build.  Technically, the support for GlassFish 4.1 is working since a few days when the NetBeans Team did the '4.0.1-4.1' switch in their code base.

Additional ressources:

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.

Tuesday Aug 12, 2014

Worldwide Virtual JMS 2 Hands-on-Lab on Thursday

I will be running a JMS 2 hands-on-lab this Thursday the 14th at 1:00 PM EST. Stephen Chin is graciously hosting the lab through his excellent NightHacking virtual worldwide meetups. The goal is to give you some first-hand experience with the primary changes in JMS 2. The lab is open to absolutely anyone.

The lab will be three hours total. In the first hour or so I'll be doing a brief presentation overviewing JMS 2 and going over the JMS 2 Javadocs. The rest of the time you will actually be writing JMS 2 code mostly by yourself but with a little bit of help from me. Whether it can be called TDD (Test-Driven Development) is debatable but you'll basically be putting in code to finish a set of JUnit tests using JMS 2, starting from incomplete code with comments on what to do (don't worry, a completed solution is also posted for you; it's also totally fine to not finish all the tests in the time allocated). Don't worry too much if you can't attend in person. I've designed the lab materials to be fairly self-guided so you can definitely use the lab materials on your own at a more convenient time. You are always welcome to reach out when needed. The following is the deck I'll be using for the lab:

The lab materials are hosted on GitHub. Make sure to at least read the setup instructions on the GitHub project read me. We will be using NetBeans 8, GlassFish 4 and Arquillian for the lab. As always, you are very welcome to use the lab materials yourself (perhaps to run the lab in your own company?) - I am happy to help if needed.

The details of the event are posted here. Hope to see you in the lab?

Monday Aug 11, 2014

Java Temporary Caching API aka JCache

Caching is a key technique for application performance and application scaling. JCache (JSR 107) officially born as the "Java Temporary Caching API" has been largely discussed over the years. The goal of JCache is to be to cache providers what JDBC is to databases, a standardized abstraction layer. And since a few months, JCache is a reality

JCache was one of the most wanted feature in the Java EE 8 community survey and is now a feature on the list of potential candidates for inclusion in Java EE 8.  We will see over the coming months how this evolves but in preparation for this, it is probably a good time to refresh your JCache knowledge. The latest edition of the the Java Magazine contains a nice article written by Johan Vos on this: "Introducing the Java Temporary Caching API" (you can subscribe to the Java Magazine for free here).

Finally, if you are attending JavaOne, you might consider to attend the following sessions :