Wednesday Feb 03, 2016

Migrating from Java EE 5 to Java EE 7 at Segurnet Portugal

One of the most important things to do at this stage of the life-cycle of Java EE is highlight successful adoption stories at a regular cadence. We have been doing just that for a long time through our adoption stories blog, this humble blog as well as JavaOne. Indeed JavaOne 2015 was particularly good in this regard. We had a number of solid adoption stories submitted that we could select from. We will highlight all of those stories here in the coming months. A particularly nice adoption story presented at JavaOne 2016 was from Segurnet Portugal on migrating from Java EE 5 to Java EE 7.

Segurnet is a data sharing platform for key insurers in Portugal. It used by 65 companies, about 30,000 users with close to 1.5 million page views and over 3 million server requests. Roberto Cortez detailed how the platform was recently migrated from legacy Java EE 5 to Java EE 7 - showing specific code examples. As the end result of the migration Roberto noted latest technology adoption, improved standardization, simplicity, a net reduction in code, an increase in productivity, faster deployment times and better performance. Roberto's experience is typical for anyone considering such a migration. You can view the session below (click here if you are having trouble seeing the embedded video).

The slide deck for the talk is available on SlideShare. For those unaware, Roberto is a passionate Java EE advocate, frequent speaker, blogger and JUG leader. He now works on the TomEE Java EE application server.

If you have a similarly great Java EE adoption story to share with the community (particularly migration stories from other technologies), please do feel encouraged to reach out. In the spirit of Java EE centric vendor neutrality, what Java EE implementation or tool set you choose does not matter at all and neither does which part of the globe you are in.

Thursday Jan 21, 2016

AngularBeans: Java EE 7/CDI Integration with AngularJS

In the highly volatile world of JavaScript frameworks, AngularJS has managed to maintain a lead at least for now. The good news for Java EE developers is that Java EE generally and Java EE 7 in particular works extremely well as a back-end for frameworks like AngularJS. To see why this is you need not look much farther than my talk on the topic and the corresponding example code (the code is deliberately self-contained with setup instructions so that you can explore it in detail on your own).

One of the drawbacks of the JavaScript rich client approach is that it often involves some boilerplate code that does not exist in server-side web frameworks due to the remote communication layer involved. To borrow concepts from the old J2EE design patterns, this boilerplate involves the creation and maintenance of DTOs (Data Transfer Objects) and remote proxies, not to mention the plumbing code necessary for the remote communication.  If you look carefully at my code example the boilerplate is not that hard to spot.

One way of avoiding this boilerplate is a tight binding layer with the underlying back-end technology that automatically generates the DTO, remote proxy and remote plumbing parts. In the process the binding layer can bring a lot of interesting back-end features forward to the client as well.

Fortunately for the Java EE ecosystem, my Tunisian friend Bessem Hmidi has formulated just such a solution focusing on CDI as the back-end component model. He has aptly named his project AngularBeans and the project is now on GitHub for everyone to use. I am very happy that we were able to host Bessem at JavaOne 2015 to talk about the project. In his session he explained the basic motivation for AngularBeans, discussed the features he has implemented so far and did quite a bit of live coding in the process! You can view the session below (click here if you can't see the embedded video).

The session really speaks volumes as to the power of the solution and why it is a very valuable part of the CDI/Java EE ecosystem. The project is at a very early stage, so this is a great time to get involved, evaluate the project and perhaps even contribute.

Wednesday Jan 13, 2016

Hypermedia/HATEOAS Support in JAX-RS 2/Java EE 7

The concepts of Hypermedia and HATEOAS (shorthand for the mouthful of "Hypermedia as the Engine of Application State") have made the rounds in the REST ecosystem for a little while now. If you Google around a bit you'll find no shortage of arcane academic-sounding text describing it's supposed universal virtues. For the rest of us a simple explanation is that it is an attempt to utilize web page style links in REST based web services. Using the hypermedia concept, you can send the client links for what they may be able to do further after receiving a REST response. A simple example is including links for canceling or getting details for an order in addition to a confirmed order object probably retrieved via a GET request. Although less common, links can also be embedded as data within the response. An example would be embedding a link to retrieve the delivery address in the order data body instead of embedding the actual address body or an address ID. Finding a reasonably down-to-earth, unpretentious explanation of Hypermedia was shockingly difficult. The best I could find is the humble documentation for the PayPal Payment REST API that makes real world use of Hypermedia.

In practical terms Hypermedia helps make clients more flexible by avoiding hard-coding REST URLs. It can also help in self-documenting REST APIs. If you look around on the web it is an open question whether these purported benefits are actually worth the additional implementation complexity. Hypermedia may be best applied in a situation when you are developing a public API where you do not know much about potential users of the API. The PayPal Payment REST API is a good example of such a case.

The good news is that if you have a good use case for Hypermedia Java EE 7 adds support for it via JAX-RS 2. Sam Sepassi recently did an excellent write-up detailing the newly added API. It is far and away the best write-up that exists on the topic. He includes a brief explanation of Hypermedia including example code using JAX-RS 2. He also included some details on experimental work that is being done in the Jersey JAX-RS RI to include support for declarative Hypermedia (the Hypermedia APIs added in JAX-RS 2 are basically programmatic).

Enjoy and feel free to share with anyone that you might think would find this useful.

Monday Jan 11, 2016

Java EE in Practice at Lufthansa Industry Solutions

One of the most important things to do at this stage of the life-cycle of Java EE is highlight successful adoption stories at a regular cadence. We have been doing just that for a long time through our adoption stories blog, this humble blog as well as JavaOne. Indeed JavaOne 2016 was particularly good in this regard. We had a number of solid adoption stories submitted that we could select from. We will highlight all of those stories here in the coming months. A nice JavaOne 2016 session to start with is the one from Lufthansa industry solutions.

Lufthansa industry solutions develops systems both internally at Lufthansa as well as for external customers. They chose to standardize on Java EE to ensure consistency throughout a large number of systems. The session explains what the organization does, it's architectural approach and why they chose Java EE. The session also dives into some interesting details on two different Java EE applications (one still using Java EE 6 and one already on Java EE 7) that Lufthansa industry solutions developed for clients. The session touches upon how Java EE applications can take advantage of most of the practical benefits of microservices without the added complexity. The applications use a mix of WildFly and JBoss EAP along with other JBoss ecosystem projects like Hibernate Envers, Hibernate Search, Drools. The applications also used ICEfaces and PrimeFaces (the older Java EE 6 application used ICEfaces while the newer Java EE 7 application uses PrimeFaces). You can view the session below (click here if you are having trouble seeing the embedded video).

If you have a similarly great Java EE adoption story to share with the community (particularly migration stories from other technologies), please do feel encouraged to reach out. In the spirit of Java EE centric vendor neutrality, what Java EE implementation or tool set you choose does not matter at all and neither does which part of the globe you are in.

Tuesday Jan 05, 2016

Java EE @ Java Day Mexico

Java Day Mexico 2015 was held on August 29 in historic Guadalajara. I was truly honored to be invited to speak here and this is a very fitting first trip report of the year. Java Day Mexico is the largest Java developer conference in Mexico and it is led primarily by Mexican JUGs. This was another highly successful year for the growing conference. Speakers included Venkat Subramaniam, Pratik Patel, Bruno Borges and Heather VanCura. Topics included Java SE, Java EE, HTML5, JavaScript, architecture, JVM languages, mobile and the cloud.

I had five talks total, essentially back-to-back. I did talks on Java EE 7, Java EE 8, real world microservices with Java EE, aligning Java EE with JavaScript/HTML5 rich clients and open standards. More details, including slide decks and code, posted on my personal blog.

Monday Jan 04, 2016

Adam Bien Impressed by Java EE 7 Support in WebLogic

As many of you are aware WebLogic 12.2.1 now offers full Java EE 7 commercial support. Recently Java rock star Adam Bien took Java EE 7 support in WebLogic for a spin and was impressed. He commented on fast startup, low memory footprint, fast deployments, excellent NetBeans integration and solid Java EE 7 compliance. You can read Adam's full write-up here.

None of this of course is incidental. WebLogic is a mature product with an extremely large existing deployment base. With those strengths often comes the challenge of usability and WebLogic is no exception. Nonetheless many folks that haven't kept up-to-date with WebLogic evolution don't realize that usability and performance have long been a continued core focus. That is why folks like Adam are often pleasantly surprised when they take an objective fresh look at WebLogic. You can give WebLogic 12.2.1 a try yourself here. There is no need to pay for anything as you can use a free OTN developer license (this is what Adam used as per the instructions on his post). You can also use an official Docker image here.

Solid Java EE support is of course the tip of the iceberg (albeit an extremely important tip of the iceberg) as to what WebLogic offers. WebLogic offers a depth and breadth of proven features geared towards mission-critical, 24x7 operational environments that few other servers come close to. One of the best ways to observe this is taking a quick glance at the latest WebLogic documentation.

Monday Dec 21, 2015

Java EE 7 in Production at Commerzbank

One of the most important things to do at this stage of the life-cycle of Java EE is highlight successful adoption stories at a regular cadence. We have been doing just that for a long time through our adoption stories blog, this humble blog as well as JavaOne. In the past few months celebrated Java EE advocate and Java Champion Adam Bien has been really helping out in this regard as well through his popular blog. One of the recent cases Adam highlighted is production Java EE 7 usage at Commerzbank.

For those unaware, Commerzbank is one of the largest international financial institutions based in Germany. The bank implements a number of applications based on Java EE 7 and AngularJS. The front end AngularJS application communicates securely with the back-end using REST powered by JAX-RS and Java EE 7. Timo, a senior engineer with Commerzbank, noted the simplicity, ease-of-use and productivity offered by Java EE 7. He also noted very lightweight war deployments and lack of any complex application dependencies with Java EE. The team also utilizes Java SE 8, NetBeans and Jenkins. You can read the full details of the adoption story on Adam's blog.

JavaOne 2015 was particularly good in terms of compelling Java EE adoption story sessions. We will share the details of those stories here, including session videos, in the coming weeks and months.

If you have a similarly great Java EE adoption story to share with the community (particularly migration stories from other technologies), please do feel encouraged to reach out. In the spirit of Java EE centric vendor neutrality, what Java EE implementation or tool set you choose does not matter at all and neither does which part of the globe you are in.

Tuesday Dec 15, 2015

Content Negotiation using 'q' Factors with JAX-RS 2/Java EE 7

When we think of HTTP and content negotiation most of us probably immediately think of mime-types. Agreeing upon the mime-type is indeed part of the HTTP conversation between a client and a server. However HTTP has also had an even finer grained content negotiation mechanism called the relative quality factor or 'q' factor for short. 'q' factors are so far not that well supported by browsers and are even more unknown to most developers. Using a q-factor, a client can specify a preference for the mime-type they want if they are able to support multiple mime-types (let's say to state a preference for PNG over JPG). The 'q' factor is essentially a number between 0.0 and 1.0 tacked onto the mime-type. A higher value indicates a more preferred mime-type. Similarly the server can also indicate what mime-type it prefers to send as a response by specifying a 'qs' factor or quality of source factor. The best written explanation of 'q' factors that I could find is here. Note that the article also points out the somewhat obscure nature and poor browser support for 'q' factor based negotiation in the web world so far. It does however point out the fact that Apache httpd has long had strong support for 'q' factors.

'q' factor based negotiation can be very valuable in REST. It can help you write a more robust service API. For example, you could support both JSON and XML for a resource and then state that you prefer JSON over XML if the client supports both. Similarly you can write more powerful clients that can flexibly process multiple content types. These capabilities are especially helpful while writing public APIs with REST or dealing with heterogeneous clients that you cannot completely predict. The same is true on the client side as well especially while dealing with third-party services. The good news for you is that JAX-RS 2 and Java EE 7 has strong support for 'q' factor based content negotiation. Sam Sepassi did a very nice job explaining the feature in a recent article. You should give it a read and consider using it if you have a good use case for the feature.

Wednesday Nov 18, 2015

WebLogic Now Java EE 7 Compatible!

With the greatest pleasure I can report that WebLogic 12.2.1 has recently been fully Java EE 7 certified! This represents full commitment from Java steward Oracle to commercial support for Java EE 7. WebLogic joins the ranks of GlassFish 4, WildFly 8, WebSphere Liberty Profile 8.5, Hitachi Cosminexus and TmaxSoft JEUS. With the very broad customer base that both Oracle and WebLogic have globally this is very welcome news for Java EE 7 indeed. All of the Java EE certified offerings are always listed on the official Java EE compatibility page.


As many of you are aware, Java EE 7 is one of the most extensive set of changes to the platform in it's history. Similarly WebLogic 12.2.1 is one of the most significant releases of WebLogic in many years, even not counting full Java EE 7 support. In addition to Java EE 7 support WebLogic 12.2.1 brings two significant sets of changes.

The first is what is referred to as multitenancy. WebLogic multitenancy brings greater isolation similar to what one can accomplish through Linux containers like Docker or traditional virtualization - only applied natively at the WebLogic runtime level. What this means is that multiple applications can run completely isolated from each other on the same WebLogic runtime as though they were running on different domains. The multitenancy concept is intended to be implemented seamlessly across Oracle products in the data center including the Oracle JDK, Coherence, Traffic Director and the Oracle Database. This is a concept currently unique to the Oracle stack.

WebLogic 12.2.1 also builds on the traditional strengths of the product with regards to high availability. A number of features have been added to improve 100% up time capabilities through live patching, live upgrades, clustering, load-balancing, fail-over and replication, especially in large, multi data center, disaster recovery capable deployments. 

The following are the most important links you should explore:

It is worth reminding that prior to 12.2.1, the WebLogic 12.1.3 release supported the Java EE 7 APIs that many customers indicated they thought were most important -  WebSocket, JSON-P, JAX-RS 2 and JPA 2.1. Also note that like 12.1.3, WebLogic 12.2.1 is certified for Java SE 8. Though it is not there yet, WebLogic 12.2.1 will soon also be available on the Oracle Cloud - representing full Java EE 7 commercial support on the cloud from Oracle.

So the question now is who will be next to cross the Java EE 7 compatibility finish line. JBoss EAP 7 recently released an alpha with Java EE 7 support - this is in addition to Red Hat's long standing Java EE 7 compatibility through WildFly. Similarly WebSphere Classic released a beta showing Java EE 7 support in addition to the existing IBM full commercial Java EE 7 support through WebSphere Liberty. It is clear there will be at least two more significant Java EE 7 commercial platforms in the next few months. The Apache TomEE team is also working on bringing forward Java EE 7 features.

For some perspective, few other open standards such as SQL have as many available implementations as Java EE 7 already has.

Wednesday Oct 21, 2015

Developers Affirm Strong Support for Java EE 7 in DZone Survey

                    "The reports of my death have been greatly exaggerated."

                                                                                                      – Mark Twain

It sometimes seems like there has been a raging debate on the role of Java EE in server-side Java since the beginning of time. The debate is perhaps just as old and stale as the question of whether Java is finally dead or irrelevant. One of the latest dimensions of this debate has been around adoption of Java EE 7. It is not too surprising then that DZone took up the topic in it's wide ranging 2015 Java Ecosystem Survey. The analysis of the results of that survey will be part of the upcoming 2015 Java Ecosystem Guide to be published during JavaOne. Fortunately DZone shared the results with a selected set of MVBs (Most Valuable Bloggers) including yours truly and gave me permission to share some preview perspectives on the data. As the title of this entry suggests the survey results bode well for Java EE 7 specifically and Java EE generally.

The survey asked a very simple question - "Which of the following Java platforms do you use today?", including various versions of Java EE and some key alternative technologies as mutually inclusive answers (I think the mutually inclusive part is an important reality check towards the aforementioned debate that generally tends to have a tone of mutual exclusion). As the results highlighted shows, almost 39% of developers chose Java EE 7. A total of over 90% responses chose one version of Java EE or the other - well ahead of the other technologies listed. Java EE 7 community support seems to have already edged out the very well regarded Java EE 6 release. These patterns will likely get even stronger with the recent Java EE 7 release of WebSphere Liberty and full commercial support of Java EE 7 through WebLogic and JBoss EAP in the next coming months.

Fortunately we also have interesting past data points to compare in the RebelLab's 2014 Java Tools and Technologies Landscape survey. That survey asked similar but slightly different questions with regards to Java EE. In that survey 68% indicated that they were Java EE users, which is likely a lower rate than in the DZone survey. Most importantly a significantly higher percentage, 49% indicated Java EE 6 usage than Java EE 7 usage that stood at 35%. For clarity this report treated Java EE version usage as mutually exclusive (probably a mostly reasonable assumption). It did not attempt to collate data on Java EE vis-a-vis alternatives. To roughly compare with the DZone report format that means that of total respondents, about 24% reported Java EE 7 usage while 33% reported Java EE 6 usage. All this bodes well for Java EE and Java EE 7. The two surveys taken roughly a year apart indicate higher levels of usage for Java EE overall and strengthening community support behind Java EE 7, even as compared with Java EE 6.

On behalf of the Java EE team here at Oracle it is only correct to thank everyone that indicated their support for Java EE and Java EE 7 in such surveys. Our work is intended to benefit you first and foremost - it is good to see that intent does not get lost in the muddle. As you may be aware we make an effort to highlight your success adopting Java EE in our blogs, JavaOne and through the core Java EE community. It is always a good time to drop us a note to share your story with the broader community.

Monday Oct 12, 2015

Kito Mann's JavaOne 2015 Sessions on JSF, MVC and HTML 5

For the Java EE track at JavaOne 2015 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 is a long time JSF advocate, popular author, speaker, consultant and very prolific contributor to the JCP. Just as previous years, Kito has one of the highest number of sessions from a single speaker on the Java EE track. He spoke to us about his accepted session at JavaOne 2015 (click here if you can't see the embedded video).

The following are the sessions we talked about:

  • Advanced PrimeFaces: This informal after-hours BoF is a deep dive into the popular PrimeFaces library. If you are using PrimeFaces this is a great session to really understand how PrimeFaces works.
  • Tuning JavaServer Faces: In this extended tutorial style session Kito offers his deep insight to effectively tuning JSF applications in the real world. I would say this is a must attend for any JSF user.
  • Building Professional JavaServer Faces UI Components: As Kito explains building reusable components is a key value proposition for JSF. In this informal after-hours BoF Kito will cover best practices for effectively building JSF components for real world applications.
  • Modern Web Apps with HTML5 Web Components, Polymer, and Java EE MVC 1.0: This is a very advanced technical session covering a number of very forward-looking topics. HTML5 web components are a key emerging standard for building JSF style components in vanilla HTML. Polymer is an important open source library for HTML 5 web components. In this session Kito shows how Polymer/web components can be used effectively with the upcoming MVC 1.0 standard slated for Java EE 8.

The following sessions are pretty closely related to what Kito is presenting at JavaOne this year:

Besides these 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. If you are coming, do make sure to book your sessions via schedule builder before they fill up.

Wednesday Oct 07, 2015

GlassFish 4.1.1 is now available!

GlassFish 4.1.1 has just been released and despite the minor version increase, 4.1.1 is certainly not an insignificant update!

During the course of last year; we have seen specifications updates for JAX-RS (JSR 339), JMS (JSR 343), CDI (JSR 346) and WebSocket (JSR 356). Those different Maintenance Releases are now integrated in GlassFish 4.1.1. During that period, the umbrella Java EE 7 specification (JSR 342) also went through the Maintenance Release process but that revision was just about specification clarifications; so the Java EE 7 MR had technically no impact on the Reference Implementation, on GlassFish.

In this 4.1.1 release, most the underlying GlassFish components have been updated. The list below contains some of the updated components.
  • Jersey 2.21 (JAX-RS 2.0.1 aka JAX-RS 2.0 rev A) 
  • Weld 2.2.13.Final (CDI 1.2)
  • MQ 5.1.1-b02 (JMS 2.0.1)  
  • Tyrus 1.11 (WebSocket 1.1 )
  • Mojarra 2.2.12
  • EclipseLink 2.6.1-RC1
  • Grizzly 2.3.23
  • HK2 2.4.0-b31
  • JBatch Runtime 1.0.1-b09
  • JSON-P RI 1.0.4
  • etc.

Finally, it should also be mentioned that and in addition to various bug fixes, GlassFish 4.1.1 also includes several security related fixes.

You can download GlassFish 4.1.1 here and grab the source code here.


Sunday Sep 06, 2015

Java EE @ Devoxx Poland 2015

Devoxx Poland was held on June 22-25 in historic Krakow. This is one of the largest and most prestigious Polish developer conferences. The conference was completely sold out and chock full of world class speakers/content. Speakers included Adam Bien, Venkat Subramaniam, Ted Neward and Pratik Patel. Topics included Java SE, Java EE, HTML5, JavaScript, DevOps, architecture, methodology, NoSQL and cloud.

I delivered talks on Java EE 8, aligning JavaScript/HTML5 with Java EE 7 as well as the JCP/Adopt-a-JSR. I also delivered two hands-on workshops on Java EE 7 and JMS 2. Adam Bien delivered a vital talk on Java EE and microservices. More details on the sessions and the trip to Poland, including slide decks and code, posted on my personal blog.

Tuesday Aug 25, 2015

Asynchronous Support in JAX-RS 2/Java EE 7

Asynchronous processing, non-blocking I/O, events and messaging are keys to more reactive applications. Fortunately Java EE has long organically provided such features in the platform at pretty much every key API layer including Servlet, CDI, EJB and JMS. These features were strengthened further in Java EE 7 and even more could be done in Java EE 8. Spurred by a real world developer I met at a conference writing a highly reactive IoT application with Java EE, I've actually developed a talk about reactive features in Java EE (click here if you can't see the embedded slide deck):

One such feature added in JAX-RS 2/Java EE 7 gets surprisingly little exposure - asynchronous capabilities added for both server-side REST endpoints as well as clients. Fortunately Sam Sepassi has stepped up nicely to fill the gap with a detailed blog entry that covers both the servers-side and client side capabilities. Bonus points to Sam for demonstrating how nicely JAX-RS 2 asynchronous endpoints and EJB @Asynchronous work together! Sam also shows the Java EE 7 Concurrency Utilities in action and does a nice job explaining the basics/what's going on under the hood.

Wednesday Aug 19, 2015

Java EE @ Chicago Coder Conference 2015

The Chicago Coder Conference 2015 was held on May 14-15. The conference is locally organized by the community including the Chicago JUG, which is why it was important for us to support the event. The event is somewhat Java leaning but also has great presence from the web, .NET, database, etc communities.

I delivered talks on JMS 2 and aligning JavaScript/HTML5 with Java EE 7. Chicago based Java EE advocate Josh Juneau covered what's coming in Java EE 8. More details on the sessions and the trip to Turkey, including slide decks and code, posted on my personal blog.