Thursday Jan 13, 2011

Java champions on the value and portability of CDI

Adam Bien Antonio Goncalves

In his latest Java EE article (published in the Jan/Feb issue of the Oracle Magazine) Java Champion Adam Bien describes CDI (Context and Dependency Injection) as the standard glue, arguing that it "(brings together) the different parts of the Java EE 6 specification" while introducing "many powerful features such as events, interceptors, decorators, standardized extension points, and the service provider interface".

Adam's article goes on to illustrate the integration with EJB, BeanValidation, and JSF while implementing the Entity Control Boundary (ECB) pattern with clearly identified boundary, control, and entity packages.

Meanwhile fellow Java Champion Antonio Goncalves takes Weld (the CDI reference implementation) for a ride in various server configurations. This ranges from a standard Java EE 6 server (GlassFish) with CDI fully integrated and ready to use to other non-specified environments but which Weld supports : Java SE and Tomcat. This is the first in a series of blogs, so make sure you keep an eye on Antonio's blog.

Wednesday Nov 10, 2010

Weld 1.1 in GlassFish 3.1

Contexts and Dependency Injection for the Java EE platform (JSR 299, tag:CDI) is one of the key specifications in JavaEE 6 and as more people are adopting it, its performance becomes more and more important.

GlassFish 3 has implemented CDI from the beginning through JBoss's Weld, the Reference Implementation for CDI, but some users have voiced concerns on the performance of the early versions of Weld (see Harald's comment or bugid 14419). The Weld team has been debating them (e.g. see thread@weld-dev) and Pete indicates that Weld 1.1 addresses these issues.

If you are a GlassFish user, you will soon be able to try out Weld 1.1.  We could not integrate the earlier beta1 due to some API incompatibilities but we are incorporating beta2 right now and we expect it to appear in GlassFish 3.1 Build 29 (next week), or at the latest in Build 30 (MS7, targeted for 11/23, see Build Map).  When it shows, please validate it against your applications and let us know if you see issues.

Sunday Oct 17, 2010

NetBeans 7.0 Milestone 2 is here - lot's in store!

ALT DESCR

Just like GlassFish, the NetBeans folks have been busy working on their next release (read "6.10 renamed to 7.0"). Milestone 2 of NetBeans 7 is now available and it has a lot in store for web and server-side developers: Java EE 6 enhancements, support for GlassFish 3.1 and Oracle WebLogic Server, but also interesting new Web features.

Regarding Java EE 6 enhancements, EL (Expression Language, heavily used in JSF 2) now has error checking, finds usages in JSF or CDI managed beans, offers refactoring, bundle resources support, useful tooltips and hints. CDI offers qualifier auto-creation, "Inspect CDI" contextual menu, and more. But you'll also find JAX-RS wizard enhancements, support for JSF components suites (PrimeFaces), BeanValidation (constraint and validation.xml) wizards, and JPA integration of BeanValidation and JAXB.

On the Web front, json source formatting, HTML 5 editing support (see this recent GlassFish HTML 5 blog and video), and better HTML validation are also of interest.

Hot off the heels of the Maven 3 final release, NetBeans now ships with an embedded distribution which has been in fact used for a while to interpret Maven projects. Numerous other bugs have been fixed. If you use Maven (2 or 3) you should give this milestone a try.

The NetBeans/GlassFish integration got even better with GlassFish 3.1 support, application-scoped resources (including glassfish-resources.xml editing), better Web Services testing, easier domain creation, access to remote server log, and restart in debug mode. NetBeans also now allows EJB and ACC modules to be deployed as standalone artifacts, while debugging an EAR file that contains an ACC client will now start two debugging sessions, one on the client, one on the server. Check Vince's blog for all the details.

Support for Oracle WebLogic Server is a new feature and now shows as a server in the "Services" tab. If interested, check out this short yet useful video showing support for JSF 2.0 (integrated in the recent WebLogic release), datasource creation and deployment, directory-based deployment and more.

For further details on these new features, please read this Milestone 2 New and Noteworthy document. The final release of NetBeans IDE 7.0 is planned for March 2011.

Saturday Oct 09, 2010

GlassFish Tips and Links #11: CDI, EJB 3.1, Spring, HTML5, Maven, JCP, Forks...

Recent Tips and News on Java EE 6 & GlassFish:

Informational Sign

Tips

TOTD #145: CDI Events - a light-weight producer/consumer in Java EE 6
Enterprise JavaBeans 3.1 with Contexts and Dependency Injection: The Perfect Synergy
Spring to Java EE – A Migration Experience
Problem with Grails on Glassfish v3?
Web Sockets and HTML5 in Glassfish
Book Review: Java EE 6 with GlassFish 3 Application Server

Links and News

• Maven 3 has been released: Sonatype, InfoQ
• GlassFish as Best Practices in Software Development (Johan)
• TSS Thread: Moving from Spring to Java EE 6: The Age of Frameworks is Over
GlassFish jobs at Indeed.com crosses 780 Flower NFA Update (Using GlassFish)
Proposed Maven Artifact Naming and Versioning for JavaEE
• Standards are Good for You: JBoss 6 Moving Towards JavaEE 6 with M5

Conferences

Java2Days 2010; Reports: Arun, Ivan: d1 & d2, Alexis.
Hudson User meetup in Tokyo (Nov 12th)
Silicon Valley Code Camp
• eBIG SIG: JavaEE 6 = Less Code + More Power (Oct 20th)
JavaOne Brazil (Dec 7th thru 9th)

Recent Sites Seen Running on GlassFish

• HPCSense uses GlassFish - twitter
ParaFarmacia, Mas Barata - Netcraft

JCP News and Future of Java

Now OPEN -- Nominations for EC seats
• TSS Thread: The Future of Java: forking, death, or stasis
• More Forking Opinions: Sacha and Greg.
• Java.Net Poll: Free Java? Closed Java? Evolving JCP? What's the Most Likely Path?

Thursday Apr 22, 2010

NetBeans 6.9 beta available

NB 6.9 beta

The NetBeans team has now made version 6.9 beta available. Looking at it from the Java EE perspective you'll notice a focus on CDI (JSR 299 - Context and Dependency Injection) with improved support over 6.8. This includes proper EL completion on @Named beans, automatic creation of beans.xml, and more. This version of NetBeans ships (in the "Java" bundle) with GlassFish 3.0.1 b14 (see GlassFish Community Roadmap for details on the development schedule of this version).

There are no less than four tutorials on CDI: Getting Started with Contexts and Dependency Injection and JSF 2.0, Working with Injection and Qualifiers in CDI, Using CDI Injection to Perform Custom Validation, and Working with Events in CDI. In the web development space, you'll also get CSS refactoring and RESTful Web Services support for RCP apps.

OSGi and JavaFX are two other major themes in this 6.9 beta release. NetBeans now offers OSGi interoperability at the core platform level which makes it possible to develop and consume OSGi bundles with Felix 2.0.3 and experimental Equinox support. One can now also convert NetBeans modules into OSGi bundles and run them in an unmodified OSGi container.

On the JavaFX front, this release integrates the Composer (a visual editor for form-like UI, previously in preview) and more generally support for JavaFX 1.3 (SoMa). This version of the technology offers new and enhanced UI controls, TV development support and across the board performance improvements.

For more details on this release (PHP, Spring, C++, and more), check out the Product Page. Next stop for NetBeans 6.9 : June! Until then, make sure you try out the beta.

Tuesday Dec 01, 2009

Java EE 6 Specifications Approved by JCP

Java EE 6 (Done!) logo

Roberto tweeted and blogged soon after the news broke: all the remaining Java EE 6 JSRs passed the final ballot. For the umbrella spec the result is 12 YES, 2 abstain, 1 No - details for all of them : Java EE 6, Servlet 3.0, EJB 3.1, JPA 2.0, CDI, Connectors 1.6. Congratulation to Roberto and to all the spec leads, EG members and to all the community participants for this most important milestone!

Added - Voting Tally for all specs.

Coverage so far :
The new EE ecosystem (Gavin King, CDI Spec Lead). Check also the comments to his earlier post.
JCP Approves Java EE 6 Specification (Artima)
Java EE 6 receives approval (InfoWorld)
Le JCP approuve Java EE 6 (LeMagIT)
Java EE 6 findet eingeschränkte Zustimmung (heise online)
Java EE 6 прошла стандартизацию (CyberSecurity.ru)
Ya ha sido aprobado Java EE 6 (IDG.es)
Java EE 6 Spec Finalized and Approved (JavaLobby)
La spécification Java EE 6 votée à une large majorité (01net)

As Roberto wrote in his entry, "The final release will happen on December 10, when GlassFish v3 will be available". The specifications become final when the corresponding TCKs and RIs are delivered and that is the target date. Exciting times ahead!

Sunday Nov 15, 2009

The Road Towards JavaEE 6 - Specs Submitted to EC

The last batch of JSR's for JavaEE 6 were submitted earlier this week for Final Approval Ballot . The ballot will start on 11/17/09 and end on 11/30/09. They are:

JSR 316 - JavaTM Platform, Enterprise Edition 6 (Java EE 6) Specification
JSR 315 - JavaTM Servlet 3.0 Specification
JSR 317 - JavaTM Persistence 2.0
JSR 318 - Enterprise JavaBeansTM 3.1
JSR 322 - JavaTM EE Connector Architecture 1.6
JSR-299 - Web Beans (now called CDI)

Several JSRs had been submitted and approved previously:

JSR 314 - JavaServer Faces 2.0 (News@TA, vote results: 12 YES/4 Not voted)
JSR 330 - Dependency Injection for Java  (News@TA, vote results: 14 Yes/1 No/1 Not voted)
JSR 303 - Bean Validation (Emmanuel's note, vote results: 12 Yes/4 Not voted)

A few of the specs went through the lighter-weight Maintenance Process, including:

JSR 311 - JAX-RS: The JavaTM API for RESTful Web Services JAX-RS 1.1 (Paul's note, change log)

Thursday Oct 15, 2009

JSR 330 Approved - Dependency Injection for Java

ALT DESCR

The Executive Committee for SE/EE of the JCP has approved JSR 330, Dependency Injection for Java. This specification, led by Bob Lee @ Google and Rod Johnson @ SpringSource was submitted in May 09 and moved through the JCP process very quickly. The final vote result was 14-1-1. Congratulations to the leads and the EG on this important spec.

There are still a few specs left to approve that will go into the umbrella JavaEE 6 JSR. The next major one is probably JSR 299, which was submitted ahead of 330 but was later restructured to leverage it.

Sunday Sep 06, 2009

JSR 299 and 330 progress in latest GlassFish v3

Code snippet

As previously reported last month, JavaEE 6 will include JSR330 and JSR299. Roger Kitain already has a simple yet detailed blog entry on using JCDI (JSR 299, ex-WebBeans) in GlassFish. He walks through JSF 2.0 and JSR 299/JSR 330 code. You'll see there @Inject, @Qualifier, @SessionScoped, @ApplicationScoped, all in action.

If you're curious enough to test this sample, I would recommend using NetBeans 6.8 M1 - register a recent GlassFish v3 build (promoted build web 62 for instance), create a Web Application with Java EE 6 as the platform level and copy paste the various pieces. No further settings are required.

Overall, this shows progress since Cay's previous entry on the topic. Other posts on similar topics are marked with the "jsr299" and "jsr330" tags. Keep an eye on Roger's blog for more entries on this topic.

Tuesday Aug 04, 2009

JavaEE 6 Will Include JSR330 and JSR299

ALT DESCR

Java EE 6 will include JSR 330 and JSR 299. Roberto explains the changes:

• JSR-299 will be updated to use the JSR-330 annotations
• JSR-330 has evolved to take into account requirements from JSR-299
• Both JSRs will be part of the Java EE 6 Platform

Thanks to everybody that worked so hard to make these changes; obviously we wished this had happened earlier in the Java EE 6 cycle but the result will be an improved platform. We estimate that the final release of Java EE 6 (and GFv3) will be around November but we should have specific dates next week.

Check out Roberto's Announcement for details.

Wednesday Jul 08, 2009

Cay on WebBeans and JSF, on GlassFish v3 Preview

ALT DESCR

Cay is updating his Core JSF book and is taking WebBeans (JSR299) for a spin. His most recent post writes covers Conversation scope and access to stateful session beans from JSF pages. Cay used GlassFish v3 Preview (after updating to the latest JSF components); except for one example where he had to use JBoss 5.1.0 GA because we have not yet implemented some pieces of WebBeans. (see his comment about startup times :-))

Check out Cay's Note and you may also want to check Pete Muir's Webinar with SlideCast from May 19th.

Friday Jun 12, 2009

JSR 299 Proposed Final Draft Submitted

ALT DESCR

The Proposed Final Draft specification for JSR 299 has been submitted to the JCP. See Gavin's Announcement and Overview and/or download the document.

Still unfolding is the relationship between 299, JavaEE 6 and JSR 330; see the comments at Gavin's post for some ideas, and you can also compare the results and comments between the votes for 299 and for 330. I'll post when there is something public to share.

Tuesday Jun 09, 2009

JSR 330 (Dependency Injection for Java) Accepted by the JCP

ALT DESCR

The JCP EE/ES EC has approved JSR 330 (Dependency Injection for Java). The vote was 14 YES, 1 ABSTAIN (Red Hat) and 1 didn't vote (Nortel). Sun, Ericsson, IBM, Red Hat and Oracle all requested coordination between JSR330 and JSR299 (WebBeans). Check out the Vote Comments for the different positions.

Better late than never, I guess. Everybody (JCP as well as JSR 330 submitters) have committed to transparency, so we will be able to follow-up the evolution of this story. And consider Joining the JCP to influence this and other standards in your platform.