With GlassFish being a very capable HTTP server out of the bowser (thank you Grizzly!), it was time for v3 to offer the ability to configure directory listings. It is now possible to have pages listing files per NAME (default), SIZE, or LAST_MODIFIED.
Configuration can be done inside web.xml (in the form of an additional init-param to the DefaultServlet servlet called sortedBy). This would hold true for a given application and support dynamic reloading (no full redeploy, no restart to take changes into account).
You might find it more convenient to have it be part of default-web.xml (located in domains/domain1/config/). Of course that would require restarting the container. In both cases, the listing should be explicitly allowed or else the user will see a 404 Not Found error. Here's an example to configure the listing presentation in either config files :
Of course there's also the XSLT approach to have yet more control over the presentation. Check the use of localXsltFile and globalXsltFile in the default-web.xml file itself.
OK, I really need more than 140 characters for this one (plus it's been a while since I blogged opinions).
Of course, this is personal opinion, not my company's.
Many people have reacted to JBoss' solo launch of REST-*. What I'm concerned about is the approach, not the technology and specifications (I'm probably not the best person to comment on that part).
For one, having rest-star.org redirect to a jboss.org web site is a "bad thing" (tm). JBoss being the only participant is also not giving the underlying technical effort a lot of chance to become a commonly accepted standard, and that's a pity.
Over on twitter, my colleague Jason sent me this sensible analysis which also questions the approach taken while finding some merits to the technical parts.
Mighty Roy is simply bashing and swinging at the proposal calling for . But then not many people get his blessing from day one.
Rickard Oberg is pointing out that JBoss has a interesting track record in terms driving the project (too bad the last paragraph on his affiliation to JBoss is actually taking some credit off of that assertion).
Contrary to what Haikal says, JBoss is not late to REST with their very decent JAX-RS implementation and their participation in the standardization effort. In fact, I'm not convinced by the SpringSource excuse (SpringMVC legacy) for not implementing this API.
Getting beyond all this criticism, it's rare enough to have people offer to do actual work to demolish it like Anne Thomas is doing. I've been with Sun for too long to throw away the baby with the bath water..
If someone wants to contribute standards, OASIS, W3C, or IETF is where it should happen. Granted you'll be better off starting from some specification or even better yet from a successful implementation (and you may end up not being able to call it REST-anything), but declaring REST-* to the world and making it a one company thing sounds like a marketing mistake to me.
Nice fait sa Java sur le serveur ce vendredi 2 octobre
Le RivieraJUG, Polytech'Nice et Telecom Valley organisent une journée autour de Java EE. Il y aura deux intervenants de JBoss/RedHat : Peter Muir pour parler de Seam et JCDI (ex-WebBeans) et Tom Baeyens pour parler de jBPM. Notre Antonio Goncalves national clôturera la journée par une session sur Java EE 6. Quant à moi ce sera une présentation sur l'état d'avancement de GlassFish v3, en route pour Java EE 6. Je pense reprendre certaines démonstrations faites lors de la conférence JavaZone autour d'OSGi et du système de packaging. Des retours d'expérience et des pauses pour faire de networking sont également prévus.
L'événement est gratuit et se déroule à Sophia Antipolis sur le site de Polytech.
L'agenda quasi-final (de 13:30 à 21:15!) et tous les autres détails se trouvent ici sur le site du RivieraJUG (accès direct à l'inscription).
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.