Sunday Jun 22, 2008

GlassFish V3 TP2 Refresh is here....

A refresh of "GlassFish V3 Technology Preview 2 Application Server" bundle is available now for download. More information on the preview is available here.

The installation program of this refresh bundle, developed using OpenInstaller  has a graphical user interface. This distribution is available as a download in addition to a platform-independent zip file. The installer is available as a self-extracting executable on all of the supported platforms.(Windows, Unix).

Please follow the installation instructions under

Also make sure that you register the product when prompted by installer. Registering your installation provides you with Access to latest information on product patch and bug updates, very useful screen casts and tutorials covering various technologies part of GlassFish and product support offerings.

Attached are some of the screen shots taken out of the installer run. 

Happy Installing!!!. 

Wednesday Mar 26, 2008

GlassFish bundle with MySQL Community Server

"Sun Java System Application Server 9.1 Update 1 with MySQL Community Server" bundle is available now for download.

GlassFish is the name for the open source development project for building a Java EE 5 application server. Visit for more info.

MySQL is the world's most popular open source database software, with over 100 million copies of its software downloaded or distributed throughout its history. Visit for more info.

I was the Engineering Lead for this exciting project that provides a distribution of GlassFish V2 U1 with MySQL Community Server 5.0.

Bundle Features.

  • MySQL Connector/J version 5.1-6 is included in this bundle. This JDBC Driver is installed under <Installation Directory>/lib to conveniently create a JDBC connection pool pointing to MySQL database through  Glassfish's powerful Administration console.
  • The installation program automatically creates an option file to be used by MySQL based on the size of  target deployment environment. This option file can be used after installation without the need for modifications in most cases.
  • To provide a better out-of-the box experience on windows platforms, Program Group items for Starting and Stopping MySQL Server are provided by the installer.
    They are installed under "Programs > Sun Microsystems > Sun Java System Application Server 9.1 Update 1 with MySQL Community Server > ....".

    Look for items titled "Start MySQL 5.0 Database" and "Stop MySQL 5.0 Database".

  • A windows service by name "ASMySQL" will also be created if the user chooses to do so during installation. This service is configured with start-up mode set to "manual".
  • The MySQL binaries included in this distribution are self-contained and do not interfere with other MySQL instances running on installing environment. This is accomplished by the installer generating an option file to be used for all of mysql command line programs. On Windows environment, the interfaces to start and stop MySQL(Windows Program Group/Items and Windows Service), are automatically configured to use the generated option file.

Where to get it?

How to Install this bundle?

  • Refer installation guide from to install this bundle.  NOTE: This guide has instruction set covering other bundles of GlassFish V2U1 also, so be sure to follow the instructions specific to installing "Sun Java System Application Server 9.1 Update 1 with MySQL Community Server".


Sample Setup/Usage:

Refer for details on how to setup/deploy/run a sample Java EE application with MySQL bundled in this distribution.



Many people to Thank for their support and help at various stages of this project with aggressive schedule.

Anil Gaur, Abhijit Kumar and Eduardo Pelegri-Llopart for their support throughout this project, Carla Carlson for Program Management, Alex Pineda and his group for testing, Steve Carusso and his team for ensuring Compatibility, Carolyn Wong for all her help in hosting the bundle, Terena Chinn-Fuji for Release Engineering, Chinmay Srivatsava for providing documentation, Sreenivas Munnangi for verifying samples integration with this bundle and many others.

Tuesday Oct 09, 2007

Glassfish and Solaris Zones

Want to know how GlassFish/Sun Java System Application server could be installed on Solaris zones?
Have issues setting up installation environment for such scenarios? Please look at my latest article
on Installing GlassFish on Solaris Zones. 

Tuesday Aug 21, 2007

glassfish, SJSAS distros...

There are many distributions of Sun Java System Application Server built on top of glassfish. Here is a list of them. This list applies only to the current version of glassfish(V2) and Sun Java System Application Server 9.1.

  • An ant based installer to install glassfish that can be downloaded from here. This is a simple ant script based installer, creates a domain, often used for quick setup. This does not support upgrades, patching.
  • Sun Java System Application Server 9.1(built on top of glassfish) has its own installers.
    • File based installation(underlying product binaries are available as zip files) gets distributed as a). A bundle that includes Sun's High Availability Database and Java SE. and b). A bundle that does not include Sun's High Availability Database and Java SE.     
    • Native package based installers for linux and solaris platforms, Only one distribution that comes with Sun's High Availability Database and all the other required shared components including Java SE.  Requires to be logged in as "root" to perform installation.
    • SDK installers:   Two types Java Application Platform SDK and Java EE SDK. These installers are distributed as the following bundles  
      • Sun Java System Application Server
      • Sun Java System Application Server + Java SE
      • Sun Java System Application Server + Java SE + Tools.

             Please visit for more information  

Except for the ant based glassfish installers, all other installers are patchable and upgradeable.

For file based installation, in-place binary upgrade would mean installing a full distribution on top of an existing install base.
The installer is designed to take care of this. Upgrade and Patching is currently not tested on SDK installers. Though "Sun Java System Application Server" component part of SDK installers would support upgrade/patching, other components included in these distributions may or may not support it for each particular release.
For native package based installers, binary upgrades are handled through installer and patches will be handled through native patching wherever possible.
Application upgrade(domain upgrade) for all of the above installers are handled through upgrade tool bundled and installed as part of the product binaries.

Monday Aug 20, 2007

Wierd windows short-cut keys

I came across this blog entry I have observed this + interestingly one can also use "ctrl + alt + right arrow key" and "ctrl + alt + left arrow key" to rotate the whole desktop view :-)


How to configure glassfish to run as windows service?

The glassfish installer does not currently support this. However the command line
to do this is pretty simple, except for the number of slashes to worry about(a real head-scratcher).

Here is an utility that automates this.

BTW, this is automated as part of Sun Java System Application Server 9.x Platform Edition installation.

How to increase swap size in solaris?

One way to do this: 1). Create a file with the size to be increased using 'mkfile' command. 2). Add the area occupied by this file as swap area using 'swap' command. Ex. mkfile 50m tempswap swap -a tempswap However for faster access to this area, recommended to create a partition and use that as swap area.

Friday Sep 15, 2006

JavaDB integration JavaEE SDK

Derby and glassfish

1. Introduction.

The objective of this blog is to explain in detail the following.
    - how javadb is closely integrated with Java EE 5.0 SDK.
    - how javadb is configured for better out-of-the box experience.
    - overview of  how javadb is used internally by SDK.

This blog is written using Java EE 5 SDK, the latest version can be downloaded from
Java EE 5 SDK all-in-one bundle was used to run through the examples used here.

2. Contents.

Javadb integration
Start/Stop javadb through application server commands
Javadb and EJBTimer
Javadb database and callflow
Using javadb tools
Further readings

3. Javadb integration.

    3.1 Installation.

Javadb binaries are always installed directly under Installation root directory/javadb.  The binaries include the javadb core jar files,
useful javadb utilities(dblook, sysinfo and ij) and a few a native scripts to perform functions like start, stop database. The functionality
of start and stop scripts are also available through application server command line interfaces.

   3.2 Application Server domain and javadb database.

 Every application server domain created out of the default installer as well as the ones explicitly created using 'asadmin create-domain'
 command will contain the following.

    3.2.1. A javadb database to be used by EJBTimer Service.

  The name of this database is 'ejbtimer' used to store information about EJB timers and is to be used by Timer Service that is part of
  this SDK. This database is owned by the user owning the domain. The differences compared to J2EE 1.4 SDK are
    a). Pointbase database was used for storing EJBTimer information.
    b). The ejbtimer pointbase database is owned by the user who initially performed the installation, not by the owner of application server domain.
  This database gets created under <domainroot>/<domainname>/lib/databases/ejbtimer, where <domainroot> by default will be <SDKInstalllRoot>/domains.
  A default domain by name domain1 is automatically created by SDK installer, 'ejbtimer' database is configured to run in "embedded mode"  inside application
  server's JVM.

  3.2.2. A JDBC connection pool by name "__TimerPool" is configured to point to 'ejbtimer' database. This pool is used by EJBTimer service.    

  3.2.3. A JDBC Resource with the jndi name of "jdbc/__TimerPool" that is configured to use __TimerPool.

  3.2.4. A JDBC connection pool by name "__CallFlowPool" is configured to point to 'sun-callflow' database. This pool is used by CallFlow module.      

  3.2.5. A JDBC Resource with the jndi name of "jdbc/__CallFlowPool" that is configured to use __CallFlowPool.

Entries 3.2.2 through and 3.2.5 can be viewed from SDK's powerful administration console. From your browser, go to http://localhost:<admin port>
to start the Administration Console, where <admin port> by default will have 4848 unless changed during SDK installation process.

Log in with the administrator user name and password. After logging in on the left hand side of the console, click to open
"Resources" to view the entries. (Timer related entries are circled in the following image).

Alternatively, run 'asadmin list-jdbc-connection-pools' to view the list of JDBC connection pools and 'asadmin list-jdbc-resources' to view the list of of JDBC
resources that have been created.

NOTE: None of these above components should be deleted.  Doing so will result in undesirable product behavior.

4. Start/Stop javadb through Application Server.

      Java EE 5 SDK's command line interface 'asadmin' supports starting and stopping network server through 'asadmin start-database' and 'asadmin stop-database' commands.

      Prior to understanding what these commands do, it is important to differentiate the two modes of javadb database serverEmbedded and Network mode.
      Refer to this link that has a very good explanation of them.

    4.1 Starting javadb.

 'asadmin start-database' command starts javadb network server in shared mode  to enable connections from other hosts in network. By default javadb network server(engine)
will only requests from clients local to the machine.
Syntax: asadmin start-database [--dbhost] [--dbport 1527]  [--dbhome install_dir/javadb]

--dbhome specifies the root directory of the database to be created if one is not specified, default is the current directory.

    4.2 Stopping javadb.

'asadmin stop-database' [--dbhost] [--dbport 1527]

--dbhost is the host name or ip address of the javadb database. The default is the IP address, which listens on all interfaces.
--dbport can be used to start the javadb server process on a port other than 1527.

5. Javadb database and EJB Timer.

EJB Timer service provided by SDK is used to schedule a timed notification to happen at specific time, after a duration of time, or at timed
intervals. This service uses javadb database to persist EJB timer information. As mentioned in the previous section, a javadb database
created automatically as part of the application server domain 'ejbtimer' is used for data storage. SDK comes pre bundled with this sample
application to demonstrate how to schedule timed notification of enterprise beans.

    5.1 About the timer sample application.

TimerSessionEJB is a stateless session bean that shows how to set a timer. This application is installed under <SDKInstallDir>/samples/ejb/misc/apps/timersession.
For added convenience, this application similar to other sample applications is also available as a pre assembled app along with source code and the build environment.
The pre built ear file is used here rather than building the application. However it is highly recommend  to change the application source and descriptors if required to understand
timers better.

    5.2 Deploying timer sample app to SDK.

   -Change directory to <SDKInstall>/samples/ejb/misc/apps/timersession.
   -Include SDKInstall/bin to PATH,
   -Run 'asant deploy' will deploy the "timersession.ear" file to the default domain(domain1).
   -Run 'asadmin list-components' to verify the deployment.

    Alternatively the deployment can also be verified through "Administration Console"


    5.3 Running the timer sample.

To run the application client, set your current directory to <SDKInstallDir>/app_dir/samples/ejb/misc/apps/timersession. Then type the following command:
<SDKInstallDir>/bin/appclient -client timersessionClient.jar -xml install_dir/domains/domain1/config/sun-acc.xml.

The output from the timer client is sent to domain_root_dir/domain_name/server/logs/server.log.  After about 30 seconds, view
<SDKInstallDir>/domains/domain1/logs/server.log and you will see the following lines:

TimerSessionBean: setSessionContext
TimerSessionBean: ejbCreate
TimerSessionBean: start createTimer
TimerSessionBean: ejbTimeout

          For more info on this Sample, Refer to the bundled samples documentation available in the sample's Root directory.

6. Javadb database and callflow.

CallFlow enables monitoring of application(s) behaviour that are deployed in Application Server. When CallFlow is enabled(either through Administration console OR through
command line interfaces) a database by name 'sun-callflow' is created under '<domainroot>/<domainname>/lib/databases/ejbtimer, where <domainroot> by default will be
<SDKInstalllRoot>/domains. A default domain by name domain1 is automatically created by SDK installer.

'sun-callflow' database is configured to run in "embedded mode"  inside application server's JVM. All the runtime information about monitored applications(s)  are stored in this
database. This database if required can be cleared using Administration Console. For more information on CallFlow please refer to CallFlow home page.

7. Using javadb tools.

Javadb comes with a minimal set of tools and they are ij, dblook and sysinfo. SDK also includes several useful scripts that can help you use javadb.
The following scripts are available for use in the <appserver_install_dir>/javadb/frameworks/[NetworkServer/embedded]/bin directory:

startNetworkServer.ksh/bat — Script to start the network server

stopNetworkServer.ksh/bat — Script to stop the network server

ij.ksh/bat — interactive JDBC scripting tool

dblook.ksh/bat — Script to view all or part of the DDL for a database

sysinfo.ksh/bat — Script to display versioning info regarding the javadb environment

NetworkServerControl.ksh/bat — Script which provides a means of executing commands on the NetworkServerControl API

To Configure Your Environment to Run the javadb Utility Scripts, following should be done
-Set the javadb_INSTALL environment variable to the <appserver_install_dir>/javadb directory
-Unset your CLASSPATH environment variable.
-You can also optionally set the following properties:
            javadb_SERVER_HOST to the host on which the network server will listen. Can also be set to to enable all listeners.
            javadb_SERVER_PORT to the port number on which the network server will listen.

8. Some useful Links.






« July 2016