Tuesday Oct 29, 2013

*raine Trip Report (Lorraine & Ukraine)

Last week, I had the opportunity to talk about Java EE 7 in Nancy (Lorrraine - France) and Kiev (Ukraine).
The first event was arranged by the local Lorraine JUG while the second one was a largest conference organised by the Ukraine Java User Group. Based on the overall feedback and discussions I had during those two events, it is clear that the WebSocket API (JSR 356) is really a hot topic.

And travel issues aside, I have really enjoyed my time during those two events. Thanks to both JUGs for having me!

A more detailed report can be found on my personal blog.

Thursday Oct 17, 2013

How You Helped Shape Java EE 7...

For many of us working with the JCP for years, the commitment to transparency and openness is very clear. For others, perhaps the most visible sign to date of this high regard for grassroots level input is a survey on Java EE 7 gathered a few months ago. The survey was designed to get open feedback on a number of critical issues central to the Java EE 7 umbrella specification including what APIs to include in the standard. The survey was highly successful with a large number of high quality responses.

With Java EE 7 under our belt and the horizons for Java EE 8 emerging, this is a good time to thank everyone that took the survey once again for their thoughts and let you know what the impact of your voice actually was. I've posted the details on my personal blog. I hope you are encouraged by how your input to the survey helped shape Java EE 7 and continues to shape Java EE 8. Maybe now is the time for you to get more involved :-)?

Tuesday Oct 15, 2013

Securing WebSocket Endpoints

As you know, WebSocket is a key capability standardized into Java EE 7. When I talk to developers, many wonder how WebSockets are to be secured. One very nice characteristic for WebSocket is that it in fact completely piggybacks on HTTP. This means that all the well-understood ways of securing web applications instantly applies to WebSocket including SSL/TLS, Basic Authentication, Digest Authentication, LDAP, role based authorization and all the robust security infrastructure built into modern application servers like GlassFish and WebLogic. In a brief blog post, Pavel Bucek demonstrates how to secure WebSocket endpoints in GlassFish using TLS/SSL. Besides the server-side, he also includes a secure client side code example using the wss: protocol.

For a more complete example, you could look at the code for my joint JavaOne 2013 session with Ryan Cuprak and Bala Muthuvarathan titled "Android and iOS Development with Java EE 7". Do let me know if you need more detailed coverage focused on the topic, I will be happy to put something together on my personal blog.

Monday Oct 14, 2013

A Realistic JBatch 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. A very well written recent blog post on the AMIS technology blog does exactly that for the JBatch API standardized in Java EE 7. The author uses JBatch features such as the Job Specification XML, chunked processing, parameter passing, batchlets, job/step listeners, the job context and integration with Java EE in a non-trivial fashion to create an online download manager. I would say if you are interested in JBatch, the blog entry is almost a must read and perhaps one of the best ones written on JBatch so far.

At JavaOne 2013 IBM Distinguished Engineer Brian Martin presented a very useful session on JBatch titled "Three Key Concepts for Understanding JSR 352: Batch Applications for the Java Platform". Stay tuned to Parleys.com for video of the session to be published. The well-written official specification is also a great place to learn more about JBatch.

Friday Oct 11, 2013

Free Java EE 7 Talk via GlassFish User Group/JAX London

Some of you may be aware that the London GlassFish User Group got launched a few months ago. The group is organized and sponsored by C2B2 Consulting. Their very first meeting (on JMS 2) was led by Nigel Deakin, the UK based JMS specification lead.

The group now has organized their second meeting in partnership with JAX London 2013 Community Night on October 29. The meeting will feature an introduction to Java EE 7 with Arun Gupta. Note that the event is free, so you really should not miss it if you are in the greater London area. You can register for the meeting via JAX London or the London GlassFish User Group meet up page.

Further details on the event is posted on the C2B2 site. I did mention the event is free right :-)?

Thursday Oct 10, 2013

GlassFish and Friends Party Photos!

As you may know, the now iconic GlassFish and Friend Party took place 8 PM - 10 PM, Sunday, September 22nd at the much coveted Thirsty Bear on the first day of JavaOne 2013. As with previous years, it was a great success with a full house, old friends, new friendships, good conversations and a good time. The photos below speak for themselves (many thanks to Bruno and Arun for taking them):

Just some of the folks attending included Adam Bien, Alexandra Huff, Alexis MP, Anil Gaur, Arun Gupta, Ben Evans, Blaise Doughan, Bruno Borges, David Delabassee, David Heffelfinger, Doug Clarke, Ed Bratt, Ed Burns, Edgar Martinez, Heather VanCura, Jaromir Hamala, Johan Vos, John Clingan, Kerry Wilson, Kirk Pepperdine, Ludovic Champenois, Makito Hashiyama, Mark Heckler, Martijn Verburg, Melissa Jacobus, Mike Lehmann, Murat Yener, Nigel Deakin, Patrick Curran, Paul Sandoz, Rajiv Mordani, Romain Grecourt and Shaun Smith. Regrettably, I could not be there myself this year. Perhaps next year we will see you at the party?

Stay tuned for the videos/slide decks from the GlassFish stories, roadmap and executive panel from the GlassFish Sunday Community event...

Wednesday Oct 09, 2013

Using NoSQL with EclipseLink and JPA?

NoSQL is obviously a hot topic in the enterprise these days, at least at the water cooler if not in the production data center. The momentum is such that despite being seen as a stalwart of relational databases, Oracle too has entered the NoSQL ecosystem with Oracle NoSQL. Naturally, the question of how to use NoSQL databases in Java EE applications (specifically existing Java EE 5 and Java EE 6 applications) comes up all too often. As it so turns out there are a number of very interesting initiatives out there to radically simplify the usage of NoSQL databases in Java EE applications by creating JPA based facades over them (strictly speaking, JPA as it stands today is not intended to support NoSQL from a purely standards standpoint). Such efforts include one from non other than the team behind the Oracle JPA reference implementation EclipseLink. In a code driven blog post, Huseyin Akdogan demonstrates how to use MongoDB using EclipseLink NoSQL. You are also welcome to check out my own slide deck covering using NoSQL databases in Java EE with or without a JPA flavored API (using just plain CDI):

Interestingly, NoSQL support featured quite prominently in the results of a survey around JCP standards put together by the London Java Community (LJC). It would be interesting to hear your thoughts as well.

Robert Greene, John Bracken and Shaun Smith held both a technical session titled "Building Oracle NoSQL Database Applications with EclipseLink" and a BOF titled "Java Persistence for NoSQL" at JavaOne 2013 on this topic. Stay tuned to Parleys.com for the video recordings of the sessions.

Tuesday Oct 08, 2013

JavaOne 2013 Trip Report

JavaOne 2013 San Francisco was held September 22-26. This was a particularly important year from a Java EE standpoint with the release of EE 7 and GlassFish 4 - the content reflected this fact. JavaOne 2013 can certainly be considered a success by most measures. It's clear the best and the brightest in the Java ecosystem continue to see participating in JavaOne as a badge of honor and a privilege.

Besides booth duty at the GlassFish 4/Java EE 7 kiosk on Monday/Tuesday, I led the GlassFish Community Event on Sunday, had a BOF titled "What’s New with Bean Validation and Expression Language in Java EE 7" on Monday, led the GlassFish BOF on Tuesday and had a technical session titled "Android and iOS Development with Java EE 7" on Thursday. More details on the sessions and JavaOne, including the slide decks and code, posted on my personal blog.

Monday Oct 07, 2013

Admin Command Framework Enhancements and Background Command Execution in Glassfish 4

The main focus of the GlassFish 4 release clearly is providing a Java EE 7 implementation that developers can use right away. However, besides Java EE 7 a small number of important changes were included in GlassFish 4. These changes include Admin Console enhancements, background execution support for long running commands, better support for REST/SSE in the administration API, log format changes, domain configuration defaults and better OSGi administration. In a detailed blog post, Bhakti Mehta describes two of these changes - Admin Command Framework enhancements to better support progress notification via SSE and support for executing admin commands in the background. We discussed some of the GlassFish 4 specific features during the JavaOne 2013 GlassFish BOF (slides below).

Martin Mares and Chandra Patel also went through the changes in detail using demos during their JavaOne technical session titled 'GlassFish 4 Overview: What’s Under the Hood?'. The presentation will be available soon on Parleys.com.

Thursday Oct 03, 2013

Default CDI Enablement in Java EE 7

As you may already know, in Java EE 6, you needed to explicitly add a beans.xml file in your application archive in order for CDI scanning to work. Because DI is correctly considered such a pervasive concern, Java EE developers often found this requirement confusing. In my personal experience, eight times out of ten when someone asked me "why CDI is not working", it was because they had not added beans.xml in their application.

One of the most significant changes in CD 1.1/Java EE 7 is that by popular request, CDI is now enabled by default. This means that there's no need to explicitly add a beans.xml to enable DI any more. However, it is also very important to understand that CDI now also provides finer grained control over component scanning via the 'bean-discovery-mode' attribute. This attribute has three possible values:

  • 'annotated' - loosely translated, means that only components with a class-level annotation are processed.
  • 'all' - all components are processed, just like they were in Java EE 6 with the explicit beans.xml.
  • 'none' - CDI is effectively disabled.

By default, if you specify nothing and there is no beans.xml, the bean discovery mode of 'annotated' and not 'all' is assumed. This is probably fine for the vast majority of real world applications. However, if you are in fact using beans without class level annotations (which I sometimes do when it makes sense), you'll need to explicitly enable 'all' in a beans.xml like this:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
       http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
       bean-discovery-mode="all">
</beans>

As you can imagine, bean-discovery-mode='none' comes in very handy if you have another DI system that uses JSR 330 annotations such as Guice or Spring. In GlassFish 4, you also have the option of turning off implicit CDI scanning if you want. You can do this using the new 'implicitCdiEnabled' property like so:

asadmin deploy --property implicitCdiEnabled=false <archive>

Beyond the bean discovery mode, CDI 1.1 comes with other finer grained controls over scanning as well which you should explore via the fairly readable official specification itself.

Tuesday Oct 01, 2013

Your Opinion Needed: Help Shape Oracle Java EE Certifications

As many of you know, Oracle has a pretty successful certification program around Java EE. The program is now being expanded to cover Java EE 7. To help focus the certification material to real world Java EE 7 development needs, the folks behind the certification program are trying to do a survey to best understand Java EE 7 usage (or potential usage) patterns and roles. This is a great opportunity for you to ensure that all of your peers (and perhaps even you) can go through a high quality certification program that's actually useful beyond getting a piece of paper. Below are some loose guidelines as to who the survey is really targeting (keep in mind none of this is hard-and-fast and the real point is getting useful input).

  • Currently working with Java EE 7 or have plans to develop with Java EE 7 in the near future.
    • Ideal candidates have 2-4 years experience with the previous Java EE technology versions.
    • Should be well-versed in development trends.
  • Recruiting and/or hiring candidates to develop Java EE 7 applications.
    • Ideal candidates have 2-4 years experience hiring Java developers into a variety of roles, including front-end and server-side development.
    • Should be technically savvy and be able to articulate the skills and knowledge they believe are required to staff successful Java EE front-end and server-side projects.
    • Should have an opinion about the direction the industry is headed.

The survey is not long - it'll take you about 10-15 minutes to complete. It will be open until the end of November and any input you have will be worth it's weight in gold :-). You can take the survey on SurveyMonkey.