Wednesday Jan 29, 2014

Survey Sez: Java EE 7 Adoption Looking Pretty Good!

Java.net editor Kevin Farnham is at it again - he posed yet another pretty bold opinion survey on Java EE and got some pretty surprising answers. The question this time was simple but profound - How much impact has Java EE 7 had on your work thus far?. Surprisingly, a majority of responders (55%) are already seeing Java EE 7 adoption or expect to see it soon. Keep in perspective, Java EE 7 was released June of last year - all but about half-a-year ago! Below is a rough graph representation of the results as well as the actual breakdown:

How much impact has Java EE 7 had on your work thus far?

  • 17% - Significant: I'm working with Java EE 7 on a regular basis
  • 19% - Some: I'm starting to work with Java EE 7 increasingly
  • 2% - Slight: I don't use it myself, but I work with developers who do
  • 17% - None yet, but I expect Java EE 7 will impact some of my work soon
  • 19% - None: all of my Java EE work will remain on earlier versions long into the future
  • 20% - None, because all of my work is completely unrelated to Java EE
  • 6% - Other

It's of course hard not to think this is good news. As such, I suspect most Java.net readers probably have a slight tilt towards EE or at least are pretty well informed about EE. The overall sample size is also pretty small - 149. Having spent a few years working in the enterprise, my own gut reaction on this is that folks like us, the JBoss/WildFly/TomEE communities, and so many others are doing a much better job at getting the Java EE word out there than we collectively perhaps have in the past. I think it's fairly self-evident that we still have a lot of work ahead of us, particularly with things like the WebLogic and WebSphere communities.

Regardless of the ultimate time lines, the vectors seem to be pointing in the right direction even from a quick look at Google trends. Java EE fans should take a moment to rejoice, look to getting EE 7 adopted in their organization, start thinking about what they want from EE 8 and let us know their thoughts :-).

For folks interested, Kevin detailed the poll with a pretty good write-up.

Tuesday Jan 28, 2014

Using updated release of Jersey, Tyrus, Weld, ... in GlassFish 4

The Java EE specification is an umbrella specification that refers to different components specifications, aka components JSRs (e.g. Servlet, JMS, JAX-RS, ...). And as the Java EE 7 Reference Implementation, GlassFish 4 is made of those different components JSRs Reference Implementations. 

In addition to the specification, most of those implementations (eg. Jersey) also offers additional features (and fixes). And clearly, the different implementations that make GlassFish are evolving each at a different pace. Jersey (JAX-RS RI), Tyrus (WebSocket RI), Weld (CDI RI), Mojarra (JSF RI) are examples of implementations that evolves rapidly. GlassFish 4.0 embeds Tyrus 1.0, Jersey 2.0, Mojarra 2.2.0 and Weld 2.0.0.SP1 but since that time, those implementations have evolved quite a lot. As of today, the current release of Tyrus is 1.4, the current release of Jersey is 2.5.1, the current release of Weld is 2.0.5 and the current release of release of Mojarra is 2.2.5.

So what to do if you want to use one of the new features provided by one of those implementations in GlassFish 4? One way is to wait that the specific version of that implementation, say Jersey for example, is integrated in a nightly build of the GF 4.0.1 branch. Another solution is to upgrade the specific implementation (e.g. Jersey) in an existing GlassFish 4 setup. The following posts explains how to update Tyrus, how to update Jersey, how to update Weld and how to update Mojarra in a GF4 setup. 

It should be mentioned that no extra testing has been done, so clearly do not do this in any critical environments. And if the updated setup is not stable, it is always easy to come back to the initial configuration. Most of the time, it's just a matter of putting back the original implementation Jar and restarting GlassFish. For Jersey, the provided update script is able to restore the initial configuration if needed. 
Also, since Jersey has dependencies on HK2 and since HK2 has been updated between GF 4.0 and the 4.0.1 branch, it is only possible to update Jersey in a GlassFish 4.0.1 build.

In any cases, if you are using GF 4 with an updated version of Tyrus, Jersey, Mojarra or Weld, we would like to hear your feedback!

Monday Jan 27, 2014

Tyrus/WebSocket Client on Android

At JavaOne San Francisco 2013 Ryan Cuprak, Bala Muthuvarathan and I presented a full-house session titled Android and iOS Development with Java EE 7. Ryan is the leader of the Connecticut JUG, a close friend and my co-author on the upcoming second edition of EJB 3 in Action. Bala is a friend and former colleague from CapTech Consulting. We picked the topic as we thought there was surprisingly little content on the topic despite the fact that many people use JAX-RS/Java EE as a mobile back-end platform today and Java EE 7 is an even stronger candidate for this development model. You can check out video for the event below. The demo code for the session is available on GitHub and the slide deck is available on SlideShare. One of the surprising things we came across is that Android still has very weak support for WebSocket development. As a result, I thought it would be great if the WebSocket client APIs standardized in Java EE 7 would work on Android, so I entered a JIRA issue against Tyrus asking for such support.

Some of you might be very pleasantly surprised that the Tyrus team actually addressed the issue! You can read the details of the initial work on Pavel Bucek's blog, including a sample application. If you find the feature useful, I would encourage you to explore the work further, share your thoughts on the Tyrus mailing list or via JIRA. You could even contribute to the sample code for the JavaOne talk :-) (currently the code uses the Autobahn Android library).

Friday Jan 24, 2014

"Come and Play! with Java EE 7" by Antonio Goncalves

Command-line based code generators are one of the most significant selling points of frameworks like Play! and Ruby on Rails. Spring Boot and Spring Roo are efforts along the same lines. Most seem to assume such solutions do not exist for Java EE. In reality, Forge has provided pretty nice command -line Java EE code generation capabilities for a little while now. seam-gen, Forge's predecessor did the same.

Java Champion, Paris JUG founder, JCP expert, author and key Java EE advocate Antonio Goncalves has been trying hard to build awareness of Forge and Java EE through his very cool "Come and Play! with Java EE 7" talk. On January 9th, Antonio was kind enough to deliver the talk at the London GlassFish User Group. Check out the cool video of the talk below:

In the first part of the session, Antonio also delivered a truncated version of his other cool talk - 50 New Features of Java EE 7 in 50 Minutes. The extensive slide deck for the talk is posted on SlideShare. All the details of the event are posted here.

Note while Forge is great, it is by far not the only option for Java EE code generation. NetBeans wizards and springfuse.com include some other options.

Wednesday Jan 22, 2014

JSF 2.2 View Actions

View parameters and pre-render view event listeners were two of the key features added in the JSF 2.0/2.1/Java EE 6 time frame to improve bookmarkability and HTTP GET support. However, the problem with the pre-render view event is that it is triggered both when the view initially loads as well as on all subsequent JSF post backs. This makes it harder to use for the common pattern of looking at passed-in page parameters (usually in the URL query string) and doing some page initialization only once. You could get around this by putting in an explicit post back check in your listener, which is often hard to miss and somewhat hard to understand. As a result, the Seam 3 Faces module added a more focused and powerful view action component.

The good news is that JSF 2.2 standardizes the popular Seam 3 view action feature all but as-is. Hantsy Bai explains the very useful new feature well, including a good bit of technical detail.

Friday Jan 17, 2014

Java EE 7 Event at the Nanjing Software Valley, China

On January 11th, a large Java EE 7 event was held in the Nanjing Software Valley China jointly organized by the China (Nanjing) Software Valley Joint Management Committee and the Nanjing Java User Group. About 80 people from 15 different IT enterprises attended the highly successful event. Speakers included Nanjing JUG founder Tang Yong, Oracle China's Jim King and GlassFish committer Zhou Rong Hui.

Tang Yong blogged about the event in detail. Besides founding the Nanjing JUG Tang Yong is a key GlassFish committer outside Oracle and avid Java EE advocate in China. We can all expect to see great things from the Nanjing JUG and Tang Yong in the new year :-).

Thursday Jan 16, 2014

GlassFish commercial supported versions - January updates

Last november Roadmap Update covers different topics such as the fact that GlassFish remains open source, that there won't be a commercial version of GlassFish 4. But an other important topic addressed in that announcement is the fact that Oracle continues to commercially support GlassFish v3 for the years to come. In fact, the now old Sun Java System Applications Server 8, who predated GlassFish, is still commercially supported too! 

So on the commercial support front, it is business as usual. Oracle has just released Oracle GlassFish Server Bundle Patches 3.1.2.8, Sun Java System Application Server 8.1.36 and 8.2.20. Customers with a valid support contract can get those different updates on My Oracle Support. This GlassFish 4 Business entry has all the details including the different Patch ID's, the addressed issues, etc. 

Wednesday Jan 15, 2014

Java EE/GlassFish is Tops (on SlideShare :-))!

It seems Java EE/GlassFish is topping charts - well, at least on SlideShare anyway :-). As many of you know, our team has quite a bit of content published on the popular SlideShare site, including on the official GlassFish account and my personal account. An extremely large amount of folks use that content - I didn't realize just how large until today. The GlassFish account is among the top 5% of all content viewed on SlideShare, while my personal account is in the top 1%.

Below is a list of the top ten content we have on these accounts:

  1. What’s New in Java Message Service 2 - 22,889 views.
  2. Building Java HTML5/WebSocket Applications with JSR 356 - 22,036 views.
  3. Fifty Features of Java EE 7 in 50 Minutes - 19,994 views.
  4. JavaEE.Next(): Java EE 7, 8, and Beyond - 19,857 views.
  5. JSON-P - 15,747 views.
  6. Using NoSQL with JPA, EclipseLink and Java EE - 14,429 views.
  7. JAX-RS 2: New and Noteworthy in the RESTful Web Services API - 13,881 views.
  8. Java EE Concurrency Utilities - 9,549 views.
  9. Java Batch - 9,251 views.
  10. Applied Domain-Driven Design Blue Prints for Java EE - 7,507 views.

This of course is in addition to the many folks that interact with us at conferences, Java user groups, on Twitter, on this humble community blog, on JavaLobby/DZone and so on. I want to thank you for listening to us and look forward to continue to generate newer content that's useful to you. I also want to assure you that it is a privilege and I know the team is always eager to hear from you as to what can be done to keep the Java EE and GlassFish communities moving forward.

Monday Jan 13, 2014

Java EE 8 Community Survey - Part 2!


During the last 5 weeks, we have been positively surprised by the community responses on the first part of the survey. We have received a lot of valuable feedback! That means we have *a lot of data* to process, a really nice problem to face! Thanks to all who participated in Part 1! If you haven't, there still time to answer Part 1.

Part 2 of the survey is focusing on topics such as Cloud, Security, Logging, Deployment, Testability, etc. We are again soliciting your feedback on those different topics.

In a few weeks from now, once the results of the 2 parts have been distilled and summarized, we will share those results with the community. The next step would then be to ask you to help us prioritize those features.

Thanks in advance for helping us to set the initial directions of Java EE 8 by participating in Part 2 of the Community Survey.

Thursday Jan 09, 2014

Some Tyrus updates


Project Tyrus is the JSR 356 (Java API for WebSocket) Reference Implementation. As JSR 356 is part of Java EE 7 (Web Profile and the Full Java EE Platform), Tyrus is embedded in GlassFish 4. In addition, Tyrus *should* also run on any Servlet 3.1 compatible container.

Tyrus 1.0 was released mid 2013 when the JSR 356 specification went final. Since then, the work on Tyrus hasn't stopped and this is also true for other implementations such as Jersey for JAX-RS, Mojarra for JavaServer Faces, etc. For example, no less than 2 updates of Mojarra were released this week (2.2.5 & 2.1.27) but more on JSF later and back to Tyrus...

Here are some of features and improvments that were recently added to Tyrus :

Wednesday Jan 08, 2014

Java EE@JogloCon

On December 27th, I did a virtual session via Google Hangout on the Java API for WebSocket (JSR 356) for JogloCon 2013. Organized by JUG Joglosemar, JogloCon is one of the largest Java conferences in the Yogyakarta area of Indonesia. This year, the conference focused on everything Java EE! Yosi Pramajaya and Deny Prasetyo of the JUG Joglosemar did an excellent job putting the conference together. This was JUG Joglosemar's first event after it's resurrection in 2013. The event was a full-house with over 200 registering. Enjoy the slideshow below of the conference:


Created with flickr slideshow.

The slide deck for my talk is available here. You can also take a look at the video of WebSocket specification lead Danny Coward's JavaOne 2013 talk on Parleys.com:

Let's hope to see great things from JUG Joglosemar, Yosi Pramajaya and Deny Prasetyo in the New Year!

Friday Jan 03, 2014

Getting Started with EL 3

EL 3 is one the APIs that has gone through a major overhaul in Java EE 7. In fact, EL is now finally a specification on its own right after long being an important API for JSTL, JSP, JSF and CDI. Most folks in the ecosystem are just beginning to realize the full significance of this. EL 3 opens up the possibility of using the power of a standard expression language in new and innovative ways in frameworks and applications much like the way Bean Validation 1.1 now utilizes EL. Just some of the changes in EL 3 includes a stand-alone API, powerful new operators, static field and method references, lambda support (essentially ahead of Java SE 8) and much, much more. Servlet 3.1 specification lead Shing Wai Chan handily demonstrates how some of the EL 3 features fit together in an excellent blog post. The code example calculates a standard deviation three different ways using various EL 3 features inside a Servlet. The blog post is really a great place to get started with learning EL 3. You can also check out Ed Burns and Kin-man Chung's JavaOne 2013 session on EL 3 via Parleys:

The slide deck for the session is available on the JavaOne content builder. It may be particularly interesting to relate the content of the slide deck back to Shing Wai Chan's blog entry.

Thursday Jan 02, 2014

Java EE@Peru JUG

On December 19, I did a virtual meetup via Google Hangout with the Peru JUG on the Java API for WebSocket (JSR 356). The relatively young Java user group is led by it's very capable leader Jose Diaz. Heather VanCura of the JCP was very kind in connecting the dots for this meeting (the Peru JUG is an active participant for Adopt-a-JSR). My colleague Bruno Borges also helped plan the event. Even despite the Holiday season, the meeting went quite well. In absence of the of the regional JavaOnes, virtual meetups like this one are a very effective way of engaging our global community. The video capture of the virtual meetup is below. The slide deck is available here.

Do drop me a note if you, your company or your JUG is interested in having a similar virtual meeting on any Java EE related topic. As daunting as it may initially sound, virtual meetings are surprisingly easy, hiccup free and still relatively personable.

Tuesday Dec 31, 2013

Using Socket.IO with the Java API for WebSocket?

If you have looked into how to use WebSocket with emergent JavaScript frameworks like Angular, Backbone, Ember or Knockout, it's very likely you've come across Socket.IO. While Socket.IO is a very useful library, it is mostly geared towards Node.js and significantly different from plain WebSockets as defined by the IETF and the W3C as well as the JCP/JSR 356 (the Java API for WebSocket). However, with a little bit of hacking, it's not too hard to get the Socket.IO client library to work with the Java API for WebSocket.

Lee Chuk Munn from the Advanced Technology Applications Practice for the National University of Singapore, Institute of Systems Science describes the problem space well and shows you how to hack a basic solution. Chuk plans on working on a framework that builds a more complete solution to marry Socket.IO and JSR 356. He used GlassFish 4 and NetBeans 7.4 for his work. Does this inspire you to hack a framework on top of JSR 356, join Chuk in his efforts or contribute to the GlassFish community in the New Year :-)?

Friday Dec 27, 2013

A Realistic JSF 2.2 Faces Flows Example

While very basic introductory examples are invaluable in explaining a new API, they can fail to do a rich API justice - especially from the perspective of more experienced developers. For some of us, looking at a slightly more involved, realistic example can shed far better light on the practical value proposition for a technology.

Faces Flows are one of the best hidden gems in Java EE 7. Standardized in JSF 2.2 they enable web application flow state management in an elegant, declarative fashion. In an excellent blog post, Liferay Faces project lead and JSF 2.2 expert group member Neil Griffin takes an in-depth look at Faces Flows. He explains the motivation for the feature, contrasts it with the Java EE 6/CDI 1.0 conversation scope and demonstrates the feature using a very realistic use case and non-trivial example code. There's also the video of Ed Burns and Roger Kitain's JavaOne 2013 JSF 2.2 talk on Parleys.com:

The source slide deck for the talk - titled JSF 2.2 New Features in Context is posted on the JavaOne Content Catalog. Make sure to check out the other great JavaOne 2013 sessions on Parleys.com too!