XWiki meets GlassFish v2

Why XWiki?
There are a lot of wikis out there (I mainly use JSPWiki).  The
main reasons for XWiki are rights
and programming
(using Velocity or Groovy). Other features are described here.

You can get XWiki from
I chose to download the XWiki 1.0 beta 2 WAR file.
It’s 41Mb, which is the same size as the simple install which
bundles Jetty as the default web container (btw, here’s a Jetty
aficionados who started using GlassFish
). If XWiki were to
ship GlassFish, the download size might be an issue as
GlassFish is around 60MB (which is pretty good for a full blown
application server BTW). XWiki install instructions are here.

GlassFish Web ConsoleBefore deploying
the archive, the database needs to be configured. Although I started
using JavaDB
(part of GlassFish) based on these
instructions and browsing
the data using NetBeans
, I quickly hit a missing XWIKILINKS
table error. So back to HSQL
which is bundled with XWiki. The config is really straightforward.

After upgrading the content of the WEB-INF/hibernate.cfg.xml
file to reflect the database settings and update the WAR file (% jar uvf xwiki-1.0-beta-2.war WEB-INF\\hibernate.cfg.xml, the deploy can be simply done
using the GlassFish Web Console.
Welcome to XWiki
You can also use the CLI’s asadmin deploy command.
Simply make sure you use 'xwiki' as the
application Context Root (I wish XWiki didn’t have the webcontext
hard-coded to xwiki). Once
the deployment is done (should take less 30 seconds), the
application is available from http://localhost:8080/xwiki.

To make the content a little more useful, I used the administration
page to upload a xwiki-1.0-beta-2.xar
XWiki archive to populate the system. This also creates a administrator
user ( Admin / admin

So Why GlassFish?
Since XWiki is a web app, I guess
that Jean-François’ blog about what’s
new in GlassFish 2’s web tier
is pretty relevant (Improved Virtual Server support, JSP compilation with JSR 199, HTTP Compression support, SSL support now use NIO non blocking, …). It
would be interesting to compare performance of various containers
(Jetty, GlassFish, Tomcat, JBoss, …). I wonder if the XWiki guys have
some benchmark or scalability test they run against their developments.

Also, with GlassFish
(soon to be in beta), clustering is now a simple add-on
feature enabling cluster-wide deployments, load-balancing and
fail-over. There’s also the new auto-update feature
and WSIT-based Web Services
(Microsoft-interoperable WS-\* stack implementation). Of course,
GlassFish is also a production-ready Java EE 5 application server
which XWiki could use to upgrade to newer technologies such as EJB3,
JPA, JAX-WS, etc…

Author: alexismp

Google Developer Relations in Paris.