Couple of recent but important news you might have missed

November 22, 2010 Comments Off


 • Java SE 7/8 platform and language JSRs have been filed ! (for some background information, check out “how to read a JSR” and “Majority or 2/3rds?”).

• Release of NetBeans 7 Beta, with JDK 7 language construct support (and hints!) and a lot more. This beta version ships with GlassFish 3.1 build 29.

Javaholics Unite (at Devoxx 2010) – a Java EE perspective

November 14, 2010 § 3 Comments

Devoxx 2010 is starting in a few hours and I’ll be on the train tomorrow to Antwerp. I’ll have a pretty busy schedule with a tutorial, a hands-on lab, and a BOF.


So this year again, I’m giving a Java EE 6 Tutorial with my friend Antonio Goncalves. We called it “reloaded!” for a reason: it is not a repeat. A lot has happened in the past 12 months: Java EE 6 was released (and GlassFish had 3.0 and 3.0.1 releases), Oracle finally acquired Sun, CDI is getting traction, vendors are delivering, and to be bluntly honest, we’ve made progress in our understanding of the platform. So expect demos (including a number of new ones), new topics (mainly CDI), putting Java EE 6 portability to the task with an additional runtime, and a few new fun things. The session is at 9h30 on Tuesday.

Devoxx is having Hands-On Labs for the first time this year and attendees will be able to attend a self-paced, Java EE 6 Lab on the Tuesday afternoon which would be a great follow-up to the morning session. The only requirement for this is to come with a laptop with NetBeans 6.9.1 (java version with GlassFish) loaded (no more Maven required, it’s just a bad idea with conference wifi). The rest is in the instructions we’ll hand out at the beginning of the session. I’ll blog after the conference about where you can find everything to work through those three exercises and get you feet wet with Java EE 6.

In other Java EE 6 festivities from fellow colleagues :

• Paul Sandoz will be able to discuss how JAX-RS integrates with the rest of the Java EE platform as well as present content from the recent JSR proposal for JAX-RS 2.0 (packed with useful stuff IMO).

• Linda DeMichiel will cover JPA 2.0 (I tend to learn something new every time I hear a JPA 2.0 talk) and a more advanced talk about the Java Persistence Criteria API.

• GlassFish architect Jérôme Dochez will cover the HK2, multiple-purpose kernel in his “HK2: Oracle WebLogic Server, Oracle GlassFish Server, and Beyond” session and will, of course, lead the GlassFish BOF.

• Ludo will cover the tooling aspects comparing NetBeans, Eclipse and IntelliJ when it comes to supporting the Java EE platform today.

They will all be giving the Java EE future keynote on Thursday morning.

There are many more interesting server-side sessions from the guys at JBoss, a must see performance by Adam Bien, a couple WebSockets presentations [1], [2], some OSGi talks, and a lot more.

Beyond the (almost) mandatory “Future of Java” and other JDK 7 talks, I’ll also try to hit the NoSQL, Cloud and DevOps sessions, time and socializing permitting.

JFall 2010 – Yet another great Java conference

November 5, 2010 Comments Off

The folks in the NLJUG certainly know how to build a community and run events. JFall 2010 was in a new location this year (rather small Nijkerk, but you can get to pretty much anywhere in The Netherlands by train) and it was sold out at 1000+ attendees. And this is just a couple of weeks before Devoxx, another major Java conference literally miles away.

The conference started off with Danny Coward’s keynote which was really well attended. His content had meat (JavaME, JavaSE, JavaFX, and JavaEE) and the feedback was positive. At diner with Bert and the rest of the NLJUG team the day before, I was told that my Java EE 6 talk had the most registrations and indeed the room which was used for the keynote looked far from empty even with 6 tracks in parallel. My talk focused on Java EE 6, how we got there, and what’s causing the revival of flamewars on some community sites and overall excitement for the new platform. I managed to cram servlet3, ejb31, and cdi10 in a 3-minute closing demo. Reading the tweets after the talk seemed to indicate that people liked the session and learned several things.

Later in the day, I delivered a hands-on lab no less than three time with a total of 60 or so participants getting a feel for Java EE 6. The updated code and instructions for the labs are here. This went well after I realized we’d have no network and moved to non-Maven projects. GlassFish 3.0.1 and NetBeans 6.9.1 proved to be a good simple and sufficient combination for the labs (most people installed them on the spot).

I really enjoyed the discussions there on the night before, after a my talk, over lunch, during the labs and on the train on my way back. Lots of energy. So much for a dying Java community and technology!

A new voice for Java from Oracle – The Java Spotlight Podcast

November 2, 2010 Comments Off


 Roger get-a-blog Brinkley and Terrence Barr started a new weekly podcast, called the Java Spotlight. My colleague Dalibor Topic and myself are also participating in a panel. The first episode is already out with an interview with Mark Reinhold, Chief Java Architect on the future of Java SE recorded at JavaOne (Plan A, Plan B), a news section and more.

We’ve just recorded the second episode which should be up shortly with an interview of Steve Harris, Senior Vice President of Application Server Development at Oracle on the Sun acquisition, Java EE, and future of GlassFish.

Here are the compulsory podcast coordinates :

• Homepage (blog): http://javaspotlight.org/
• Podcast feed: http://feeds.feedburner.com/thejavaspotlightpodcast
Subscribe from iTunes
• Feedback: feedback@javaspotlight.org

PS: No, this does not mean that the GlassFish Podcast is going silent.

Java2Days 2010 : server-side heavy, with still all the fun

October 11, 2010 Comments Off


I’m back from Sofia and another java2days conference. As it was the case last year, the agenda was pretty heavy on server-side content with Java EE, Spring, CDI, and cloud-related talks. This year the conference also had two additional tracks to cover mobile and cloud (not sure how those went, I was busy preparing slides and attending sessions in the bigger room). I was presenting on Java EE 6 adoption and OSGi for GlassFish and Java EE developers. Both sessions had great attendance and a good set of questions (after the talk since 45 minute-sessions made it really hard for me to leave time for Q&A). The SAP folks in particular (large team based on Sofia) had a number of questions around OBR, P2, Felix vs. Equinox, etc…


I enjoyed meeting Reza Rahman again who seems to be working hard on passing the Java EE 6 Web Profile TCK for Resin. Reza presented on CDI, testing Java EE (which I had very much enjoyed at JavaOne) and an informative talk on how the JCP works. Arun has more details on the speaker’s diner which, as always, was one of the highlights of the conference.


While I didn’t attend the other tracks, I had interesting discussions with James Ward (Adobe), Andreas Jakl (Nokia), George Reese, Josh Long (now at VMWare/SpringSource), Vladimir Pavlov (SAP), Katya Todorova (SAP), Werner Keil (JCP EC member) and was happy to meet again with Andrew Lombardi, Talip Ozturk, Vassil Popovski, … I even did a podcast with Damon Edwards & John Willis some 24 hours after hearing the term “devops” for the first time (yes, I’ve been living in a cave).

With 500 attendees, I think this was yet another great conference. Let’s have some more Java SE content next time (there will be plenty to talk about in 12 months)!

JavaOne 2010 : Java EE 6 Panel “What do we do now?” notes

September 27, 2010 § 1 Comment


I was privileged to be moderating this year’s Java EE panel at JavaOne (session 313278). We had a great list of panelists and a lively discussion. Here are my notes:

Panelists (from left to right)

• Adam Bien (individual)
• Jim Knutson (IBM)
• Emmanuel Bernard (JBoss, Red Hat)
• Reza Rahman (individual, Caucho)
• Krasimir Semerdzhiev (SAP)
• Roberto Chinnici (Oracle, spec lead)
• David Blevins (OpenEJB, Apache Geronimo)
• Alexis MP (Oracle, moderator)

Platform and API Adoption

JBoss is feature-complete (RC1) for the Web Profile, probably final in the Fall. Two more months before Caucho Resin is final. WebSphere is in Beta and WebLogic is working on it (GlassFish of course, has had a full implementation since the spec was released in December 2009).

Jim (IBM): adoption for JSF 2.0 (performance), servlet 3.0 and JPA 2.0 (mappings) seem to be very strong. Also JAX-RS (which unfortunately is not in the web profile and as such not part of the upcoming Resin 4 release). Krasimir (SAP) mentions EJB 3.x. Reza says people are very satisfied after studying Java EE 6. In some cases Java EE is back in people’s radar. Emmanuel (JBoss): people like the consistency and tight integration of the platform. David (OpenEJB) : achievements with EJB’s in WARs, singletons, asynch may replace JMS. Roberto (Oracle) on JAX-RS having helped REST become a mainstream technology for Java developers. Adam: migrated all his EAR’s to WAR’s, removed Quartz and replaced it with EJB Timer, removed a bunch of interfaces. RESTful resources as EJB removes layers, this is good. Event model in CDI is maybe one of the best features. Some of Adam’s customers use EJB’s and CDI without knowing that it’s JavaEE which is the best possible sign that they’re focusing on business logic.

CDI

CDI is a bit of a special case. Some think that it’s powerful but that this power comes with complexity attached. Adam disagrees in terms of complexity of code (@Inject is really all you need to get started). JBoss/Emmanuel says that people are excited by CDI but portable extensions still not known by most. Jim: not that much demand for the time being, complexity might be causing some people to shy away from it but there is a lot of power there and adoption will come no doubt about it. Reza: the fact that it’s part of the web profile is the reason they’re certifying, also all Resin early adopters are coming for its CDI implementation. Need to re-align more of the platform in Java EE 7. Adam: CDI is like insurance, if there’s a need for integrating additional frameworks, anything’s possible with portable extensions, yet 90% of the projects don’t need it. SAP: CDI is great but some people still haven’t gotten their heads around Java EE 5 yet.

Java EE vs. Spring

Adam: I would never put Spring and Java EE together because there’s too much overlap. Also from a business point of view, you’d need support from two companies (Spring and AS vendor) which typically don’t like each other, so that’s a big risk. Reza: there are a several reasons to integrate both: gradual migration, leveraging Spring’s work (integration APIs). Adam replies that for new applications, there really should only be one as the injection styles overlap too much. IBM says it’s hard to align technologies like Spring with the specification planing requirements, in particular JSR 330 does not quite allow for the integration of Spring, using a CDI-style of injection will offer greater fidelity. EE needs more work there. David Blevins says they’re looking at a Guice implementation of CDI. Krasimir agrees that many projects do start from scratch so Java EE is the right choice.

Impact on tooling and testing

Krasimir: EJBContainer is a huge step forward. Emmanuel: tooling should help the developer and not be a requirement. For testing, JBoss has the Arquillian project (sort of next-generation Cargo), also works with GlassFish. David: would be neat to be able to inject resources in test code (OpenEJB working on that). Reza says trend in JavaEE is towards annotation and being more Java-centric (type-safe). Resin has no tooling plans but will integrate with Arquillian and is also developing and end-to-end testing solution. Adam: just use APIs, wizards are always suspicious and prevent people from using different tools (often the case in projects). Still looking for good unit tests (currently using junit 4, jmock, mockito). OpenEJB and GlassFish embedded help too. Roberto says that tools are also there to help people learn (NetBeans has a lot in store for that). Wizards also now produce clean annotation-based code if you decide to use them. Krasimir: tools are key because this is how most people experience and use the platform so they need to improve on a regular basis. Calling people to contribute to Eclipse. IBM: tooling evolved mainly in EE 5. Now more coverage with EE 6.

Questions from the audience

• CDI vs. JSF annotations (@ManagedBeans for instance) ? => Need to streamline some of this in future releases. CDI beans build on top of JSR 250 ManagedBeans. Need more of that throughout the platform.

• SpringMVC and CDI? => Technically possible: use CDI beans as controllers (but Reza says they’re not seeing enough demand for SpringMVC to do the work).

• Java EE vs. Spring? => Reza: different approaches, make your own decision. Jim: don’t reap out what works well. David: chose the platform you believe in and that will listen to you in the long run.

Java EE.next

Roberto (see also his technical keynote for details): Cloud as a focus, modularity as enabler (built on top of what JDK will offer). Also need to track emerging technologies (WebSockets, HTML 5). Need to evolve the specification and not let it up to vendors to implement. Jim: JavaEE can mostly run in the cloud today, bigger problem is dealing with putting large app together: need a modules system. Krasimir: really wanted modules to be there in EE 6 so couldn’t agree more. David: more generalization of the various annotations across the platform. Reza: modularity can’t be the only value-proposition of EE.next, also need realignment of underlying technologies.

Java EE 6 is here today, go ahead and try it out!

Beginning Java EE 6 Hands-On Lab from JavaOne 2010

September 24, 2010 Comments Off

Following up on my previous blog post, my JavaEE 6 hands-on lab (S313277) with Mathieu from Serli was fully booked a few weeks before JavaOne so the organizers asked for a repeat which was scheduled only a few days before the conference start.

This repeat session filled out in a couple of days I believe. The content for that lab is heavily inspired by the “BeginningEE6″ project which was initially developed as a companion to Antonio Goncalves’ “Beginning Java EE 6 and GlassFish 3″ book (2nd edition is now out btw and seemed like a best seller at the conference). This JavaOne Hands-On Lab was an introduction to some of the new features in the platform and is somewhat more polished (certainly the instructions are meant to be extensive).

You really can’t do justice to Java EE 6 in a 2-hour lab with technical issues bound to happen, so it covered one improved API and two new Platform APIs: JSF 2.0, JAX-RS 1.1 and CDI 1.0. While openworld.vportal.net has a link to the instructions document, you can also get its latest version from here (includes setup, three exercises and a troubleshooting section). Code can be found here.

JavaOne 2010 Technical Keynotes

September 24, 2010 § 2 Comments


I don’t really attend keynotes to learn something new (it’s pretty much my job to know this stuff before). Rather, I try to sense how people react by following tweeter tags and by being in the room. This year’s JavaOne Technical Keynote with Mark Reinhold, Roberto Chinnici, and Greg Bollella was no exception.

For both Mark’s and Roberto’s part of the keynote, this was clearly split into two categories: the people that felt that covering plan A/B, JDK 7/8, project Coin, and all the great new features of Java EE 6 was really old stuff and those that we’re genuinely excited by most of what they’ve heard. On the Java EE side of things I believe this was certainly the right balance.

Imagine that the vast majority of developers don’t go to JavaOne, don’t read blogs, don’t tweet, and don’t spend time downloading new open source projects and libraries. Yet, some people still found the so-called old content to be extremely useful. I certainly found the final thoughts on how Java EE should evolve for the cloud to be useful (watch the full keynote, not the highlights that trimmed the most important part :( ).

Another JavaOne around the corner

September 16, 2010 Comments Off

It’s that time of the year again when the JavaOne excitement builds up with sleepless nights getting ready for the sessions, demos, etc… I am yet again looking forward to another very fine JavaOne conference.

To be fair I wasn’t all that excited say a couple of months ago because of the changes made to the conference (different venue with Develop and Oracle Open World happening at the same time) and the anticipated lack of announcements but I can now say that the team has done a lot of work to make the venue a comfortable place (with the Zone, a huge tent on Mason street) and that content-wise, I expect a good number of things to cause long, possibly heated, discussions. This will only demonstrate how vibrant the Java community remains.

Of course there’s the future of Java SE with Mark Reinhold’s recent blog entry on proposed options for Java 7 and Java 8 (now with 171 comments!), the future of OpenJDK and where the Oracle JVM is headed but there’s also a lot more announcements I expect to come out. I’ve been to most JavaOne’s since 2000 (and blogged since 2004) and this once seems like one of the busiest for me.

Sunday
Of course I’ll be at the GlassFish Community Event and Party (Moscone and Thirsty Bear) and will attend Larry Ellison’s keynote\* in between (I’ve been told that this first keynote is when he’s the most entertaining).

Monday
I’ll have a first run of the “Beginning Java EE 6″ Hands-On Lab, will certainly not miss the JavaOne keynote\* at 5:45 and probably crash the OTN party in “The Zone”.

Tuesday
With the jetlag still in effect I hope to be there on time for Thomas Kurian’s OpenWorld keynote @ 8am. The JavaOne Technical keynote\* is planned for 2:30pm that day with Roberto Chinnici (Java EE spec lead), Mark Reinhold, and other Java architects. As it stands, the evening will be packed with receptions and parties.

Wednesday
I’ll be running the Java EE 6 “What do we do now?” panel at 10am with a great set of participants. Larry will be up again speaking at 3:15pm. I’m hoping this is the day I get to attend most sessions (still need to inject those into my agenda).

Thursday
The “Java Frontier” keynote* kick off at 9am with Ray Kurzweil and others. I then have another round of the Java EE 6 Hands-On Lab before I run to catch my plane home.

*: Streaming of all keynotes and general sessions will be available from this page (should also be linked from this page).

There will be lots of Java EE and GlassFish-related content. Check out this post on TheAquarium for the details. Full list of sessions is here. If you’re going to the conference or simply want to interact with people going there, try this tool. See you there virtually or in person.

Ok, now back to prep work.

Module initialization order in Java EE 6

July 23, 2010 Comments Off

One of the new features in the umbrella Java EE 6 specification is the ability to define the order in which modules (web applications for instance) from a given Java EE application are initialized by the container. This might be useful if you want for example a given module to serve as resource initializer to create a database table before any other module can be accessed (note this does not apply to application client modules). Previously, the order in which Java EE application modules were initialized was unspecified and by default this is still the case in Java EE 6.

To explicitly request modules to be started in a particular order, the application should use <initialize-in-order>true</initialize-in-order> in the the EAR’s application.xml deployment descriptor. The container will then start the modules in the order they are declared in that same configuration file (note that application.xml is optional by default and should be placed in the EAR’s top-level META-INF/ directory). The short example below shows an EJB singleton creating a database table upon creation and dropping it before destruction. With this setup, the database table should always be accessible to the web application.

InitDB.java (a singleton packaged in OrderMatters-ejb.jar) :


@Singleton
@Startup
public class InitDB {
     @PostConstruct
     void createDBtable() {
         //...
     }

     @PreDestroy
     void dropDBtable() {
         //...
     }
}

The application.xml deployment descriptor for OrderMatters.ear :

<application version="6"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee             http://java.sun.com/xml/ns/javaee/application_6.xsd">
     <initialize-in-order>true</initialize-in-order>
     <display-name>OrderMatters</display-name>
     <module>
         <ejb>OrderMatters-ejb.jar</ejb>
     </module>
     <module>
         <web>
             <web-uri>OrderMatters-war.war</web-uri>
             <context-root>OrderMatters-war</context-root>
         </web>
     </module>
</application>

Full details are available in the Java EE 6 platform specification, section EE.8.5.4. Of course you can use this today in GlassFish.

As an alternate solution if you’re willing to use features in GlassFish 3 beyond what Java EE 6 provides, you may also solve the problem by breaking the application into different OSGi bundles and using a combination of BundleActivator and ServiceTracker as shown in this sample from Sahoo). This can in some cases offer a more suitable and loosely-coupled approach.

Where Am I?

You are currently browsing the Java category at Bistro! 2.0.

Follow

Get every new post delivered to your Inbox.