Tuesday, February 23, 2010

Book Review - GlassFish Administration

I was offered the opportunity to review the GlassFish Administration book by Xuekun Kou from Packt Publishing. The book focuses on GlassFish version 2.1.1, but does have some coverage of version 3 (V3). The book is a smaller digest of a number of books published by Oracle (Sun) and the GlassFish document team.

The book breaks down into ten chapters on version 2.1.1, and an eleventh chapter on version 3. I am not sure where I stand on this book. I really don't like references to certain features in the table of contents which would lead you to believe it has some depth on the subject. Later you discover that it refers you to the actual "official" publications I noted above. I think that if you give it a sub-chapter designation, it must actually have some depth. I really found the book to cover most of the subjects in a shallow manner.

My other pet peeve is when code is included (or not included) in a book which does not work, or is shallowly offered without explanation. For example, there is a code example for security, but no explanation, or setup instructions. The other issue is where the book refers to the code, but it does not exist in the format in the book. There are numerous examples of this as you will note below.

If you have gotten this far in my review, you must wonder if the book has any redeeming value. Yes, it does. As an experienced GlassFish administrator, there are a lot of topics that are covered in too little detail for me, but as a new administrator, the book is a good starting place. I was expecting more advanced coverage of some topics, but this is material for a book on Advanced GlassFish Administration. This book offers would be GlassFish administrators a look into all the functionality that it offers.

I would give it a 3/5 stars for advanced administrators. This book is a very good book for starting administrators which probably should be 3.5/5 stars.

Chapter Summaries

Chapter one covers the basic installation which is no real surprise. The information is essentially the same as found on the GlassFish project web site. There is a nice section on how to do silent installs which is not really covered on the site.

Chapter two is a high-level overview of the server architecture. This is where the book shines. The information and illustrations are great. The author has done a great job covering the architecture with very good explanations.

The third chapter provides the reader with information on the application deployment capabilities of GlassFish. The explanation on the ease of development functionality is very good. It covers items like dynamic reload and command-line deployment options. This is a good introduction to the CLI portion of GlassFish which makes it easy to script for your particular OS. This chapter also includes installing JRuby and Grails based applications. The Grails example is really cool and worked like a champion.

The fourth chapter covers container configuration and basic services. I believe that the section on configuring HTTP listeners should have been covered prior to virtual servers because of the dependency. This chapter is very shallow. It shows you how to configure these services from both the Admin Console and CLI, but gives really nothing in way of explanation of the options available.

The fourth chapter concludes with a confusing explanation of the Application Client Container. It seems very out of place and should be re-written with a code example.

Chapter five discusses how to configure (JNDI) resources within GlassFish. This is a very important topic. The author does a good job of explaining how to configure the various resources from JDBC to external JNDI resources. There are not too many good examples on how to configure external resources. There are a number of command-line example errors, but fortunately GlassFish really does a great job of making correction suggestions.

Chapter six covers JMS specifically Open MQ and Apache ActiveMQ. It is really well done and covers an import aspect of modern application servers. The asynchronous transaction is becoming more important especially when combined with AJAX technologies which allow web applications to continue to respond to user input while actions are occurring in the background. This chapter also covers the imqadmin console.

One of the best aspects of chapter six is its coverage of Apache ActiveMQ. I prefer to use Open MQ (included in GlassFish), but the chapter shows how to integrate external JMS resources into GlassFish. GlassFish includes a generic JMS JCA adapter which is used to integrate Apache ActiveMQ.

Chapter seven covers security and securing GlassFish. I was disappointed that there were no examples of client certificate authentication. I was also disappointed that the only coverage on certificates was based on self-signed, and there was absolutely no coverage of NSS security. The Java ACC support is incomplete especially without an example. The only really redeeming section in the chapter was the use of password aliases fro encrypting application resources.

Monitoring is covered in chapter eight. The basics of how to setup the monitoring are covered. There is no significant depth to the chapter. The discussion on call flow monitoring shows an example of an application which is not included in the sample code. It is from the Java EE tutorial (Duke's Bank). The chapter does topically demonstrate additional monitoring tools like JConsole and VisualVM. Both of these tools are included in the JDK, and don't get the coverage they deserve. VisualVM is a NetBeans platform application.

The chapter closes with Enterprise Manager, but refers you to external references. I was not impressed. It should have not even made mention of it, if there was no coverage.

Clustering and High Availability (HA) is covered in chapter nine. I liked chapter nine in general. The explanation of the clustering functionality: node agents, and instances was very good. The author explains in detail how to install the load balancer which needed some detail coverage. The information available online is not very centralized. The explanation on in-memory replication including diagrams is very good. It also explains replication ring and some issues with that are encountered on adjacent instance failures.

HADB should be removed from chapter nine. There is no coverage worth mentioning, and it should have been a cornerstone of the chapter.

Chapter ten covers troubleshooting and performance tuning. Actually that is the title, but it really does not cover performance tuning. The reference is to a commercial support contract Performance Advisor.

That being said, it does cover some additional functionality of tools like VisualVM and introduces jstack. It also covers the Thread Dump Analyzer (TDA) and NetBeans profiler.

Chapter eleven is a topical coverage of GlassFish version 3. It was not finalized at the time of release of this book. The information is generally correct though and will give the reader important aspects of the new release and its capabilities.


The overall impression of the book was a modest 3/5 stars. The book would be a good starting point for a new administrator, but lacks sufficient detail for an advanced practitioner. If you are looking for a beginning book on GlassFish administration, this is not a bad choice.

Chapter Details and Errata

These are notes, errors, comments, and impressions from the chapters. I suggest that if you encounter any errors in the book, please check here to see if I have addressed them.

Chapter 1

(Page 13) The MaxOS X support should include 10.6.

(Page 22) There should be a note to indicate that silent installs can only be done on file based installs (installer), and not on jar based installs.

Chapter 2

(Page 42) Second paragraph makes mention that you can edit the domain.xml file using a text editor. There should be a warning/note that tells the user should check the domain.xml file using the asadmin command to ensure that the file is syntactically correct.
asadmin verify-domain-xml
(Page 46) Item #4, third paragraph refers to a screen shot which is not present.

(Page 47) The command at the bottom of the page is missing a dash.
asadmin list-commands --help | more
(Page 48) The create-domain code is interactive since not all of the parameters are provided so the example is not correct. If you want to avoid interactively providing user and password information, use the --user XXX and --passwordfile XXX syntax.

(Page 49) The command for starting the newly created domain is incorrect. It includes command line switches that are not valid.
asadmin start-domain domain2

Chapter 3

(Page 58) The redeploy switch is not available on version 2.1.1. It is a GlassFish version 3 switch.

(Page 64) The POJO Web Services refers to code which is not available in the example downloads.

(Page 64) The enterprise example and client code is also missing from the example download code. This is a really too bad. The code would have made a really good example of how to use GlassFish.

(Page 67) I could not get this JRuby example running on GlassFish. It runs in Mongrel, and I believe it is valid code. The issue seems to be with rack and warble. It also should be noted that the MySQL JDBC drivers must be downloaded and installed in the CLASSPATH for this to work. I placed the MySQL drivers in the JRuby installation /lib directory. The rake db:migrate command will not work without them, nor will Mongrel connect to the database.

(Page 69) The PATH is incorrect. It should be

Chapter 4

(Page 75) The CLI example is incorrect. It should be:
asadmin set server.session-config.session-properties.timeout-in-seconds=900
(Page 85, 86, and 87) The 2nd and 3rd paragraphs are duplicated on the following pages.

Chapter 5

(Page 100) The CLI example is incorrect. It should be:
asadmin create-jdbc-resource --connectionpoolid MySQLPool jdbc/DevDS
(Page 104) The CLI example is incorrect. It should be:
asadmin create-javamail-resource --mailhost localhost --mailuser MailUser --fromaddress service@programming-stuff.com mail/MyMail
(Page 108) The CLI example is incorrect. It should be:
asadmin create-jndi-resource --jndilookupname cn=MyResources --restype com.programmingstuff.jndi.RegistryResource --factoryclass com.sun.jndi.ldap.LdapCtxFactory ref/SimpleResource

Chapter 6

The example code for the chapter does not work very well. There is no explanation of how to configure it to work. The included AMQBean code does not work out of the box.

Chapter 7

(Page 140) The LDIF file should have been included in the example code.

Chapter 8

(Page 164) The example is incomplete. The first of two screens is shown, and the discussion does not cover the second (more important) configuration screen.

Chapter 9

(Page 176) Clustering DOES work on Mac OS X.

Chapter 11

(Page 245) The paths in the commands are incorrect, they should be:
$examples/deploy ...
(Page 247, 248,250) The paths and project name are incorrect in the last CLI example on the page. It should be:
cd $examples/deploy/SimpleRails

(Page 250) The second CLI example is incorrect. The command to start embedded GlassFish is:
jruby -S glassfish SimpleRails
(Page 251) The path should be:


Popular Posts