Bistro!
Alexis Moussine-Pouchkine's Weblog
public enum Topic { Java, GlassFish, Tools, Sun, InFrenchInZeText, SDPY }

20090808 samedi août 08, 2009

Latest GlassFish Podcast episode: Antonio Goncalves

It's been a while since the last GlassFish Podcast episode and even longer since the last interview, so here it goes - episode #36 an interview with Antonio Goncalves.

Antonio has many hats and this discussion covers a lot of ground starting with his recently published Java EE 6 book with GlassFish v3. We get into his favorite Java EE 6 feature, his role in the JCP as an individual contributor, his take on Spring vs. Java EE 6 and some thought on JSR 299 (the interview predates the inclusion of JSR 330 into Java EE 6). We also discuss Antonio's role as the leader of the Paris JUG inspiring more than a dozen other JUGs across the country.

Enjoy the episode.

( août 08 2009, 11:46:52 PM CEST ) Permalink

20090710 vendredi juillet 10, 2009

Top reasons why GlassFish v3 is a lightweight server

I have been involved in helping a couple of consultants put together a presentation on the future of app servers and one thing that struck me was that in the resulting slides, they equated lightweight appserver with the use of the Spring framework. Using Spring in WebSphere doesn't make any lighter. I don't think that deploying an archive with 90% being runtime qualifies as lightweight (hence the SpringSource tc and dm server offerings), but I also think that painting every application server as being monolithic and heavyweight is a gross caricature, so here are my top reasons why GlassFish *is* a lightweight application server.

#1 • Download size
For some people download size matters. For them and for everybody else, GlassFish v3 downloads start at 30MB for the web profile (get it here). The updatetool will then help you scale up or down from there. Of course you can also start with the "a la carte" approach and go even lighter (20MB for a functional RESTful+EJB31 server). Some others are fighting hard to fit on a single DVD or CD.

#2 • Pay for what you use
With the extensible architecture of GlassFish v3, services and containers and brought online only when artifacts using them are deployed to the runtime. Deploy your first WAR and the web container will take a couple of seconds to start. Deploy your second webapp in a fraction of a second. Remove the last webapp and the web container will not be restarted on subsequent server restarts. Some people call that on-demand services.

#3 • Fast (re)deployment
Beyond incremental compilation (which most IDE's offer nowadays) and deploy-on-change (simply save the source and reload the web page), the time to (re)deploy an application is key to a developer's productivity. The GlassFish team has spent time optimizing that process to offer sub-second redeploy time for simple applications. GlassFish v3 also offers the preservation of sessions across redeployments which is a pretty safe operation (new class-loader, new application) and costs less than 5 seconds to recreate a Spring context (for instance with the jpetstore demo on my laptop), and even less on traditional JavaEE webapps. This is all built into the product with no configuration or add-on required. Check out this recent (and short) screencast for an illustration.

#4 • Startup time
Even in the days of (fast) redeploy, startup time still matters to both developers and operations. GlassFish v3 starts in about 3 seconds with a warm felix cache. Starting the web container is about an extra 3 seconds. Deploying individual applications depends largely on their size and complexity but let's say that it starts at around 100ms and should not go beyond 30 seconds. Starting GlassFish v3 with Apache Roller already deployed (not exactly the lightest webapp there is out there) will cost you about 20 seconds.

#5 • Memory consumption
One might think the OSGi nature or the application server introduces an unwelcome memory overhead. For an application servers like GlassFish v3, that certainly isn't a problem as a base GlassFish v3 runtime is using less than 20MB (another "side effect" of the modular & extensible architecture) and a non-trivial application only 50MB of heap (as reported by visualvm). Not quite small enough to run on a feature phone, but that may well happen sooner than we all think, especially when using the Static mode (no OSGi) and the embedded api.

#6 • Spring *and* OSGi
No need to choose between standard JavaEE, Spring, and OSGi. You can have all of the above in a single integrated product. In fact you can even use the unmodified OSGi-fied Spring DM version of the framework, and make it available at the expense of a couple of clicks in the update tool. The HK2 layer in GlassFish v3 is abstracting OSGi away and manages to have GlassFish retain its lightweight feel while allowing for Java EE components to inject any OSGi-based declarative services at the expense of a standard @Resource annotation. I don't know if you think this lightweight but I certainly find this to be an elegant integration.

#7 • Open Source
GlassFish is open source, so you can make it whatever you want, even a heavyweight monster if you so decide! Certainly the barrier to entry for using GlassFish is very lightweight.

But the real question is - is GlassFish v3 lightweight for you(r application)?
Whatever the answer is, I'd love to hear your comments and experience!

( juil. 10 2009, 10:55:41 AM CEST ) Permalink Comments [1]

20090708 mercredi juillet 08, 2009

Short screencast on GlassFish v3 session redeployment

There are already a few demos out there showing the session state preservation across redeployments in GlassFish v3, but they all use a single page, so I thought I'd create a short one using an application closer to a real-life one (i.e. using a non-trivial framework like Spring). Of course this will work across any sort of framework and Spring is not a requirement ;)


Larger offline format here.

Preserving the session across redeployments is a GlassFish v3 feature while "deploy-on-save" is done by the plugin in the IDE talking to GlassFish. That and the session redeployment work equally well in NetBeans and Eclipse. IntelliJ also preserves the session across redeploys.

( juil. 08 2009, 05:39:54 PM CEST ) Permalink

20090629 lundi juin 29, 2009

Which GlassFish version is right for me?

GlassFish has several versions that you may have heard of. Each one attempts to address different needs. I've had several people in the last couple of weeks ask me which one they should use, so here's a quick list of features and reasons to use one more than the other.

GlassFish v2.1: current JavaEE 5-certified and supported product. Offers centralized admin, clustering. v2.0 was released in September 2007 and v2.1 in March 2009 with the Enterprise Manager value add. All major IDE's (NetBeans, Eclipse, IntelliJ) have plugins to deploy to this version. GlassFish v2.1 update 3 is the latest version available for supported customers.

GlassFish v3 Prelude: interesting if you want a lightweight Java EE 5 web container (no EJB, JMS, etc...) with admin tools. This is the first release using the modular OSGi architecture, IPS packaging format, and developer features such as preserve session across redeployments. This was released in November 2008 and is a supported product (although not a long-lived as traditional software at Sun). It also offers native deployment of Grails and Rails applications. Some people use this version in development and deploy to v2.1.

GlassFish v3 Preview: while not yet a supported product, this is a more recent version building on the same foundation as the above "Prelude" version, only it now offers both a Web distribution and a full Java EE 6 (Preview) distribution. It has a number of improvements over the "Prelude" version (IPS and updatetool for instance) and certainly much closer to a fully-featured application server. The final version should ship in September 2009 and offer a JavaEE 6, single-instance architecture. At that point this will become a supported product. The centralized administration will come in the v3.1 release which will mean feature parity with v2.1. If you like bleeding edge stuff, promoted builds for v3 are here.

For more details on the releases, including sustaining (restricted) releases, please visit http://blogs.sun.com/GlassFishForBusiness/

( juin 29 2009, 10:16:00 AM CEST ) Permalink Comments [11]

20090625 jeudi juin 25, 2009

GlassFish et Java EE 6 à Niort mercredi prochain

Antonio pour la partie Java EE 6 et votre serviteur pour GlassFish v3. Détails ICI.
Comme le dit Wadael, espérons que GlassFish y gagnera en assurances! ;-)

( juin 25 2009, 10:53:47 AM CEST ) Permalink Comments [6]

20090624 mercredi juin 24, 2009

GlassFish v3 (custom) distributions with IPS

In the last part of my 'GlassFish à la carte' series of blogs and screencasts there is a missing piece if you were to try to reproduce the scenario - the GlassFish v3 IPS package containing the definition of my custom distribution (a distribution could be thought as a product/implementation of the notion of a profile as defined in Java EE 6).

That custom distro is the set of core GlassFish v3 packages which are required by my application (in this case it was using JAX-RS and EJB 3.1). While most GlassFish packages are meant to contain some sort of artifact (most likely a collection of JAR files as explained in these posts), this "distro" package for GlassFish has no such artifact but rather a key depends section of the package prototype file.

You can find the source for building the package on the glassfish-repo project site. As you can see there, the list of required modules is simply expressed :

"depends" : {
     "pkg:/felix@1.8.0" : {"type" : "require"},
     "pkg:/glassfish-amx@3.0-51" : {"type" : "require"},
     "pkg:/glassfish-common@3.0-51" : {"type" : "require"},
     "pkg:/glassfish-corba-omgapi@3.0.0-20" : {"type" : "require"},
     "pkg:/glassfish-ejb-lite@3.0-51" : {"type" : "require"},
     "pkg:/glassfish-grizzly@1.9.15-0" : {"type" : "require"},
     "pkg:/glassfish-hk2@3.0-51" : {"type" : "require"},
     "pkg:/glassfish-jca@3.0-51" : {"type" : "require"},
     "pkg:/glassfish-jsf@2.0.0-13" : {"type" : "require"},
     "pkg:/glassfish-jta@3.0-51" : {"type" : "require"},
     "pkg:/glassfish-management@3.0-51" : {"type" : "require"},
     "pkg:/glassfish-nucleus@3.0-51" : {"type" : "require"},
     "pkg:/glassfish-web@3.0-51" : {"type" : "require"},
     "pkg:/jersey@1.1.0-1.0" : {"type" : "require"},
     },

Note that this requires using the http://pkg.glassfish.org/v3/dev repository which hosts the promoted builds of GlassFish v3. With a stable build (once GlassFish v3 is declared final), the explicit implementation could go away (mostly the -51's in the example above which refer to promoted build 51). Finally, the glassfish-jca module listed above should really not be required if it wasn't for a silly bug (that is fixed in the next promoted build).

So there it is, a really simple way to make sure a given set of packages will be present before you deploy your application. Of course the packages that make up a distribution do not need to all be core GlassFish package. In particular one could imagine including the Spring container as demoed here and discussed there.
Maybe we should create two such packages for the two official Web and Full distributions Sun offers for GlassFish v3.

( juin 24 2009, 07:00:00 AM CEST ) Permalink

20090622 lundi juin 22, 2009

GlassFish at the Jazoon Conference

The GlassFish Day at Jazoon was really well attended (significantly more than last year) and is now over, so the rest of the conference can now start. This is a good time to go thru the list of GlassFish-related talks at the conference, so here it goes:

James Gosling's Keynote
Roberto on Java EE 6
Jérôme and Ludo on GlassFish v3
Java EE 6 BOF
Hudson talk
Ed's JSF 2.0 presentation
Harold on Metro Web Services
Ludo again, this time on JavaFX+GlassFish v3
Ed on JavaFX+JavaEE

Slides for the GlassFish Day are being posted here.

( juin 22 2009, 06:29:26 PM CEST ) Permalink

20090619 vendredi juin 19, 2009

GlassFish v3 a la carte screencast - Part 3 - Jersey and EJBs

In the first screencast, I installed a minimal GlassFish v3 from a small bootstrap (IPS toolkit), created a domain and started the server. The second entry did something actually useful with GlassFish and two containers: Java Web and Spring. In this screencast, I layer a custom distribution on top of a GlassFish kernel. Enough to deploy a JAXR-RS / EJB 3.1 (lite) application.

For the sake of brevity this screencast is mostly command-line. It starts with the 5MB ips bootstrap and installs a pre-defined custom distribution which is enough to deploy the jersey-ejb sample application. The custom distribution is essentially an IPS package with no artifact, only a set of dependencies on other packages. For the curious out there, here is the step-by-step for the screencast :

bin/pkg set-publisher -P --enable -O http://pkg.glassfish.org/v3/dev dev.glassfish.org
bin/pkg set-publisher --enable -O http://localhost:10001 localRepo
bin/pkg install sample-distro
bin/asadmin create-domain --instanceport 8080 --adminport 4848 mydomain
bin/asadmin start-domain
bin/asadmin deploy ~/jersey/jersey/samples/jersey-ejb/target/jersey-ejb.war
open http://localhost:8080/jersey-ejb/

I hope this series of screencasts demystifies the IPS/packaging side of GlassFish and shows the interesting possibilities it offers to end-users.

( juin 19 2009, 04:42:38 PM CEST ) Permalink

20090618 jeudi juin 18, 2009

GlassFish at Lyon JUG

JUG's in France have been popping up here and there at an amazing rate in the past 18 months since Antonio and the team have started the Paris JUG. I think we're somewhere in the 12 JUGs or so. For a country that didn't have any really active one only 2 years ago that's just amazing.

I was down in Lyon earlier this week for a JUG meeting (this was only their third meeting) on Groovy and GlassFish where over 60 people showed up. Come to think of it, when adding up all the JUGs, I think we average about 1000 attendees very months, that's the equivalent of a pretty decent conference. The feedback I've received was pretty good. I did a demo-heavy presentation focused on GlassFish v3 (most importantly the modularity and extensibility) and the 30-minute Q&A session took me to demo v2 (Enterprise Manager), explain the pricing model and monetization strategy, discuss more generally the Java EE and app server statuses, and deflect the best I could some Oracle-related questions...

My slides are here and you can read some notes on the event here (in French).

( juin 18 2009, 11:27:44 AM CEST ) Permalink Comments [1]

20090612 vendredi juin 12, 2009

GlassFish v3 a la carte screencast - Part 2

In the first screencast, I installed a minimal GlassFish v3 from a small bootstrap (IPS toolkit), created a domain and started the server. This entry will actually do something useful with GlassFish and two containers: Java Web and Spring.

The Spring DM (OSGi) part of the demo is described in Jerome's GlassFish V3 Extensions, part 3 : Spring, Java EE 6 and OSGi blog entry. In the screencast, the manual install of the Spring bits is replaced by adding a new repository definition (a local one) and installing a single package from there. For the rest, the demo demonstrates how to extend GlassFish without using any GlassFish API and how to invoke an OSGi bundle service without using any OSGi API - the servlet injects the service by name using a standard @Resource annotation. Note that Jerome's most recent blog entry covers OSGi Declarative Services for a somewhat simpler approach.

The screencast was done using the dev/ repository, so your experience may vary as the boundaries of the IPS packages and their dependencies are still being worked. Also, instead of the default Felix console briefly shown, you could use the web console described by Sahoo.

The full-size (and offline) video is available here (15MB, video/x-m4v).
The next screencast will show how one can seamlessly add more GlassFish v3 features to obtain a "full" Java EE application server and still benefit from the modular architecture in terms of pay-as-you-grow (startup time, load-on-demand, memory consumption, ...).

( juin 12 2009, 01:32:12 PM CEST ) Permalink

20090611 jeudi juin 11, 2009

How many bytes does it take to update a full GlassFish install?

The answer is 24MB.
... and that's for an initial full install weighting 63MB. The reason for it being small (other than the fact that you *can* do such a full update) is that IPS, the packaging system behind GlassFish v3 works at the file level rather than with package granularity.

Your mileage may vary depending on the jump you're trying to make (in my case this was from b47 to b49).
Here's a quick replay of my experience :
% bin/pkg set-authority -P -O http://pkg.glassfish.org/v3/dev --enable dev.glassfish.org
% bin/pkg image-update
DOWNLOAD PKGS FILES XFER (MB)
Completed 32/32 198/198 24.10/24.10

PHASE ACTIONS
Removal Phase 64/64
Install Phase 39/39
Update Phase 193/193
PHASE ITEMS
Reading Existing Index 9/9
Indexing Packages 41/41

Voilà !

( juin 11 2009, 08:54:08 AM CEST ) Permalink

20090610 mercredi juin 10, 2009

GlassFish v3 a la carte screencast - Part 1

Given the modular approach taken in GlassFish v3 (170+ OSGi bundles in v3 Preview) and the IPS/pkg(5) tooling provided, I created a first screencast showing the following :
• install the IPS toolkit image (download), a 5MB bootstrap
• define the repository to get to the GlassFish v3 bits (pkg.glassfish.org/v3/dev/ in this case)
• install the minimum set of packages required to create and start a domain (using the pkg command-line and the graphical updatetool)

The full-size (and offline) video is available here (15MB, video/x-m4v).
Further screencasts will show how one can add selected features (containers) to deploy specific applications.

Of course you don't have to be fiddling around with the various GlassFish v3 packages and could also be downloading one of two GlassFish v3 Preview distributions: web profile and full Java EE 6. Even then you'll only pay for what you use.

( juin 10 2009, 08:18:34 AM CEST ) Permalink

20090531 dimanche mai 31, 2009

Pre-versions GlassFish v3 et Java EE 6 disponibles

Avec quelques heures d'avance sur le démarrage de JavaOne 2009, Sun vient d'annoncer la sortie de GlassFish v3 Preview (à ne pas confondre avec Prelude sorti l'année passée) qui propose une implémentation de Java EE 6 en attendant le mois de septembre et les versions finales.

GlassFish v3 Preview est disponible en deux versions pour refléter le profil Web défini par la spec Java EE 6 (la modularité du serveur et son updatetool permet de passer facilement d'une version à l'autre). Cette version propose une implémentation complète d'un appserver (contrairement à Prelude qui ne proposait qu'un web container). On y trouve donc un conteneur EJB 3.1 (local ou distant), JSR 299 et Bean Validation (merci JBoss), JAX-RS (Jersey), JSF 2.0 (Mojarra), JAX-WS 2.2 (Metro), et d'autres encore.

Bien entendu, le socle technique reste basé sur OSGi (par défaut Felix dans le cas de v3 Preview), l'extensibilité reste offerte par HK2 (pour n'avoir qu'une seule ligne de commande, un seul fichier de config et une seule console d'admin web extensible quels que soient les modules présents) et les fonctionnalités de productivité (temps de démarrage, deploy on change, préservation des sessions sur redéploiement) sont là et élargies à Eclipse (3.4) en plus de NetBeans (6.7 RC). Mon petit doigt me dit que tout ceci sera démontré lors de la technical keynote de JavaOne du mardi après-midi.

Il y a également le support des langages et frameworks dynamiques: Groovy/Grails et jRubyOnRails, mais aussi désormais Jython (encore en Release Candidate) et Django. Tous sont disponibles sur l'updatecenter (ou on trouve également un package hibernate). Au delà des profils Java EE 6, la modularité de GlassFish v3 permet de se monter un serveur à la carte et d'imaginer par exemple une solution légère alliant Grizzly et Jersey (une combinaison populaire).

Et maintenant, place à JavaOne!

( mai 31 2009, 10:00:00 AM CEST ) Permalink

20090529 vendredi mai 29, 2009

GlassFish unconference - this Sunday

What do Ted Goddard, Eduardo Pelegri-Llopart, Paul Sandoz, Kohsuke Kawaguchi, Bill Shannon, Jeanfrancois Arcand, Larry Cable and Jerome Dochez have in common? They've all registered to attend the GlassFish Unconference this coming Sunday in San Francisco (1pm Hall A at Moscone Center, details in the previous link).

As a reminder this is a free event and the content will be based on the interest of the people who show up. So don't be shy and make sure you take this opportunity to pick the brains of the development team, provide feedback, and understand where the community and products are going. Here's some background on unconferences.

So far, popular topics include GlassFish (v3), OpenESB, Hudson, and REST/JAX-RS/Jersey.
Registration is recommended.

( mai 29 2009, 07:04:16 PM CEST ) Permalink

20090525 lundi mai 25, 2009

GlassFish @ Java AppServer Day (Genova)

I was lucky to visit Genova last week for the Java AppServer Day organized by the local JUG. I tend to blindly trust the organizers of JUG-initiated events and this event was yet another good reason to keep on doing this.

The event had exactly 100 attendees and the format was 30-minute sessions with a round-table at the end. I went first and focused on GlassFish v3 since this was mostly a developer audience and clearly had no time to also cover the clustering/operations side of GlassFish in half an hour. I did try to do as many demos as possible around startup time, dynamic startup/shutdown of services, Deploy on save in NetBeans, Session preservation across redeploys with a non-trivial application, extending GFv3 with a Spring container (available right from a local update center repository) to demonstrate OSGI-based GlassFish v3 extensibility as detailed in Jerome's latest blog entry.

JBoss' Alessio (Web Services lead) alluded to JBoss 5.1 being very close to being released (and indeed it has been since). Now waiting for the supported version ;) He also mentioned OSGi as being a priority for the next releases. Of course having Oracle in the room made the exercise quite interesting. I met Paolo, an Oracle "veteran" and a likely future colleague :) and got to listen to an Oracle middleware presentation (I hadn't seen one in ages and certainly not since the BEA integration). Paolo focused on the operations side (which arguably WebLogic does fairly well) including Coherence, JRockit and Work Manager. Finally Alef, a SpringSource founder (but no longer an employee) focused on OSGi and dmServer. I think his presentation was more didactic than mine on the OSGi front, but our demos certainly felt very similar.

Thanks to Paolo and the rest of the organizers, this was a great event, I wish I could have stayed a bit longer, the city looks beautiful!

( mai 25 2009, 01:41:12 PM CEST ) Permalink


GlassFish Podcast
Get GlassFish V3
Support GlassFish Enterprise

Today's Page Hits: 1169




bea conference glassfish ips java javaee javaee6 javafx javaone javazone jug metro mysql netbeans openesb openoffice opensource paris performance podcast presentation sdpy sun swing techdays tips updatecenter v3 webservices wsit
Links