Thursday Mar 26, 2015
Monday Mar 16, 2015
By reza_rahman on Mar 16, 2015
One of the most important things to do at this stage of the life-cycle of Java EE is highlight successful adoption stories. We have been doing just that for a long time through our adoption stories blog as well as JavaOne. JavaOne 2014 was particularly good in this regard and JavaOne 2015 looks to be even better. Indeed we hope the folks with great adoption stories that submitted last year but did not get accepted will resubmit next year. We will continue to highlight some of those sessions from JavaOne 2014 in the next few months. In this vein I'd like to highlight a very interesting real world story of migrating a JSF based web application from Spring to Java EE 7 and CDI shared by Mario-Leander Reimer of QAware.
Mario's division is a small German based project consulting practice. He was tasked by a major German auto manufacturer to undertake this migration effort (it won't take most Germans much effort to figure out who this auto manufacturer might be since Mario shares that they are based in Munich). The reasons cited for the migration include streamlining/simplifying company-wide application architecture, reducing framework explosion/dependencies, standardization and reducing cost. In just about a month Mario was able to successfully migrate over the application that made extensive long-term use of Spring to CDI and Java EE 7! Mario also made use of great CDI ecosystem tools such as DeltaSpike and Arquillian (both projects have been Duke's Choice award winners, DeltaSpike being the more recent recipient). He also used PrimeFaces with JSF.
During his talk Mario highlighted his journey in learning CDI/Java EE 7 (he was previously a heavy Spring user), the parts of CDI and Java EE he really came to appreciate as well as the challenges he faced and successfully overcame. His talk highlights the ever careful balance struck between feature bloat and simplicity in a Java EE standard like CDI as well as the power of the CDI portable extensions API when you really need to break out of what CDI provides out-of-the-box. You can see Mario's awesome JavaOne 2014 presentation below (if you are having trouble seeing the embedded video it is available here).
If you have a similarly great Java EE adoption story to share, please do drop us a note (particularly migration stories from other technologies). 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.
Friday Mar 13, 2015
By reza_rahman on Mar 13, 2015
The official Java EE 7 Hands-on-Lab is an excellent learning resource. It was initiated by my former colleague Arun Gupta (now at Red Hat). The lab starts with some skeleton code (that's mostly Java EE 5 and Java EE 6) and through a series of well-written step-by-step instructions adds a select set of Java EE 7 features to create a fairly cohesive sample web application. The instructions do a reasonable job of explaining the context and motivation for the features being added. Although it touches upon a tiny subset of what was added in Java EE 7, in my experience the lab takes about six to eight hours to complete. In the end attendees get a real sense of how developing with Java EE and Java EE 7 actually feels like and learn a few Java EE 7 features.
I just finished successfully delivering the lab once again at DevNexus 2015 (trip report coming soon). In preparation for DevNexus and beyond I made a few updates/changes:
- I tried to make the lab entirely self-directed and self-paced for attendees by removing as many possible stumbling blocks (however minor) as possible. My goal was to make the lab as easy to go through and as standalone as possible.
- I updated the lab to use GlassFish 4.1 and NetBeans 8.0.2. This resulted in a small number of minor code changes.
- I polished up the code to make it as realistic as possible within the scope of a simple lab.
The first bullet point above is what I would really like to bring your attention to. Every time I have run this lab I've tried to execute it such that it requires bare minimum or no involvement from me and in fact I believe I've succeeded in doing just that. The reason this really matters is that I think this lab material has much greater potential than just something else our team does at conferences. I believe that the lab is now in a state such that anyone can go through the lab entirely on their own, by just using the public HOL page linked. More importantly I think it is possible with very little effort for someone to lead the lab in their user group or company. I highly encourage you to do so if you have an interest in supporting the Java EE community. If needed, our team could provide any help that you may need (such as being present virtually or working with you one-on-one to get you prepared). I've supplied all the resources that you should need on the public HOL page.
Do drop me a note if you have any feedback on this, if there's anything that I can improve with the lab or if you need any help.
Thursday Mar 05, 2015
By David Delabassee-Oracle on Mar 05, 2015
Kito D. Mann is a well-known and active member in the JSF sphere. He is the editor-in-chief of JSF Central and co-host of the Enterprise Java Newscast. A few years ago, he has written the 'JavaServer Faces in Action' book for Manning. And now in addition to his day job as an enterprise application architecture consultant, Kito is also a member of several JCP Expert Groups (including JSF), a recognized conference speaker, etc. Needless to say that Kito lives and breathes JavaServer Faces!
During last JavaOne, Kito hosted several sessions including 2 sessions on JSF 2.2: 'JSF 2.2 In Action' and 'JSF 2.2 Deep Dive'. Both sessions cover the new features of JSF 2.2 (e.g. Faces Flow, Multi Templating, HTML 5 support, XSRF, etc.) but in a different format. The first session ('JSF 2.2 In Action') is a regular session, i.e. 60min, while the second session ('JSF 2.2 Deep Dive') is longer, almost 2.5 hours! This gave Kito more time to go deeper and in more details on JSF 2.2. So if you know JavaServer Faces but want to dig more about what JSF 2.2 brings, you should definitely watch one of those sessions, they’re both very informative and well illustrated with code and demos.
Wednesday Feb 25, 2015
By reza_rahman on Feb 25, 2015
One of the more obscure features introduced in JPA 2.1 and Java EE 7 is the unsynchronized persistence context. It's not too surprising that the community does not seem to discuss it much - it's really geared towards somewhat an edge case.
Prior to JPA 2.1, the entity manager is always synchronized with the database when a JTA transaction commits. This poses a challenge if you have a multi-step workflow (let's say in a stateful session bean/CDI conversation/JSF flow) where you want some data to be flushed to the database on transaction commit at a given stage of the workflow but not all - but you do eventually want to synchronize all changes at some other point in the workflow. Non-standard solutions like Seam and the Hibernate flush mode have been the answer in the past to get around this problem. This is now solved in JPA 2.1 via the unsynchronized persistence context. In an unsynchronized persistence context changes are not automatically flushed to the database on transaction commit. Rather, you explicitly join the transaction when you want changes synchronized.
Hantsy Bai does a decent job explaining this through code examples. By far the best explanation of the feature comes from specification lead Linda DeMichiel. Check out minute 11-14 in the short video below (if you are having trouble accessing the embedded video it is available here).
What do you think of the feature? Do you think it is useful or obscure? The JPA spec is the best place to get further details if this intrigues you.
Monday Feb 23, 2015
By reza_rahman on Feb 23, 2015
One of the most important things to do at this stage of the life-cycle of Java EE is highlight successful adoption stories. We have been doing just that for a long time through our adoption stories blog as well as JavaOne. JavaOne 2014 was particularly good in this regard and JavaOne 2015 looks to be even better. Indeed we hope the folks with great adoption stories that submitted last year but did not get accepted will resubmit next year. We will highlight some of those sessions from JavaOne 2014 in the next few months and the best place to start is the Java EE adoption story from Rakuten.
Rakuten is one of the largest online financial systems in the world. It is the number one e-commerce platform in Japan generating over 51 billion dollars of yearly revenue and growing on a global scale. It is easily one of the most technically adept companies in Japan and perhaps the world. They had a legacy system build around J2EE and a hodgepodge of various non-standard frameworks such as Spring, Apache Axis and iBatis. They chose to adopt Java EE over these technologies including alternatives such as .NET. They cited vendor neutrality, choice, simplicity, community, ease-of-learning, ease-of-use and productivity as great reasons for selecting Java EE for their next generation platform. They fully leverage Java EE including key APIs such as JSF, CDI, EJB, JPA, JTA and JMS. Along with Java EE they also chose WebLogic as well as Oracle DB/Exadata. They cited performance, scalability, reliability, productivity and support for choosing WebLogic, Oracle DB and Exadata. They also use best-of-breed tools such as NetBeans, Maven, Jenkins and the Atlassian suite of solutions. They achieved the astounding technical feat of completely overhauling their 24/7, extremely high volume online transactional system in just six months including training!
You can see Hirofumi Iwasaki and Arshal Ameen's awesome JavaOne 2014 presentation below (if you are having trouble seeing the embedded video it is available here).
The slide deck from the talk is posted below (if you are having trouble seeing the embedded slideshow it is available here).
Hirofumi Iwasaki and Arshal Ameen have been great advocates of Java EE, especially in Japan. We hope to continue to see great things from them and Rakuten. Rakuten is looking forward to learning and applying Java EE 7 in the real world as soon as possible.
If you have a great Java EE adoption story to share, please do drop us a note (particularly migration stories from other technologies). 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.
Friday Feb 20, 2015
By reza_rahman on Feb 20, 2015
Monday Feb 16, 2015
By reza_rahman on Feb 16, 2015
Manfred Riem was a guest on the most recent JSF Central Podcast. For those unaware Manfred is the co-specification lead for both JSF 2.3 and Java EE MVC 1.0. Manfred talked about Mojarra, JSF 2.2, JSF 2.3 as well as MVC 1.0. The podcast is available here and you can read the transcript here.
The podcast is led by Kito Mann - well respected enterprise consultant, author, blogger and JSF community member. Kito has been a long time supporter of JSF with a long track record of contributing as a JCP standards group expert.
The newscast is in fact part of the JSF Central portal and covers topics of interest for the JSF ecosystem. Past contributors to the podcast have included folks like Ed Burns, Cagatay Civici, Neil Griffin, Lincoln Baxter and Shay Shmeltzer. All of the podcasts are archived here.
Besides the podcast, the JSF central portal itself is a very valuable resource for the JSF community you should explore. It does a very nice job listing JSF articles, books, projects, products and other resources.
Wednesday Feb 11, 2015
By reza_rahman on Feb 11, 2015
Java EE had a strong showing this year:
- What's Coming in Java EE 8 - me
- Nuts and Bolts of WebSocket - Arun
- Java EE 7 Hands-on Lab - Arun, Ivan and me
- Apache Tomcat to Apache TomEE in 1-n Steps - Andy Gumbrecht
- Java EE 7 Batch Processing in the Real World - Roberto and Ivan
- Coding for Desktop and Mobile with HTML5 and Java EE 7 - Geertjan
- Forge and Arquillian Hands-on Lab - Ivan, me
- Why Open Standards and Java/EE Matter (to You) - me
More details on the sessions and Java2Days, including the slide decks, video and code, posted on my personal blog.
Tuesday Feb 10, 2015
By David Delabassee-Oracle on Feb 10, 2015
The Java EE 7 specification (JSR 342) was finalised end of May 2013 and since then, various minors errors have been reported. Those will soon be addressed as the Java EE 7 specification will go through a maintenance release (see Linda's announcement here).
Those proposed corrections should only impact the specification document itself and not the Reference Implementation nor the TCK. So once this MR will be done and voted, the version of the specification should be Java EE 7 Rev A.
Friday Feb 06, 2015
By reza_rahman on Feb 06, 2015
JDK.IO 2014 was held in Denmark on January 19-20 at the IT University of Copenhagen. It is the yearly conference of 'JavaGruppen', the Danish JUG. The conference sessions covered a variety of Java topics ranging from core Java, Java EE, and JavaFX. Speakers included my colleague David Delabassee, Simon Ritter, Adam Bien, Heinz M. Kabutz, Bert Ertman, Ryan Cuprak, Simon Maple and Markus Eisele.
David covered the Java EE portion of the keynote. He also presented a talk on Java EE 8. His slides from SlideShare are embedded below:
My friend, fellow co-author of EJB 3 in Action, Connecticut JUG leader and JavaOne Rock Star Ryan Cuprak presented a couple of very cool sessions. The first one, titled Hybrid Mobile Development with Apache Cordova and Java EE 7 demonstrates how Java EE can be used as a very effective mobile development back-end using APIs like JAX-RS, WebSocket and JSON-P. The talk was delivered at JavaOne 2014 as a tutorial and includes an excellent end-to-end demo. Video from the JavaOne talk is embedded below:
Ryan also presented another popular talk from JavaOne 2014 - 50 EJB 3 Best Practices in 50 Minutes. At JavaOne he had co-presented the talk with my other co-author Michael Remijan. The video from that talk is embedded below:
Ryan wrote up a very nice trip report of JDK.IO on his personal blog that you should check out. Other Java EE related talks included one by Markus Eisele on Java EE 7 and Apache Camel.
Tuesday Feb 03, 2015
By David Delabassee-Oracle on Feb 03, 2015
During last JavaOne, we held a Hands-on-Lab on JSR 352. JSR 352 is one of the new Java EE 7 APIs. The formal API is name is 'Batch Applications for the Java Platform' but it is often referred to as the 'Batch API'.
- Exercice 1 will introduce you the main concepts of JSR 352 such as Step, Job, JSL, etc.
- Exercice 2 will enhance the first exercise and introduce mutli-steps jobs combining Chunk step with a Batchlet step.
- Exercice 3 will cover checkpoint and the JobOperator interface which can be used to resume a failed job.
- Exercice 4 will build introduce you to listeners, a mechanism that can be used to intervene within the life-cycle of a batch job (e.g. to catch errors).
- Exercice 5 will introduce the concept of Job Partitioning, a more advanced feature of JSR 352.
Thursday Jan 22, 2015
By reza_rahman on Jan 22, 2015
Wednesday Jan 21, 2015
By reza_rahman on Jan 21, 2015
A long standing open debate within the Domain-Driven Design (DDD) community is whether entities should be able to access application services (roughly business facades in J2EE patterns parlance) and repositories (roughly DAOs in J2EE patterns parlance). If we think it's OK for entities to access these parts of the application, it poses a problem in JPA and other mainstream data access technologies - how do you inject objects into an entity? The answer today in JPA is that you can't do that. There are good technical reasons why it's difficult to allow CDI injection directly into JPA entities - it becomes very difficult to figure out how to manage the entity life-cycle if it is managed by both the CDI and JPA runtimes at the same time.
So is there a solution to this problem? The good news in JPA 2.1 and Java EE 7 is that there is a clever workaround. While you can't use CDI injection in entities, entity listeners now fully support injection. If needed you can then pass in an appropriately scoped injected object (probably an application scoped bean) into the entity or anything else that you need from the entity listener. This is exactly the technique demonstrated by Hantsy Bai in explaining CDI support in JPA 2.1 entity listeners. Besides entity access to services and repositories, being able to use injection in entity listeners is generally very helpful for more complex cross-cutting concern like requirements at the JPA layer. Prior to JPA 2.1 both Apache CODI and Seam 3 enabled injection into JPA entity listeners.
If you happen to need a basic introduction to JPA entity listeners, Alexandre Gama has one of the best compact write-ups I've seen so far.
For the record, I do think accessing application services and repositories in entities violates the separation of concerns principle and should be done very sparingly :-).
Please note that any views expressed here are my own only and certainly does not reflect the position of Oracle as a company.
Tuesday Jan 20, 2015
By reza_rahman on Jan 20, 2015
DevNexus 2015 will be held on March 10-12 in Atlanta. If you are a US based developer and do not know about DevNexus, you are definitely missing out. DevNexus was started a few years ago as an initiative by the Atlanta Java User Group (now one of the largest Java user groups in the world) and Burr Sutter (one of the earliest Java champions). Since then DevNexus has grown to become one of the largest Java leaning conferences in the US, perhaps second only to JavaOne. I've spoken at the conference a few times over the years. This year's roster is unsurprisingly impressive both in terms of speakers and content. Java EE has a strong showing including a few talks from me.
Below are the talks that might interest you if you are a Java EE fan (the schedule is not quite final yet so do stay tuned to the conference agenda for changes):
- Down and Dirty with Java EE 7: This is essentially our flagship lab/workshop at the moment covering Java EE 7. It has always proven popular so far and it is a great way to get some hands-on experience with Java EE 7. The materials for the lab is always available here. The lab is largely intended to be self-guided so you should be able to take advantage of the material even if you can't attend the lab in person. This will be my first talk at the conference.
- JMS.Next(): JMS 2.0 and Beyond: This is essentially an overview of JMS 2 (already in Java EE 7), with a bit of an early preview of JMS 2.1 (to be included in Java EE 8). The slides for the talk are available here. This will be my second talk at the conference.
- Java Persistence API: This session is a good mix of the basics, best practices and real world adoption stories for JPA. It's a talk by Jason Porter. Jason is a good speaker, a long time Java EE advocate and a Red Hat engineer.
- HTTP 2.0 comes to Java. What Servlet 4.0 means to you: This session will discuss what's in HTTP 2 and what that means for the next major revision of the foundational Servlet specification. I would say this is a must-attend for all server-side Java developers. My friend, colleague and Servlet specification lead Ed Burns is giving this talk. Ed is a brilliant speaker that's always a pleasure to listen to.
- Java EE 8: A Community Update: This is essentially a high level overview of what's coming in Java EE 8. This should be my last talk at the conference. Besides covering the current state of Java EE 8 I will also talk about how you can get involved in the process including through highly inclusive programs like Adopt-a-JSR. The slides for the talk are here.
Hope to see you at the conference? Besides giving my talks I will be attending a few talks myself as time allows. As always never hesitate to stop me if there is something I can help with. I'll also bring along some Java/Java EE goodies you are welcome to.
Podcasts & Videos
- New book: "Web Development with Java and JSF"
- Forge Powered Java EE Rapid Application Development Comes to NetBeans!
- JMS 2.0 Revision A
- Java EE 8/Adopt-a-JSR Updates: Morocco JUG!
- Java EE Management API 2.0 (JSR 373) Spins Up
- Java EE Container Lifecycle
- Migrating a JSF Application from Spring to Java EE 7/CDI
- Java EE 7 Hands-on-Lab Updated for You to Use!
- Templating in the MVC JSR
- Java EE Security API (JSR 375) Update