My GlassFish v3 presentation from last week's JavaZone is already posted along with many others. If you're interested in the demos, feel free to skip right to them:
Demo #1 (developer features) @ 7:01
Demo #2 (Java EE 6) @ 21:00
Demo #3 (GlassFish à la carte) @ 26:00
Demo #4 (OSGi) @ 36:50
Demo #5 (RESTful admin) @ 49:00
There's also an offline version (close to 200MB of MPEG-4 for QuickTime in 640x480 format).
Which GlassFish v3 download bundle is right for me?
You may have read the (recently updated) page comparing GlassFish v2 and v3 and decided to go with v3. The next question you might ask yourself is which bundle should I download? Why is the zip archive bigger than it "installer" equivalent? Here is some data to help you decide.
First of all, it's only a matter of packaging. The product (the actual bits) remains the same in all cases.
Zip or installer? The zip installer is new in v3. As the name implies, unzipping is all you need to do. A default domain1 is already available. If you use the installer (now open source, which makes the difference between community and Sun-branded version even smaller, but see later paragraph on that), you'll be able to change port, JDK, install, etc. This "installer" bundle comes in two flavors - windows and Unix-like (an .sh script which works on Linux, Solaris, and the Mac). The installer also let's you do silent installs with a statefile which can be produced without doing any actual install.
The IPS/pkg/updatetool feature of GlassFish (which I've been talking about it a fair bit on this blog) is quite unique for an appserver, and as you may already know this is written in python and thus ships with a "native" minimal python runtime. As a consequence, to avoid having lots of different artifacts (one per platform), the ZIP or installer bundles do not contain this by default. The zip version will require the user to install pkg and updatetool the first time the command is invoked (network access is required). The installer will offer to do that as part of laying out the bits.
You may also note that the ZIP bundle is actually bigger (25% to 30%) than the installer archive. This is because pack200 (un-)compression (much more efficient on JAR files than PKZIP) kicks in as part of the installer process.
Web or Full profile?
That's an easy one since no matter which one you chose, you can install or remove packages to get the feature-set offered by the other profile. The download page (for instance on glassfish.org) has the details of what's included in which profile. With only 30 MB, the smallest download is a Web profile installer. The largest is the zip archive of the full profile at 70MB.
GlassFish (Community) or GlassFish Enterprise?
Technically speaking, the differences are minimal. The license and the branding (a new feature in v3, the software is fully brand-able) are the two notable differences (another minor one is the different IPS repositories). Feature-wise, the two distributions are the same. Of course, the big difference lies in the fact that only the Sun-branded version (GlassFish Enterprise) is supported. But again, this is one and the same product and you will in fact be able to morph a community install into a GlassFish Enterprise instance to avoid any reinstalls. More on that in a later blog.
At this time, since v3 isn't final just yet, only the community bits are available, while GlassFish Enterprise v3 will be available on the Sun.com GlassFish page. In the meantime you can download the Java EE SDK.
GlassFish v3 at JavaZone - slides, demos and screencasts
Here are the slides that I presented on GlassFish v3 at the JavaZone conference today. All five demos went fine (some with the help of the audience), and I even got questions at the end. I'm not sure what the plans are for making the conference talks available (delay, format), so here are the five demos (almost identical) in various screencasts :
• Painless development with GlassFish (deploy on change, session preservation, etc...). Use it today on any GlassFish v3 install.
• Painless Java EE 6 development (James Gosling himself, only using NetBeans, not Eclipse like I did). Starts at 12:21. Same as above - any v3 version.
• GlassFish à la Carte - Part 1, Part 2, Part 3 (the closest to what I showed) - Same as above, IPS has been there from day one (much improved in recent builds though).
• Extending GlassFish v3, OSGi-style (by Jerome Dochez, the GlassFish architect), note that recent promoted builds of GlassFish v3 now ships with the Felix OSGi declarative service bundle by default, no need to install it manually.
• (I don't know of a screencast showing the RESTful admin, but Rajeshwar blog would be a good start and Ludo's JavaFX demo a fun illustration). Using recent promoted builds is recommended.
Update: the video is available (streaming + QT format). Demo timing are documented here.
I'm flying out to Oslo in a few hours to present at JavaZone on GlassFish v3. The slides and demos are now ready. This talk will focus exclusively on v3 and a bit of Java EE 6 (just can't do justice to it in the little time that I have). I had initially listed 7 demos but quickly found out that this would be way too much to cram into the 1-hour slot, so there's only going to be 5 fairly short demos (tooling, Java EE 6, packaging, OSGi, and RESTful admin). Let's hope they all go well ;)
Since this is partly new material and certainly has some new demos I wanted to test-run this in terms of timing and sequencing of demos. So I presented this yesterday at work to several colleagues and it's amazing how much you learn by presenting it just once. Ideally I would dry-run every presentation but it needs to feel a little real with somebody listening or else I just don't get into it. Anyhow, I'll be using a shorter version for the conference but the slides I'll post will have more details.
Session details:
"GlassFish v3 - The future of app servers and Java EE is here... well almost" • Sep 9th, 14:15 - 15:15
• Room: Sal 3
As always, the agenda is diverse (with some usual suspects) and there's is a number of sessions that I'll try to attend (conflicts preventing) - EJB 3.1, Google App Engine, Ioke (Ola Bini's new language), JSR 330/Guice (that one is in parallel with my session unfortunately), developing for the cloud, class-loaders, hudson (Kohsuke will be there, I'm sure that his session will be packed and that there will be people talking to him hours after he's done ;) , debugging your production (btrace, ...), and more. But if the organisers still have those headphones in the main room with sessions showing in parallel on 6-7 screens I might do the usual zapping (not very nice to speaker I must admit).
If you were a little scared to switch your preferred repository from "stable" to "dev" as explained in my previous entry, you now have the ability to simply update your GlassFish v3 Preview installed image as we've just pushed out an update to the GlassFish stable repositories (both for the Java EE SDK and for GlassFish). See Abhijit's announcement . We carried out more tests than for typical promoted releases posted on the "dev" repository to allow people to upgrade their 3-month old GlassFish v3 release.
The new stable version is build 57 and reasons to upgrade include :
• Hudson no longer has deployment issues.
• You get the OSGi declarative services (see Jerome's blog)
• Jersey moved from 1.0 to 1.1
• tons of bugs fixes
• lots more new Java EE 6 features implemented (the exact delta is hard to compute)
• the update tool itself and its CLI have been updated from 2.1 to 2.2
If you're using the SDK you probably have already been offered to upgrade.
If you don't mind using the command-line, it's easy as this single command :
% bin/pkg image-update
DOWNLOAD PKGS FILES XFER (MB)
Completed 50/50 3392/3392 72.62/72.62
If you've downloaded GlassFish from http://glassfish.dev.java.net, you have not been notified because the preferred authority (IPS repository) has been set to contrib.glassfish.org by mistake. To fix this from the command-line:
% cd GLASSFISH_HOME
% bin/pkg set-authority -P stable.glassfish.org
(this assumes that there's already a stable.glassfish.org repository defined. It only sets it as the preferred).
From there you can simply issue a :
% bin/pkg image-update
and you'll be in for a 74MB download to update your existing install as shown above.
To fix the preferred repository issue from the Update Tool (bin/updatetool), simply select the image and chose "File > Image Properties" to select stable.glassfish.org as the preferred repository. You can then select "Available Updates" and do the update from there.
If you want things like the RESTful admin and monitoring, you'll need to be running a more recent build (promoted build 60 and above in this case).
In this new short (4-min) screencast, I'm mostly following Vivek's instructions on how to setup GlassFish v3 for Django deployments. I'm using a recent promoted build and getting the jython distro straight using the GlassFish updatetool.
Everything is pretty much straightforward, but making it part of the default GlassFish v3 distribution (it's currently an optional add-on) would make it as simple as install/deploy.
Updating GlassFish v3 Preview to a more recent promoted build
GlassFish v3 Preview is build #47(d) and came out right before JavaOne (May 2009). On the way to v3 final, the team is releasing promoted builds every week. We're now down to build 60, so you can imagine how much has changed and what you're missing out on if you're still on build 47. of course you can download the promoted build and re-install GlassFish, but this entry is all about using the IPS package management tools that ship with GlassFish v3 (in the top-level glassfish bin/ directory) to upgrade an existing install.
If you don't mind living on the bleeding edge (promoted builds are less stable than the "Preview" release by definition) you can change your default authority (IPS repository) from a stable.glassfish.org one (whose content hasn't changed since May) to a dev.glassfish.org authority which hosts promoted builds :
In any case, updating to the latest promoted build is a simple as issuing this command (or using the updatetool UI) :
% pkg image-update
If you were to set stable.glassfish.org back to being the preferred repository, that would not roll you back to build 47d (v3 Preview) but it would stop offering you to update every week to the newly promoted build. Finally, note that you cannot disable a preferred authority and that to list all authorities, including those that are disabled, you'll need to use the "pkg -a publisher" command.
Java EE 6 tutorial and samples straight to your GlassFish v3 install
While the Java EE 6 tutorial and the code samples it offers are still work in progress (expect a few rough edges), it's probably a great source for getting up to speed with this update to the Java EE platform. If you've installed the Preview of the Java EE 6 SDK you've probably been encouraged to download an update to the Java EE 6 tutorial:
If you've been using the GlassFish v3 Preview bits from glassfish.dev.java.net then you may be wondering what this is all about as there is no "Tutorial" package or update showing up in the GlassFish updatetool. Whether this is a feature or a bug is yet to be decided but this is technically due to different repositories being wired in for the two different downloads (glassfish vs. SDK). You can check what your repository settings are with to following command (you can visit the URL for an HTML representation of the contents of the repository) :
If you're using GlassFish promoted builds you have a preferred dev.glassfish.org authority (repository) defined as http://pkg.glassfish.org/v3/dev/. If you're running GlassFish v3 Preview (released at JavaOne in May 2009), then it comes with a preferred stable.glassfish.org repository defined as http://pkg.glassfish.org/v3/stable/.
In both cases, in order to be able to see and add the tutorial and sample packages, you simply need to add stable.glassfish.sun.com like this :
% pkg set-authority --enable -O http://pkg.sun.com/glassfish/v3/stable/ stable.glassfish.sun.com
Once that's done, you can list the tutorial and samples packages available for install and proceed with the install :
% pkg list -a | grep javaee
javaee-firstcup-tutorial (stable.glassfish.sun.com) 2.0.1-4 known ----
javaee-javadocs (stable.glassfish.sun.com) 3.0-47.2 known ----
javaee-samples-build (stable.glassfish.sun.com) 0.9-2 known ----
javaee-samples-full (stable.glassfish.sun.com) 0.9-2 known ----
javaee-samples-web (stable.glassfish.sun.com) 0.9-2 known ----
javaee-tutorial (stable.glassfish.sun.com) 6.0.1-9 known ----
% pkg install javaee-firstcup-tutorial javaee-javadocs javaee-samples-build javaee-samples-full javaee-samples-web javaee-tutorial
This will install 17MB worth of samples and tutorial documentation and place this all in your glassfish/samples and glassfish/docs directories.
if you're running GlassFish v3 Preview (which already comes a stable repository) it is important that you then either disable or remove the stable.glassfish.sun.com authority. Failing to do so will cause multiple packages conflict on the next update of GlassFish. Here's how to disable the repository:
% pkg set-authority --disable stable.glassfish.sun.com
Of course you can use the bin/updatetool to accomplish all of the above if you're CLI-averse.
Le concours de blog VisualVM m'a fait découvrir le plugin OSGi écrit à par Kiev (doctorant à Grenoble). Ca me plait bien.
Du coup, billets en anglais et en français.
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.
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!
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 ;)
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.
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.
Présentations de l'aquarium d'été - JavaOne, Java EE 6, GlassFish, Metro, OpenDS, Cloud, OpenSolaris
Voici les présentations faites à la troisième édition de l'Aquarium Paris :
• Versions PDF.
• Les mêmes sur slideshare.net
Merci à tous les participants et en particulier à Jacky de Cap Gemini pour son retour sur GlassFish et son déplacement de Lille.
Pour ceux déçus par l'absence d'une présentation dédiée à JavaFX, je vous invite à vous rendre au ParisJUG ce 7 Juillet ou il en sera question en détails.