Skip navigation
1 2 3 4 Previous Next


58 posts

Bonjour, Comment Java?

This coming Thursday(08/27/09) 'll be at GooglePlex (Mountain View) for an Eclipse Day...The entire genda is at

2 presos seem to be very interesting so far:

and possibly others...The Google crowd is impressive.

There is a waiting list for people who did not register in time:-) But I am sure online videos of the conference will be available as well.

Ludo (Testing the new Blog system)

Bonjour Comment Java?


today is some type of historical milestone for Java EE 6: This is Milestone 1 of NetBeans 6.8 and Java EE 6 support with the latest GlassFish v3 (build 57). The bundle is only 132Mb and contains everything you need to start with Java EE 6: the IDE, the Java EE 6 current runtime, the JavaEE 6 JavaDocs (for code completion), the JavaDB database, and very very cool features from the plaform or its implementation:
  • No Need for web.xml in Web Application  (and support for web-fragment.xml)
  • Servlet Annotations
  • EJB inside Web Application Projects
  • Embedded Web Browser for fast testing (Mozzilla XULRunner)
  • GlassFish v3 build 57 pre-registered
  • Stellar GlassFish v3 startup time 
  • Stellar Deploy on Save for Java EE projects (redeploy in less than a second), with Session preservation
  • JSF 2.0 and Facelet Support
  • Java EE 6 Javadoc (preview) in Code completion (not many IDEs have this support:-)
  • Singleton EJB support
  • All current Java EE 6 APIs available: 
  • Maven support
And more and more (i.e all the NetBeans 6.7.x features as well).


Read more at get the Milestone 1 bits at



Worst ever Java EE 6 Blog Blog

Posted by ludo May 25, 2009

Bonjour, comment Java?

I'm preparing some Java EE 6 JavaOne demos. While doing that, I was thinking: how can I compress most of the Java EE 6 technology inside *one* single Java Class?
If you are my manager, stop reading now...
If you believe you are an architect, stop reading now...
If you are a member of the Java Blueprints team, stop reading now...
If you are a regular java blog reader, stop reading now...
The following code is PG 40. Talk to you parents if you are less than 40.

Still reading? Not sure why, but here we go.

The following Java EE 6 compliant Application is a Web Application with just 2 source files: and persistence.xml.
It demonstrates the following Java EE 6 features:

  • Annotated Servlets 3.0, avoiding the need for web.xml!!!
  • EJB without local Interface: 100% POJO, and transactional (managed by the container) and securable
  • EJB inside a Web Application
  • JPA (still needs a persistence.xml ,  here it's defined as creating the tables at deploy time, assuming the database is already running)
  • EclipseLink Implementation
  • Default GlassFish v3 JavaDB database registered as "jdbc/__default" datasource.
  • Beans Validation framework (JSR 303...Merci Emmanuel)
  • Injection of EJBs inside a Servlet

Are you still reading? Remember the 3 tier architecture, with Data Layer, Business Layer, then Presentation Layer? Well forget it for this monster application which merges all the layers into one single Java Class, which is a Servlet, an EJB and a Entity JPA bean validated with some Bean Validation annotations...
package monster;

import java.util.*;
import javax.ejb.*;
import javax.servlet.annotation.*;
import javax.servlet.http.*;
import javax.naming.*;
import javax.persistence.*;
import javax.servlet.*;
import javax.validation.*;
import javax.validation.constraints.*;
* @author: Not Me!!!
@Stateless @Entity @WebServlet(urlPatterns = "/monster")
@Table(name = "MONSTERTABLE")
@NamedQueries({@NamedQuery(name = "MonsterEJB.findAll", query = "SELECT c FROM MonsterServlet c")})
@PersistenceContext(name = "monsterContext", unitName = "MonsterWebAppPU")
public class MonsterServlet extends HttpServlet {
    @Id @GeneratedValue(strategy = GenerationType.SEQUENCE) private int monsterId;
    @Max(2) @NotNull private String name;
    @Transient @EJB MonsterServlet monsterEJB;
  /*@Transient @PersistenceUnit(unitName = "MonsterWebAppPU") //does not work see EclipeLink bug
   private EntityManagerFactory emf;*/ //
   public void doGet(HttpServletRequest request, HttpServletResponse response)
ServletException, IOException {
       response.getWriter().println("In Servlet calling the EJB side " + monsterEJB.EJBBusinessMethod("" + this));

    public String EJBBusinessMethod(String name) {
  try {
        InitialContext ic = new InitialContext();
        EntityManager em = (EntityManager) ic.lookup("java:comp/env/monsterContext"); = name;


        Query allMonsterQuery = em.createNamedQuery("MonsterEJB.findAll");
        List allMonsters = allMonsterQuery.getResultList();
        String error = validateTheMonsterJPA((MonsterServlet) allMonsters.get(0));
      return "BusinessMethod from EJB" + allMonsters.toString() + error;
    } catch (NamingException ex) {
     return "Error in EJBBusinessMethod "+ex.getMessage();

    private String validateTheMonsterJPA(MonsterServlet m) {
       String error=" ";
       ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
       Validator validator = factory.getValidator();
       Set<ConstraintViolation<MonsterServlet>> s = validator.validate(m);
     for (ConstraintViolation<MonsterServlet> c : s) {
            error = error+ " Contraint Violation: " + c.getMessage());
    return error;

And the persistence.xml to put in the WEB-INF/classes/META-INF directory of this Web Application

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns=""
    <persistence-unit name="MonsterWebAppPU" transaction-type="JTA">
  <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>

This Web Application can be deployed as it to the latest builds of GlassFish v3. The page output is something like:

In Servlet calling the EJB side BusinessMethod from EJB[monster.MonsterServlet@5718c3a7]  Contraint Violation: must be less than or equal to 2

Now the quiz:

  1. Explain the following statement: @Stateless @Entity @WebServlet
  2. what do you need to change in the code to remove the Contraint Violation statement in the output?
  3. Why do we need to inject the EJB aspect of this class into the servlet and cannot  just use "this" ?
  4. Do you think this bug will be fixed? 

Still reading? Now I have just corrupted your brain: while not recommended, it is possible to write a 3-tier Java EE 6 Application with Servlets, EJBs, JPAs, Beans Validation in one single Java class and one single xml file...
Can't wait for Java EE 7 when persistence.xml will become optional:-)

See you at JavaOne. You can now forget this blog. Someone had to write it. It's over now:-)


GlassFish Tooling Blog

Posted by ludo May 22, 2009

Bonjour Comment Java?

Finally the GlassFish Tools bundle for Eclipse has been released: version 1.0 is available at

The Tools bundle contains:

  • Eclipse 3.4.2 IDE with WTP Java EE support
  • GlassFish v2.1 pre-registered and configured
  • GlassFish v3 Prelude pre-registered and configured
  • JavaDB sample database pre-registered and configured
  • GlassFish Plugins
  • GlassFish documentation
  • And optionally, a JDK 1.6.

Installers are available for Windows and MacOSX, and tar.gz for Linux systems.
If you have used a preview release (pre version 1.0), make sure to read the release notes information about a known issue regarding reusing workspaces created with preview releases. Commercial support for this bundle is also available at

I like the fact that the GlassFish servers are preconfigured, ready to use, even with a sample Java DB database pre registered (to use the JPA entities tooling). By default the "Deploy On Save" feature is enabled for GlassFish v3 Prelude: it means that the moment you save a Servlet, a utility class, or even an EJB, the application is automatically updated and redeployed to the running server in an optimal way. If you want to play with leading edge bits for GlassFish v3 Java EE 6, you can even register and download from the bundle a promoted build (happens every week) of the latest GlassFish v3 server. We will demo more about that at the JavaOne conference.

We are now working on a version 1.1 (and nightly builds will be available next week. Version 1.1 will add the OpenSolaris 2009.05 target, an optimized installer with Pack200 technology to reduce the download size by almost 2!, the JAX-WS and JAX-RS Jersey RestFul GlassFish Plugins, Maven 2, a MySQL JDBC driver pre registered for better out of the box experience with the MySQL database, the entire Java EE 6 Javadoc available in the Eclipse Editor code completion, and of course the latest bug fixes.

I hope to see you at JavaOne 2009.


EclipseCon GlassFish Slides Blog

Posted by ludo Mar 25, 2009
Bonjour, Comment Java?
EclipseCon 2009 GlassFish Java EE 5, Eclipse Slides are now online:



GlassFish and Eclipse Blog

Posted by ludo Mar 23, 2009

Bonjour Comment Java?

In a few hours, I'll be attending the EclipseCon Conference as a speaker. I've 2 talks, one around the GlassFish v2.1, v3 Prelude and GlassFish v3 Eclipse Bundle tooling (both for Java EE 5 and the coming Java EE 6) support, and the other one more targeted to GlassFish v3, its OSGi kernel (either Felix or Equinox) and some cool demos using Java EE features like EJBs inside a Web Application, or the new @Singleton or @Schedule timer annotations.

Also, this year, Sun Microsystems is a Gold Sponsor of the EclipseCon conference, so if you are around make sure you stop at our booths (GlassFish, OpenSolaris and JavaFX)
and see what has been done to better support Eclipse users.

q    e

Talk to you soon.

Bonjour, comment Java?

It has been said that GlassFish V3 Prelude could run with Eclipse Equinox OSGiimplementation, but I could not find any real article on the web on how to setup this configuration. GlassFish V3 Prelude is bundled with Apache Felix OSGi implementation and this is the supported OSGi platform.The GlassFish community has also the honor and privilege of working directly with Richard Hall who recently joined Sun Microsystems.

But it does not mean we cannot try our runtime with other OSGi implementations to detect either bugs in our OSGi usage or bug in OSGi implementations:-).

Here are the steps to make the GlassFish v3 Prelude running on top of Equinox. There are still a few warnings in the log file that will be addressed soon I guess.

Download the fist Equinox zip file from
unzip this file under the GlassFish v3 Prelude directory. In my case this directory is C:/glassfishv3-prelude/glassfish
You should now see the following directory structure:

C:/glassfishv3-prelude/glassfish/eclipse/plugins/*.* jars

create  a new C:/glassfishv3-prelude/glassfish/eclipse/configuration directory and create a config.ini file in this configuration directory:
First lines of this file  need to be adapted to your installation directory:

# GlassFish required properties
# HK2 OSGi Adapter property

You are almost done. Now you need to configure the GlassFish v3 Prelude runtime to use Equinox instead of Felix. To do that, set the GlassFish_Platform environment variable:

On Windows, you can do  in a terminal:

set GlassFish_Platform=Equinox
On Mac OSx, you would do something like:
export GlassFish_Platform=Equinox

Now, from the  C:/glassfishv3-prelude/glassfish/bin directory, you can start the default domain:

.\asadmin start-domain --verbose

The server is starting...


And the welcome page can be seen:


There are still too many warnings in the console and I made Jerome aware of the issue. He told me that this will be fixed soon...

It would be nice to see how the other Application Servers based on OSGi framework handle OSGi implementation customization...Any links?



Jython 2.5 beta is out Blog

Posted by ludo Nov 1, 2008
Bonjour, comment Jython?

Jython 2.5 beta release
has been announced by Frank Wierzbicki. Cool, this is yet another strong addition to the JVM supported scripting languages. Let's see how long it will take to get a perfect NetBeans IDEsupport, and of course a Python container module in GlassFish v3, runningDjango...


Modern Economy Blog

Posted by ludo Oct 30, 2008
0.000 000 000 000 000 000 000 000 000 000 000 001 one undecillionth
0.000 000 000 000 000 000 000 000 000 000 001one decillionth
0.000 000 000 000 000 000 000 000 000 001 one nonillionth
0.000 000 000 000 000 000 000 000 001 one octillionth
0.000 000 000 000 000 000 000 001 one septillionth
0.000 000 000 000 000 000 001 one sextillionth
0.000 000 000 000 000 001 one quintillionth
0.000 000 000 000 001 one quadrillionth
0.000 000 000 00 one trillionth
0.000 000 001 one billionth
0.000 001 one millionth
0.001 one thousandth
0.01 one hundredth
0.1 one tenth
1 one
10 ten
100 hundred
1 000 thousand
100 000 one hundred thousand or a lakh
1 000 000 one million
1 000 000 000  one billion
1 000 000 000 000 one trillion
1 000 000 000 000 000 one quadrillion
1 000 000 000 000 000 000 one quintillion
1 000 000 000 000 000 000 000 one sextillion
1 000 000 000 000 000 000 000 000 one septillion
1 000 000 000 000 000 000 000 000 000 one octillion
1 000 000 000 000 000 000 000 000 000 000 one nonillion
1 000 000 000 000 000 000 000 000 000 000 000 one decillion
1 000 000 000 000 000 000 000 000 000 000 000 000 one undecillion
1 000 000 000 000 000 000 000 000 000 000 000 000 000 one duodecillion
1 000 000 000 000 000 000 000 000 000 000 000 000 000 000 one tredecillion

Et unraton laveur.
Bonjour, comment Java?

GlassFish V3 Prelude development is in full speed. Yesterday, I was happily surprised by the ease of use of the GlassFish Update Center... For some reasons (installing iTunes 8.0 and QuickTime), I had to reboot my MacBookPro, and on reboot, I noticed a nice "Update Tool Notifier" on my desktop:


Woa...Nice...So I clicked on it, (expecting for a failure as GlassFish V3 Prelude is still under development), and the GlassFish Update Center tool showed up:


Nice, very nice: I had GlassFish V3 Build 21 installed, and the Update Tool was showing some updates for the newest Build 23....As you can see, some components are bigger, some others are smaller. So I clicked on the Update button and the download process of the components started:


After 30 seconds of download and installation time, I was ready to play with the latest GlassFish V3 Prelude bits...This was a very pleasant experience...
Good job Update Tool team!



Next week, I'll be in Zurich for the Jazoon conference with the GlassFish crew. This is a Java conference, and I'll be talking about....PHP and OpenSolaris and the OpenSolaris WebStack (Apache, MySQL, PHP,...). What!!! PHP at a Java conference? Am I crazy?

I hope not. OpenSolaris 2008.05 is not your father's Solaris. It is something I can use and it comes with a modern AMP stack. So what is the relationship with Java then? Well, since I am a GlassFish developer (and NetBeans developer, and Eclipse developer), I'll be talking about the possible integrations of the AMP stack and GlassFish:
  • Configuring the OpenSolaris Apache and GlassFish with mod_jk to have parts of your Apache web site served with GlassFish
  • Configuring the PHP-Java Bridgeon OpenSolaris to extend your PHP applications with 'legacy calls' to Java processing performed under GlassFish
  • Using daily builds of NetBeans 6.5 that have killer support for:
Jazoon   And on Monday, we will host a Jazoon GlassFish day, so if you are around, please stop by and ask as many crazy questions you want. The GlassFish team will be there and well represented. Thanks Alexis for organizing this GlassFish day.

Next stop will be Ajaccio and Britany, but definitely not for work:-)


GlassFish V3 TP2 is now available. If you want to use it, or even download it fromNetBeans 6.1, just fire the IDE, go the tools->plugins menu and refresh the list of modules, you should see 2 modules, one for Java EE development and one for jRuby projects. Just watch the images to see how you can get both the NetBeans modules, and then download the GlassFish V3 TP2 runtime, and see the 2 new libraries registered by the Server: EclipseLink to do JPA entity beans work and Grizzly Comet to do cool Comet Applications...
Most of the Java EE support from NetBeans 6.1 works with GlassFish V3 TP2 (Db to JPA, JPA to JSF, jMaki, Jersey RestFul services,...) and if you are a jRuby on Rails developers, you can now select the GlassFish server as s deployment target for your NetBeans jRoR projects...

Just scroll through the following images, and you'll know everything about this new NetBeans/GlassFish integration:














My my, hey hey
Rock and roll is here to stay
It's better to burn out than to fade away
My my, hey hey

Out of the blue and into the black
They give you this, but you pay for that
And once you're gone, you can never come back
When you're out of the blue and into the black

The king is gone but he's not forgotten
This is the story of Johnny Rotten
It's better to burn out than it is to rust
The king is gone but he's not forgotten

Hey hey, my my
Rock and roll can never die
There's more to the picture
Than meets the eye
Hey hey, my my

If only this page could also play the music...  

CommunityOne JavaOne 2008 Blog

Posted by ludo Apr 30, 2008

Here comes the JavaOne/CommunityOne craziness again next week. The conference week will mark the end of long hours and days of preparation in many different topics:
  • OpenSolaris Indiana Web Stack integration (Apache, MySQL, PHP)
  • GlassFish V3 TP2 
  • GlassFish V3 TP2 plugin for NetBeans 6.1 (for Web Applications and jRuby On Rails Applications)
  • GlassFish V3 TP2 plugin for Eclipse 3.3
  • jMaki version 1.8: Plugins for NetBeans(JSP, PHP, Ruby, Phobos) and Eclipse (JSP)

OpenSolaris Indiana Web Stack integration (Apache, MySQL, PHP)

I'll be presenting to the CommunityOneOpenSolaris Sessions the current status of AMP support in the brand new OpenSolaris distro. Details here. Topics will be Apache, MySQL, PHP support in Indiana, NetBeans PHP support, IPS repository support, Desktop Integration, possibly PHP Debugging on OpenSolaris, and Dtrace Support.


CommunityOne is on Sunday, May 4th, the day before JavaOne.  Here is the list of talks for the OpenSolaris track:

  • Getting Started with OpenSolaris; New Features & Building OpenSolaris Packages -- David Comay, Stephen Hahn
  • OpenSolaris Operating System and SAMP (Solaris OS, Apache, MySQL, PHP) Support for Web 2.0 Development: Developer Experience -- Ludovic Champenois, Jyri Virkki
  • A Student and New User View of the OpenSolaris OS -- James Hughes
  • Develop, Consolidate, and Manage Virtual Environments entirely in Open  Source -- Achim Hasenmueller, Joost Pronk
  • OpenSolaris Operating System for Intel: Present and Future -- David Stewart, Intel Corporation
  • The OpenSolaris™ Operating System and Storage -- James Hughes
  • OpenSolaris™ Operating System and Wireless Networking Advances -- Geeta Krishna, Intel Corporation
  • OpenSolaris™ Installfest: Get it NOW!
There will be an after party at Moscone Center this sunday (May 4th).
From 6-8pm, there will be a CommunityOne event featuring OpenSolaris at Moscone in SF which featuring a live DJ and have a Cinco De Mayo theme.

I'll be also talking for the CommunityOne GlassFish track:
  • S295418 - Tools for GlassFish V3 (Java EE Platform and Scripting Environment) -- Ludovic Champenois, Vivek Pandey
Of course, GlassFish V2 is available in the OpenSolaris IPS repository:


You can use the Package Manager GUI to download GlassFish V2 in Opensolaris:


GlassFish V3 TP2

Glassfish V3 is the next version after the excellent GlassFish V2...Duhhh...But wait OSGI support, , EJB inside Web Applications (yes, not in EJB Modules), JPA with EclipseLink JPA provider, jRuby on Rails Applications support, Phobos support, Jython/Django, Groovy (with JSF/Groovy support...wait for some killer demos), IPS based update Center, NetBeans support, Eclipse support, ANT support, Embed ability support, sub second startup time, Cometd support (lots of cool demos at JavaOne), Jersey RestFul Web Services support, jMaki support, already really good web performance (thanks Grizzly and Java NIO, thanks!)...

      Apr 9, 2008 8:44:48 PM 
      INFO: Created and Initialized container: ejbName: NewSessionEJBBean
      Apr 9, 2008 8:44:48 PM com.sun.enterprise.v3.deployment.DeployCommand execute
      INFO: Deployment of WebApplicationWithEJBs done is 638 ms

GlassFish V3 TP2 plugin for NetBeans 6.1 (for Web Applications and jRuby On Rails Applications)

NetBeans 6.1 IDE just shipped, but wait.... go the the Update Center, and download the GlassFish V3 TP2 plugins, one for Java EE support, one for the jRuby on Rails projects to get all the incredible Java EE or jRuby developer features that are packed in the IDE with a V3 target... You cannot beat NetBeans 6.1 for Java EE and Ruby features, no way!!!


GlassFish V3 TP2 plugin for Eclipse 3.3

For the Eclipse enthusiasts, GlassFish V3 TP2 server has a plugin as well, so that you can develop Dynamic Web Projects (via WTP) and deploy/debug them with a GlassFish V3 target, including JPA EclipseLink database applications.  Or and if you recall GlassFish V3 TP2 is OSGI based, then, you'll understand a bit more this screen showing GlassFish OSGI modules running embedded inside the Eclipse IDE:

GlassFish V3 TP2 running embedded inside Eclipse 3.3

See the list of OSGI bundles in this "About Eclipse" dialog:


jMaki version 1.8: Plugins for NetBeans(JSP, PHP, Ruby, Phobos) and Eclipse (JSP)

The new jMaki plugins for NetBeans 6.1 and Eclipse will show up later this week on the update centers or the site

So, I guess you have now a sense of the crazy days before CommunityOne and JavaOne. Hope to see you there in person next week,


I just love it when things are aligned. Today, it is about Eclipse and Sun, or I should say Eclipse Foundation and the GlassFish community.
Read it at : EclipseLink will be used in GlassFish V3 Application Server (Java EE 6) and it will be the reference implementation for JPA (Java Persistence API) 2.0.
Correct me if I am wrong, but it seems to be the first press release ever done mentioning those 2 names: Eclipse Foundation and Sun Microsystems. If you are an Eclipse user, I hope you have noticed the *only* company name that is displayed in the Eclipse splash screen. If not, pay attention the next time you see the screen...

As you might know, I've been involved a lot in the J2EE and Java EE support in NetBeans, and honestly, I can tell this is one of the best support you can get for Java EE developers. And I have also been involved in the GlassFish (V1, V2 and V3) plugin for Eclipse as well as the jMaki plugin for Eclipse. It is good to be able to reach as many developers as possible and give them access to one of the best application server out there.

This week, EclipseConconference is happening in Santa Clara, and Carla Mott and I will be speaking about GlassFish V2, GlassFish V3, jMaki  and Eclipse:  See
Our talk is Thurday, March 20th at 10:30 am Grand BallRoom F: Eclipse: Enterprise Apps and Rich Front-end using GlassFish and jMaki.

If you are not familiar about the GlassFish Application Server support in Eclipse, please read these pages:
  4. and watch the screencat at
Both the GlassFish plugin and the jMaki plugin are being updated this week (tomorrow?) for a better GlassFish V3 support and a brand new jMaki 1.1 beta support. We are just doing the final testing today.

Enjoy, and as always, feedback is welcome,