Using the GlassFish ESB Installation CLI

Using the GlassFish ESB Installation CLI

This topic provides instructions to successfully install GlassFish ESB using a command-line interface (CLI). This interface allows you to interact with software or an operating system using a terminal, remote shell, or command prompt.

Prior to attempting an installation, review Planning for GlassFish ESB Installation. It provides pertinent information such as supported platforms, operating system limitations, and parameter definitions. If you have any questions or problems, go to the GlassFish ESB web site at http://www.glassfish-esb.org.

To access all the GlassFish ESB documentation in HTML format, go to the GlassFish ESB web site at http://wiki.open-esb.java.net/Wiki.jsp?page=GlassFishESBDocs.

What You Need to Know

This topic contains conceptual information about the installation.

What You Need to Do

These topics contain the procedures for installing a Java Development Kit (JDK) and GlassFish ESB.

Overview of CLI Installations

Before beginning the installation, read Planning for GlassFish ESB Installation, which contains information that is necessary for you to complete a successful install of GlassFish ESB such as supported platforms, operating system limitations, and parameter definitions. You can use a command–line installation script on any of the supported operating systems by first generating the XML state file and then invoking the installation script. The command–line installation performs a complete installation of GlassFish ESB.

Installation ProcessYou can perform a CLI installation in one of three ways. In a default installation, you create a default state file and run the installation all in one step, or you can run the installation without creating a state file. In a custom installation, you create a default state file, customize the state file for your environment, and then run the installation using the updated state file.

Installation Command Summary

You can run the installation command using three combinations of options. The options you use depend on whether you want to generate a state file and whether you need to customize the installation. In the following commands, OS is the operating system, ext is the file extension, and StateFile is the path and name of the state file.

Complete Command Line Interface InstallationThe following software is installed:


Note –

IDE is an acronym for an integrated development environment. It consists of a number of components, such as a compiler, source code editor, build tools, debugger, browser, object inspector, class hierarchy diagram, and so on. These components can be used when performing object-oriented software development. The integrated tools can also be used to build a graphical user interface (GUI).


Important Installation Notes

Installing the JDK Software and Setting JAVA_HOME

If you do not already have the JDK software installed or if JAVA_HOME is not set, the GlassFish ESB installation will not be successful. The following tasks provide the information you need to install the JDK software and set JAVA_HOME on UNIX or Windows systems. To find out which JDK versions are supported for the operating system you are using, see JDK and JAVA_HOME in Planning for GlassFish ESB Installation.


Caution – Caution –

The GlassFish ESB Installer does not support JDK release 1.6.0_04 in the 64–bit version on the Solaris SPARC or AMD 64–bit environments.


ProcedureTo Install the JDK Software and Set JAVA_HOME on a UNIX System

  1. Install the JDK software.

    1. Go to http://java.sun.com/javase/downloads/index.jsp.

    2. Select the appropriate JDK version and click Download.

      The JDK software is installed on your computer, for example, at /usr/jdk/jdk1.6.0_02. You can change this location.

  2. Set JAVA_HOME.

    • Korn and bash shells:

      export JAVA_HOME=jdk-install-dir
      
      export PATH=$JAVA_HOME/bin:$PATH
      
    • Bourne shell:

      JAVA_HOME=jdk-install-dir
      
      export JAVA_HOME
      
      PATH=$JAVA_HOME/bin:$PATH
      
      export PATH
      
    • C shell:

      setenv JAVA_HOME jdk-install-dir
      
      setenv PATH $JAVA_HOME/bin:$PATH
      
      export PATH=$JAVA_HOME/bin:$PATH
      
  3. Change the permissions to enable you to run the GlassFish ESB Installer.

    chmod 755 JavaCAPS.bin
    

ProcedureTo Install the JDK Software and Set JAVA_HOME on a Windows System

  1. Install the JDK software.

    1. Go to http://java.sun.com/javase/downloads/index.jsp.

    2. Select the appropriate JDK software and click Download.

      The JDK software is installed on your computer, for example, at C:\Program Files\Java\jdk1.6.0_02. You can move the JDK software to another location if desired.

  2. Set JAVA_HOME:

    1. Right click My Computer and select Properties.

    2. On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1.6.0_02.

Generating the State File for Silent Installations

In order to run a custom silent command line installation, you must first generate a state file that stores all of the user-defined installation configuration parameters. This step also performs a default installation. To perform a default installation without generating a state file, skip to Installing GlassFish ESB Silently Using Default Settings


Note –

If you want to skip this step, you can download a sample state file that you can customize and use for a custom installation. Sample files are available for multiple operating systems. You can download the files from http://wiki.open-esb.java.net/Wiki.jsp?page=Inst_cli_statefile_t.txt.


ProcedureTo Generate the State File for Silent Installations

  1. Download the installation executable file for your platform from https://open-esb.dev.java.net/Downloads.html.

  2. Navigate to the location of the file.

  3. Run the file from the command line with the --silent and --record options, specifying where you want to save the state file.

    For example:

    glassfishesb-v2.1-full-installer-solaris-sparc.sh --silent --record /home/glassfishesb/state.xml


    Note –

    A log file is generated in your home directory under /.glassfishesb-v2.1-full-installer-hostname_date/log so you can track the progress of the installation. For Windows, this file is located in \Documents and Settings\user_name.


  4. When the installer is finished, run the GlassFish ESB uninstaller

    and remove the GUI installation.


    Note –

    For detailed information about running the GlassFish ESB uninstaller, see Uninstalling GlassFish ESB.


  5. Using a text editor or XML editor, open the state file and modify the installation properties to correspond to your custom requirements.

    Ensure that items such as user names, passwords, directories, and so on are correct. You can view a sample state file following these instructions.

  6. Save any changes, and close the state file.

  7. After creating the state file, note the file location and name, and then continue to Installing GlassFish ESB Silently Using Custom Settings.


Example 1 Excerpt From the State File Generated by the GlassFish ESB GUI Installer


<?xml version="1.0" encoding="UTF-8"?>
<state xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xsi:noNamespaceSchemaLocation="state-file.xsd">
<properties>
        <property name="street.address.windows-x86.en_US"/>
        <property name="country.windows-x86.en_US">United States</property>
        <property name="company.windows-x86.en_US"/>
        <property name="password.windows-x86.en_US"/>
        <property name="email.address.windows-x86.en_US"/>
        <property name="first.name.windows-x86.en_US"/>
        <property name="last.name.windows-x86.en_US"/>
        <property name="register.choice.windows-x86.en_US">skip</property>
        <property name="zip.code.windows-x86.en_US"/>
        <property name="city.windows-x86.en_US"/>
    </properties>
    <components>
        <product platform="windows linux solaris-sparc solaris-x86 macosx-ppc macosx-x86" 
                 status="to-be-installed" uid="nb-base" version="6.1.0.0.200809090101">
            <properties>
                <property name="start.menu.shortcut.location.windows-x86.en_US">all.users</property>
                <property name="desktop.shortcut.location.windows-x86.en_US">all.users</property>
                <property name="jdk.location.windows-x86.en_US">C:\Program Files\Java\jdk1.6.0_07</property>
                <property name="installation.location">$N{install}/netbeans</property>
                <property name="installation.location.windows">$N{install}/netbeans</property>
                <property name="installation.location.macosx">$N{install}/netbeans.app</property>
                <property name="installation.location.windows-x86.en_US">C:\GlassFishESB\netbeans</property>
            </properties>
        </product>
        <product platform="windows linux solaris-sparc solaris-x86 macosx-ppc macosx-x86" 
                 status="to-be-installed" uid="nb-soa" version="6.1.0.0.80909">
            <properties>
                <property name="installation.location.windows-x86.en_US">C:\GlassFishESB\netbeans</property>
            </properties>
        </product>
        <product platform="windows" status="to-be-installed" uid="glassfish" version="9.1.0.4.20080411">
            <properties>
                <property name="admin.port.windows-x86.en_US">4848</property>
                <property name="jdk.location.windows-x86.en_US">C:\Program Files\Java\jdk1.6.0_07</property>
                <property name="http.port.windows-x86.en_US">8080</property>
                <property name="https.port.windows-x86.en_US">8181</property>
                <property name="password.windows-x86.en_US">adminadmin</property>
                <property name="installation.location">$N{install}/glassfish</property>
                <property name="username.windows-x86.en_US">admin</property>
                <property name="installation.location.windows-x86.en_US">C:\GlassFishESB\glassfish</property>
            </properties>
        </product>
        <product platform="windows linux solaris-sparc solaris-x86 macosx-ppc macosx-x86" 
                 status="to-be-installed" uid="openesb" version="2.0.0.80909.0">
            <properties>
                <property name="password.windows-x86.en_US">adminadmin</property>
                <property name="username.windows-x86.en_US">admin</property>
                <property name="installation.location.windows-x86.en_US">
                          C:\GlassFishESB\glassfish\addons\jbi-components</property>
            </properties>
        </product>
        <product platform="windows linux solaris-sparc solaris-x86 macosx-ppc macosx-x86" 
                 status="to-be-installed" uid="jbicomponents" version="2.0.0.80909.1">
            <properties>
                <property name="password.windows-x86.en_US">adminadmin</property>
                <property name="username.windows-x86.en_US">admin</property>
                <property name="installation.location.windows-x86.en_US">
                          C:\GlassFishESB\glassfish\addons\jbi-components</property>
            </properties>
        </product>
    </components>
</state>

Installing GlassFish ESB Silently Using Custom Settings

You can use the GlassFish ESB command-line installation script to perform a complete custom installation silently. A silent installation means that you will not interact with the Installer, nor will you see the process unless you open the directory to which you are installing.

This process uses the state file you generated and customized earlier.


Note –

GlassFish ESB does not support spaces in the installation directory path.


ProcedureTo Install GlassFish ESB Silently Using Custom Settings

Before You Begin
  1. Navigate to the directory where you downloaded the installation executable file.

  2. Run the installation file from the command line with the --silent and --state options, specifying where the state file is located.

    For example:

    glassfishesb-v2.1-full-installer-windows.exe --silent --state C:\glassfishesb\state.xml

    GlassFish ESB is installed in the directory you specified.


    Note –

    A log file is generated in your home directory under /.glassfishesb-v2.1-full-installer-hostname_date/log so you can track the progress of the installation. For Windows, this file is located in \Documents and Settings\user_name.


Installing GlassFish ESB Silently Using Default Settings

You can use the GlassFish ESB command-line installation script to perform a complete default installation silently. A silent installation means that you will not interact with the Installer, nor will you see the process unless you open the directory to which you are installing. When performing a default installation, there is no need to generate the state file first.


Note –

If you want to perform a default installation but also generate a state file, perform the steps under Generating the State File for Silent Installations but do not perform the uninstallation step.


ProcedureTo Install GlassFish ESB Silently Using Default Settings

Before You Begin
  1. Navigate to the directory where you downloaded the installation executable file.

  2. Run the installation file with the --silent option.

    For example:

    glassfishesb-v2.1-full-installer-windows.exe --silent

    GlassFish ESB is installed in the default directory.


    Note –

    A log file is generated in your home directory under /.glassfishesb-v2.1-full-installer-hostname_date/log so you can track the progress of the installation. For windows, this file is located in \Documents and Settings\user_name.


Starting GlassFish ESB

To start NetBeans and the GlassFish server after the initial installation, navigate to the GlassFish ESB install directory or to the directory where the component is installed that you want to start. Run the appropriate command.

Component 

From GlassFish ESB Installation Directory 

NetBeans IDE 

Windows GUI: Double-click the NetBeans desktop icon, select NetBeans from the Start menu, or run install-directory\start_netbeans.bat

Mac OSX GUI: Select the NetBeans icon in the Dock or double-click NetBeans.app in the GlassFish ESB home directory

UNIX: Run the executable file in install-directory/netbeans/bin

GlassFish Server 

Windows GUI:install-directory\start_glassfish_domain_name.bat

Mac OSX GUI:install-directory\start_glassfish_domain_name

UNIX:Run asadmin start-domain from install-directory/glassfish/bin


Note –

You can also start the GlassFish server from the Services tab on the NetBeans IDE.