Sunday, 20 February 2011

Your Glassfish instance doesn't start. Have you checked the OSGi cache?

I've seen this many times: you just upgraded your NetBeans and the bundled Glassfish and it suddenly stops responding. Or maybe you upgraded a Glassfish instance and your domain fails to start leaving you watching and endless stream of dots and no further activity:

$ asadmin start-domain your-domain
Waiting for DAS to start......................
$ vmstat 1

 kthr      memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr s0 s1 -- --   in   sy   cs us sy id
 0 0 0 945484 1100116 222 58 947 7 7  0  0  0 12  0  0 1423 1516 1185  3  1 96
 0 0 0 838032 1383588 7  23  0  0  0  0  0  0  4  0  0  601  757 1085  0  1 99
 0 0 0 838032 1383588 4   4  0  0  0  0  0  0  1  0  0  598  782 1071  0  0 100
 0 0 0 838032 1383588 4   4  0  0  0  0  0  0  0  0  0  565 1079 1296  1  0 99

If this is happening to you, chances are that the OSGi cache of your domain is poisoned and prevents your server from working properly. In this case, try to clean it up with ($GR is Glassfish installation root):

$ rm -r $GR/glassfish/domains/your-domain/osgi-cache

and start the server again.



Upgrading Oracle Glassfish Server to v. 3.0.1

Since version 3, Oracle Glassfish Server, formerly known as Sun Glassfish Enterprise Server, bundles an IPS-based "update tool" that makes life easier to system administrators while upgrading their Glassfish instances.

The update tool, a standalone GUI application, has been integrated into the Glassfish Admin Console since version 3.0.1, and can now be easily used to check installed components or available package updates.



The update tool can be found at $GLASSFISH_ROOT/updatetool/bin/updatetool or, starting with version 3.0.1, at $GLASSFISH_ROOT/glassfishv3/bin/updatetool.

Sometimes, though, administrators prefer using a safer upgrade path than patching a running instance, in case they need to quickly rollback to the previous instance in case something goes wrong.

As described in the official Glassfish documentation, administrators can now use the asupgrade tool to upgrade an existing Glassfish domain to a new installation path so that, if the upgraded instance does not work properly, they can fall-back to the old one.

Upgrading Glassfish using the asupgrade tool is straightforward:

  • Install the Glassfish instance you're going to upgrade to. If you're using the zip distribution, just unzip it.
  • Stop the domain to be upgraded.
  • Launch the asupgrade tool to upgrade a Glassfish domain:
asupgrade [-c] \
  --source /old/domain/path
  --target /new/domain/root/path

The optional -c option instructs asupgrade to use the upgrade command line utility instead of the default GUI upgrade utility. This is handy when you need to upgrade instances on remote machine and you cannot, or wish not, use a GUI interface.

Please note that the --source argument points to a domain while the --target argument points to a domain root. You should, then, use something like this:

asupgrade -c \
  --source /opt/ogs-3/glassfish/domains/domain1
  --target /opt/ogs-3.0.1/glassfish/domains

Depending on your domain name, the tool may ask you whether you wish to rename an existing domain on the new server instance. That's typically the case when you're upgrading a domain called domain1 since the default Glassfish installation bundles a domain with such a name.

The tool will start the upgrade process that will be logged in the upgrade.log file for later inspection. If the upgrade process finishes correctly, you can now start the upgraded instance and check that all of your applications work as expected.

So far, I haven't experienced any major problem with the asupgrade tool and it's a very easy upgrade process that takes care of everything. Resources such as data sources, connection pools, JavaMail sessions, were all replicated correctly on the destination server. The tool even took care of copying the database drivers from one instance to another.

The only glitch I experienced is being unable to start the server without cleaning up the OSGi cache first but that's easily solved.

Thursday, 17 February 2011

5 Linux Tutorials For Beginners

Here are 5 useful Linux tutorials for beginners / resources which will help newbies get their feet wet in Linux.
  1. Complete, concise history of Linux.
  2. Learn BASH shell scripting in 10 Seconds.
  3. Free technical books to learn Linux.
  4. Package management for new Debian users - A concise guide.
  5. Package management for Red Hat users (a bit aged)

Hope you like these 5 useful tutorials / resources on Linux.

Friday, 11 February 2011

Is Nokia Committing Harakiri By Aligning With Microsoft ?

Nokia Cell Phones
The big news today - as far as cellular world should be concerned, is the strategic partnership between Nokia and Microsoft to produce smart phones running Windows 7. Nokia says it will adopt Windows Phone as its primary smart phone strategy. Meaning, Symbian OS is going to be relegated to history. And MeeGo project on Nokia smart phones would be in limbo.

Read more »

Monday, 7 February 2011

Debian Is No Longer Just A Linux Distribution

Debian stable version 6.0 code named "Squeeze" has been released. After 24 months of arduous testing, the Debian team has finally released v 6.0 which brings many firsts among its features. They are -
Read more »

Qt Goes To School - Free Training Course Material For Teachers

Nokia Qt Education Initiative

Nokia's Qt team has unveiled a new initiative - namely to build awareness about Qt - the library that is the building block of KDE - among students and academia.

Choosing an appropriate library for your software is a significant first step to developing your product.

And Qt is a good choice for the simple reason that it is a cross-platform application and UI framework for developing once, and deploying across Windows, Mac, Linux/X11, embedded Linux, Windows CE, Symbian and Maemo without rewriting the source code.
Read more »

Saturday, 5 February 2011