Tuesday Dec 02, 2014

JMS 2.0 Errata release

There is a clear plan to enhance the JMS specification and that is JMS 2.1 (JSR 368), slated for inclusion in Java EE 8.  The JMS 2.1 Expert Group is still in formation phase and once this is done, the EG will start the actual works on the next revision of JMS.  This work is expected to take time, Q3 2016 is the current ETA for the Java EE 8 final release. 

But let's not forget the current version of JMS, i.e. JMS 2.0 (JSR 343).  An errata is needed to correct a few errors in JMS 2.0 which can't wait for JMS 2.1 because they affect the ability of implementers to correctly implement JMS 2.0 today.  An 'errata' is a simple kind of maintenance release intended purely to correct errors in the specification, so clearly the intention is not define any new features (any new features should be discussed within the JMS 2.1 scope).

For that reason, Nigel Deakin (JMS 2.0 and JMS 2.1 Specification Lead) has proposed and started an errata for JMS 2.0.  An Errata release (and maintenance releases in general) don’t have an Expert Group.  Nevertheless Nigel is soliciting feedback on the various small issues that he plans to have addressed in the JMS 2.0 Errata.  You can check the changes proposed for the JMS 2.0 errata on this Wiki page, the jms-spec users mailing list is a good channel to provide feedback.

Monday Dec 01, 2014

Bulk Update/Delete using the Criteria API in JPA 2.1/Java EE 7

It has long been possible to do bulk updates and deletes using JPQL in JPA. Since JPQL is closely modeled after SQL, it has the key advantages that SQL does - namely that it is a very compact and powerful DSL for relational data manipulation. JPQL is also a natural transition mechanism to JPA for folks that have worked with SQL for a while (such as myself).

The big drawback for JPQL is that it is decoupled from the Java compiler and thus less type-safe/more error-prone. This weakness becomes particularly salient while needing to dynamically construct queries at runtime (with JPQL this basically turns into a lot of hard-to-read string manipulation) or with folks coming from a Java/OO background without much preexisting experience with SQL/RDBMS. For these reasons, the type-safe, Java centric Criteria Query API was added to JPA 2.0/Java EE 6.

In JPA 2.1/Java EE 7 the Criteria API has been moved even closer to JPQL with the addition of bulk update and delete capabilities (the Criteria API in JPA 2.0 supported queries which is by far still the primary use case for the API). Hantsy Bai has a very nice post demonstrating how bulk updates/deletes look like using the JPA 2.1 Criteria API.

For a more basic overview of the Criteria API itself, you should check out the official Java EE 7 tutorial.

Tuesday Nov 18, 2014

JavaOne Replay: "Into the Wild with Servlet Async IO"

Greg Wilkins has an impressive 'Web pedigree’; he is the founder and lead developer of Jetty.  Greg is a long-time member of the Servlet Expert Group; he is also a member of the IETF HTTP/2 working group member, etc.!

During his JavaOne session, Greg gave a deep technical overview on Asynchronous IO using the Servlet API.  Greg starts by explaining what asynchronous means in the context of a Servlet. He then goes and explains the Servlet 3.0 asynchronicity support.  The rest of the talk is then spent on the Servlet 3.1 API and how to write effective asynchronous servlets (and how the inner-working of the API).  Greg also shares some of the motivations behind the Servlet 3.1 API and the technical choices behind it. Not only that, Greg is also talking about some 'potential more obvious technical options' and why those options were not selected at the end.

This technical session provides different angles (e.g. Servlet API explanations, some deep technical points such as some of the Jetty implementation details but also best practices advices, etc.).  Overall this session is highly recommended for anyone who want to understand asynchronicity in the context of the Servlet API.


You can find Greg's slides here.

Wednesday Nov 12, 2014

Java EE @ NFJS Pacific Northwest Software Symposium Seattle

As some of you may be aware I recently joined the well-respected US based No Fluff Just Stuff (NFJS) Tour. The NFJS Pacific Northwest Software Symposium was held October 17 - 19 in Seattle, Washington.

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

Monday Nov 03, 2014

Java EE @ NFJS New England Software Symposium Boston

As some of you may be aware I recently joined the well-respected US based No Fluff Just Stuff (NFJS) Tour. The NFJS New England Software Symposium was held September 19 - 21 in Boston. This is one of the larger NFJS shows and attendance at the show and my sessions was pretty good. It is always encouraging to see the same folks attend more than one talk. On my way to the show I also stopped by at the Connecticut Java User Group. The JUG is led by my friend and co-author for EJB 3 in Action Ryan Cuprak. I've spoken at the JUG a number of times over the years and it was good to be back.

I had five talks total over two days, more or less back-to-back. I did talks on Java EE 7/Java EE 8, the Cargo Tracker Java EE Blue Prints, JavaScript + Java EE, Java EE + NoSQL as well as JMS 2. More details, including slide decks and code as well as my NFJS tour schedule, posted on my personal blog.

Wednesday Oct 29, 2014

Java EE @ NFJS Greater Atlanta Software Symposium

As some of you may be aware I recently joined the well-respected US based No Fluff Just Stuff (NFJS) Tour. The NFJS Greater Atlanta Software Symposium was held September 12 - 14.

I had four talks total over two days, more or less back-to-back. I did talks on Java EE 7/Java EE 8, WebSocket, the Cargo Tracker Java EE Blue Prints and JavaScript + Java EE. More details, including slide decks and code as well as my NFJS tour schedule, posted on my personal blog.

Wednesday Oct 22, 2014

Themes/Resource Library Contracts in JSF 2.2/Java EE 7

Resource Library Contracts are one of the big ticket features in JSF 2.2. There's actually quite a bit to the feature - it allows for logical organization and packaging of the theme/look-and-feel/template for JSF pages. Beyond enabling better modularity, the feature makes it possible to switch page themes at runtime (much like PrimeFaces, RichFaces, etc did in the past). Huseyin Akdogan explains the details of resource library contracts in a code-intensive post. You should also checkout the video below from the GlassFish Videos YouTube channel in which specification lead Ed Burns covers the feature along with JSF 2.2 generally (the video is pretty short - just about fifteen minutes).

The official Java EE 7 Tutorial has a decent section on the basics of  resource library contracts as well.

Tuesday Oct 21, 2014

New book: RESTful Java Patterns and Best Practices

RESTful Java Patterns and Best Practices” written by ’Bhakti Mehta' has been recently published. One of the great thing about this book is that it is not a theoretical book covering the JAX-RS API 2.0. As its title suggest, this book is talking about different best practices that are relevant when it comes to build efficient, scalable and secure RESTful services. So the focus of the book is really on REST best practices. It then shows how you can apply the practices and patterns using the JAX-RS 2.0 APIs.

Some of the covered practices discussed are:

  • How to design and expose your resources
  • Error handling 
  • API versioning
  • Testting
  • Security
  • Caching
  • Asynchronous behaviours, etc.

Another aspect I particularly like about this book is that it also covers features that are not yet part of the standard. It should be mentioned that some of those features (e.g. SSE, JSON-Pointers, ...) will high likely be introduced in Java EE 8. So the book give some useful background material to understand why it would make sense to add those capabilities to the platform.

Finally, the book is really trying to not overload you with too many details, with too much information. For each of the discussed topic, a technical solution is presented and explained. Pointers to additional ressources are then also suggested in case you need to dig into a specific topic in more details.

All in all, this book is a nice reading for anybody designing RESTful based applications... and who isn't?

To celebrate this, Packt Publishing will raffle 10 copies of  “RESTful Java Patterns and Best Practices” (5 eBook copies and 5 paper copies). To participate, just leave a comment about the book on your preferred social media using the 'http://bit.ly/1uUs7QR' URL and the '#JavaBhakti' hashtag. PackT will randomly select 10 lucky persons.

Please do note that Oracle is not involved in this raffle, we are just relaying this information. For any question about this raffle, please contact Packt Publishing directly.

Wednesday Oct 15, 2014

Java SE 8 (and Java EE 7) Comes to WebLogic!

As many of you know one of the key features of GlassFish 4.1 was support for Java SE 8. You may be glad to hear that WebLogic 12.1.3 now is also officially certified against Java SE 8. This makes WebLogic one of the earliest major commercially supported Java EE platforms to certify for Java SE 8. Keep in mind, WebLogic 12.1.3 also supports some key Java EE 7 APIs such as WebSocket, JSON-P, JAX-RS 2 and JPA 2.1 (read this excellent Aquarium entry by my colleague Bruno Borges for details).

This means that you can start using some of the very well received Java SE 8 features such as lambdas, streams and the new Date-Time API in Java EE 6 and Java EE 7 applications even in the most demanding 24 x 7 enterprise environments. WebLogic 12.1.3 has also taken advantage of new JDK 8 features such as improved garbage collection, security enhancements and JDBC 4.2.

You can read more details in a well written blog entry by Steve Felts of the WebLogic team.

Tuesday Oct 14, 2014

JSR 339 Maintenance Release: JAX-RS 2.0 rev A

JAX-RS 2.0 (JSR 339) has been slightly revised through the JCP Maintenance Release process and has recently passed the JCP MR ballot

This update (JAX-RS 2.0 rev A) is mostly about clarifications (including JavaDoc clarifications) and some fixes in Jersey, the JAX-RS Reference Implementation. The updated documents will be published soon on the JSR 339 page but in the meantime, you can check this page for details about the changes of JAX-RS 2.0 rev A.

It should be noted that GlassFish 4.1, the Java EE 7 Reference Implementation, already supports this version of the JAX-RS specification (i.e. JAX-RS 2.0 rev A).

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!

Monday Sep 29, 2014

jBatch Suite: Visual Development for the Java API for Batch Processing/Java EE 7

As many of you know, the Java API for Batch Processing (JSR 352) is one of the key APIs added in Java EE 7. The API is largely based on POJOs, annotations and some XML. As a result you can be pretty productive even without an IDE. As a Java developer, however, like me you probably enjoy the usability of modern IDEs like NetBeans and may be wondering what IDE support there is for the Java API for Batch Processing. Although Java IDEs have been very good about supporting Java EE 7 generally, none of them have had much specific support for JBatch - until now that is. Sensing a gap Gaurav Gupta has stepped up with jBatch Suite. jBatch Suite is a NetBeans plugin that allows for both UML style modelling and code generation for Java Batch. Conveniently, it is available through the NetBeans Plugin Portal Update Center (Tools > Plugins). The following video is a great overview of the basic functionality in the plugin:

Gaurav has actually put together a very nice set of video demos covering the majority of functionality in the plugin on YouTube. The NetBeans plugin website offers further details as well as download. Contributions are welcome through the java.net project for the plugin. Enjoy!

Friday Sep 26, 2014

Kito Mann's JSF 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 Kito Mann. Kito has long been a respected JSF consultant, popular speaker, author and JCP expert. He is the editor-in-chief of JSFCentral.com, co-host of the Enterprise Java Newscast, host of the JSF Podcast interview series, and the author of JavaServer Faces in Action from Manning publications (I met him a long time ago in the process of writing EJB 3 in Action).

Kito has one the highest number of talks from a single speaker in the Java EE track this year. We wanted to talk to him about his JSF sessions at JavaOne 2014, as well as JSF generally:

The following are the sessions we talked about:

  • JSF 2.2 Deep Dive: This tutorial is a two-hour deep dive into all the new features in JSF 2.2 and is probably one of the best bits of training you can have on the technology.
  • PrimeTime JSF with PrimeFaces 5: This session is a look into what is new in PrimeFaces 5, easily the most popular part of the JSF plugin ecosystem.
  • JavaServer Faces Antipatterns and Best Practices: This is an invaluable session if you are a JSF user. Kito shares his wealth of experience as a JSF consultant and navigates the best practices, patterns and anti-patterns for the technology.
  • Mobile JavaServer Faces: This is a deeply well researched session on the available resources for developing mobile applications using JSF. If you are a JSF user being asked to develop mobile functionality, this session is definitely for you.
  • JSF 2.2 in Action: In this one hour session, Kito will overview the features introduced in JSF 2.2 using demos and real life context.

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

Wednesday Sep 17, 2014

JMS 2 Hands-on-Lab Video and Materials

I ran a virtual JMS 2 hands-on-lab on August 14th. Stephen Chin graciously hosted the lab through his excellent NightHacking virtual worldwide meetups. The goal of the lab was to give attendees some first-hand experience with the primary changes in JMS 2. In the first hour or so I did a brief presentation overviewing JMS 2 and went over the JMS 2 Javadocs. The rest of the time attendees actually wrote JMS 2 code mostly by themselves. There was also some pretty good interaction and Q&A throughout the lab. The entire lab was video recorded and is available below. The slides I used are available on SlideShare.

The lab materials are hosted on GitHub for anyone to use. The lab uses NetBeans 8, GlassFish 4 and Arquillian. I've deliberately designed the lab materials to be fairly self-guided so you can definitely use the lab materials on your own (or perhaps even run the lab in your own company/JUG?) . You are always welcome to reach out to me when needed.

Whether it can be called TDD (Test-Driven Development) is debatable but in the lab 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 :-)).

Thursday Sep 11, 2014

Antoine Sabot-Durand's CDI 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 Antoine Sabot-Durand. Antoine is the newly minted CDI specification lead. In the short time that he has been at Red Hat, he has already had the CDI 1.2 specification under his belt and he has already started work for CDI 2 (CDI 2 is a major overhaul of the specification targeted for Java EE 8). I have known about Antoine since he worked on Agorava, a social media module for CDI/Java EE. Besides working on the CDI specification, he is also responsible for the CDI ecosystem at Red Hat - currently focused on DeltaSpike.

We wanted to talk to Antoine about his CDI sessions at JavaOne 2014:

Antoine has several sessions on the track that he talked about:

  • Introducing Contexts and Dependency Injection: This is essentially a CDI primer for folks that are still newcomers or evaluating. It's probably worth attending as a refresher even for more experienced folks.
  • Going Farther with CDI 1.2: This is a slightly more advanced session talking about less commonly used features as well as the changes in CDI 1.1/CDI 1.2. The CDI ecosystem generally is also covered.
  • The Path to CDI 2.0: This is essentially a CDI futures talk. It's probably the best way to find out what is in the works for CDI 2.
  • CDI 2.0 BOF: This informal Birds-of-a-Feather session is a rare chance for you to interact directly with the folks leading the CDI specification and share your ideas, questions and feedback. It's probably the best and easiest way for most folks to contribute directly to the CDI specification.

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