#1458 STAF_INSTANCE_NAME not set on Mac OS X

Unix::Mac OS X
closed-fixed
Sharon Lucas
Install (166)
5
2012-05-24
2012-05-24
George Kyriacou
No

The installer does not set STAF_INSTANCE_NAME within the STAFEnv.sh script to its default value of 'STAF' during the install process. As a result the STAF process fails to launch and throws this error:

"Error during platform-specific initialization
Invalid value set for the STAF_INSTANCE_NAME environment variable. It cannot be blank."

The installation was performed using the zipped setup binary. All of the options were left to their default values including the STAF Instance Name which was left to its default value of 'STAF'.

The installation was performed on two different machines. One was an upgrade and the other a fresh installation. Both displayed installations the same behavior. The installation log on both machines showed that there was no value defined for the STAF_INSTANCE_NAME variable.

Discussion

  • STAF Install Log

     
    Attachments
  • Sharon Lucas
    Sharon Lucas
    2012-05-24

    This issue where the STAF_INSTANCE_NAME is not being set correctly in the STAFEnv.sh created for Unix systems can occur when doing a GUI InstallAnywhere install of STAF on an operating system that does not provide any STAF API support for at least one of the following: Python, Perl, or Tcl. Since STAF for Mac OS X does not provide support for Tcl, there is a bug that causes a NPE exception to occur in the STAFAdvancedUnixOptions class (InstallAnywhere custom code used when performing a GUI install on Unix systems) when trying to determine the Tcl version selected which causes it to not set the STAF_INSTANCE_NAME value.

    This issue does not occur when performing a console or silent install (only a GUI install) and does not occur on Windows or on any Unix platform that provides STAF API support for Python, Perl, and Tcl such as Linux x86, amd64, etc.

     
  • Sharon Lucas
    Sharon Lucas
    2012-05-24

    • labels: 764484 --> Install
    • assigned_to: nobody --> slucas
     
  • Sharon Lucas
    Sharon Lucas
    2012-05-24

    • status: open --> closed-fixed
     
  • Sharon Lucas
    Sharon Lucas
    2012-05-24

    Added code to check if the perl, python, and tcl JComboBox had a selected item in it (e.g. if tclCB.getSelectedIndex() > -1) before getting the selected item to prevent the NPE. Also, moved the assignment of STAF_INSTANCE_NAME variable to the beginning of the okToContinue() method instead of performing it at the end of the method.

    Verified that this fixed the problem when performing a GUI install using an updated version of the STAF349-setup-macosx-universal.zip file or STAF349-setup-macosx-universal.bin file. This fix will be in the next release of STAF, V3.4.10, planned for the end of June 2012.

    As a workaround for now, you can perform a console install instead of a GUI install. For example:

    ./STAF349-setup-macosx-universal.bin -i console

    Or, if after you do a GUI install, update the STAFEnv.sh file manually with the correct STAF_INSTANCE_NAME.

    Here's a cvs diff of the fix:

    Index: install/ia/classes/STAFAdvancedUnixOptions.java

    RCS file: /cvsroot/staf/src/staf/install/ia/classes/STAFAdvancedUnixOptions.java
    ,v
    retrieving revision 1.15
    diff -r1.15 STAFAdvancedUnixOptions.java
    312d311
    <
    332a332,337
    > // Set variable STAF_INSTANCE_NAME
    >
    > ccpp.setVariable("$STAF_INSTANCE_NAME$", instanceNameTF.getText());
    >
    > // Set variable UPDATE_ENVIRONMENT
    >
    336a342,343
    > // Set variable USE_TCP_VERSION
    >
    348c355,360
    < String perlSelection = (String)(perlCB.getSelectedItem());
    ---
    > // Set variable USE_PERL_VERSION to the selected version in the
    > // JComboBox if Perl support is provided for the operating system
    >
    > if (perlCB.getSelectedIndex() > -1)
    > {
    > String perlSelection = (String)(perlCB.getSelectedItem());
    350,364c362,381
    < if (perlSelection.equals("Perl 5.8"))
    < {
    < ccpp.setVariable("$USE_PERL_VERSION$", "5.8");
    < }
    < else if (perlSelection.equals("Perl 5.6"))
    < {
    < ccpp.setVariable("$USE_PERL_VERSION$", "5.6");
    < }
    < else if (perlSelection.equals("Perl 5.10"))
    < {
    < ccpp.setVariable("$USE_PERL_VERSION$", "5.10");
    < }
    < else if (perlSelection.equals("Perl 5.12"))
    < {
    < ccpp.setVariable("$USE_PERL_VERSION$", "5.12");
    ---
    > if (perlSelection.equals("Perl 5.8"))
    > {
    > ccpp.setVariable("$USE_PERL_VERSION$", "5.8");
    > }
    > else if (perlSelection.equals("Perl 5.6"))
    > {
    > ccpp.setVariable("$USE_PERL_VERSION$", "5.6");
    > }
    > else if (perlSelection.equals("Perl 5.10"))
    > {
    > ccpp.setVariable("$USE_PERL_VERSION$", "5.10");
    > }
    > else if (perlSelection.equals("Perl 5.12"))
    > {
    > ccpp.setVariable("$USE_PERL_VERSION$", "5.12");
    > }
    > else if (perlSelection.equals("Perl 5.14"))
    > {
    > ccpp.setVariable("$USE_PERL_VERSION$", "5.14");
    > }
    366,370c383,385
    < else if (perlSelection.equals("Perl 5.14"))
    < {
    < ccpp.setVariable("$USE_PERL_VERSION$", "5.14");
    < }
    <
    ---
    >
    > // Set variable USE_PERL_SYSTEM_PATH
    >
    379,410c394,398
    <
    < String pythonSelection = (String)(pythonCB.getSelectedItem());
    <
    < if (pythonSelection.startsWith("Python 2.2"))
    < {
    < ccpp.setVariable("$USE_PYTHON_VERSION$", "2.2");
    < }
    < else if (pythonSelection.startsWith("Python 2.3"))
    < {
    < ccpp.setVariable("$USE_PYTHON_VERSION$", "2.3");
    < }
    < else if (pythonSelection.startsWith("Python 2.4"))
    < {
    < ccpp.setVariable("$USE_PYTHON_VERSION$", "2.4");
    < }
    < else if (pythonSelection.startsWith("Python 2.5"))
    < {
    < ccpp.setVariable("$USE_PYTHON_VERSION$", "2.5");
    < }
    < else if (pythonSelection.startsWith("Python 2.6"))
    < {
    < ccpp.setVariable("$USE_PYTHON_VERSION$", "2.6");
    < }
    < else if (pythonSelection.startsWith("Python 2.7"))
    < {
    < ccpp.setVariable("$USE_PYTHON_VERSION$", "2.7");
    < }
    < else if (pythonSelection.startsWith("Python 3.0"))
    < {
    < ccpp.setVariable("$USE_PYTHON_VERSION$", "3.0");
    < }
    < else if (pythonSelection.startsWith("Python 3.1"))
    ---
    >
    > // Set variable USE_PYTHON_VERSION to the selected version in the
    > // JComboBox if Python support is provided for the operating system
    >
    > if (pythonCB.getSelectedIndex() > -1)
    412,413c400
    < ccpp.setVariable("$USE_PYTHON_VERSION$", "3.1");
    < }
    ---
    > String pythonSelection = (String)(pythonCB.getSelectedItem());
    414a402,437
    > if (pythonSelection.startsWith("Python 2.2"))
    > {
    > ccpp.setVariable("$USE_PYTHON_VERSION$", "2.2");
    > }
    > else if (pythonSelection.startsWith("Python 2.3"))
    > {
    > ccpp.setVariable("$USE_PYTHON_VERSION$", "2.3");
    > }
    > else if (pythonSelection.startsWith("Python 2.4"))
    > {
    > ccpp.setVariable("$USE_PYTHON_VERSION$", "2.4");
    > }
    > else if (pythonSelection.startsWith("Python 2.5"))
    > {
    > ccpp.setVariable("$USE_PYTHON_VERSION$", "2.5");
    > }
    > else if (pythonSelection.startsWith("Python 2.6"))
    > {
    > ccpp.setVariable("$USE_PYTHON_VERSION$", "2.6");
    > }
    > else if (pythonSelection.startsWith("Python 2.7"))
    > {
    > ccpp.setVariable("$USE_PYTHON_VERSION$", "2.7");
    > }
    > else if (pythonSelection.startsWith("Python 3.0"))
    > {
    > ccpp.setVariable("$USE_PYTHON_VERSION$", "3.0");
    > }
    > else if (pythonSelection.startsWith("Python 3.1"))
    > {
    > ccpp.setVariable("$USE_PYTHON_VERSION$", "3.1");
    > }
    > }
    >
    > // Set variable USE_PYTHON_SYSTEM_PATH
    >
    423,434c446,450
    <
    < String tclSelection = (String)(tclCB.getSelectedItem());
    <
    < if (tclSelection.equals("TCL 8.4"))
    < {
    < ccpp.setVariable("$USE_TCL_VERSION$", "8.4");
    < }
    < else if (tclSelection.equals("TCL 8.5"))
    < {
    < ccpp.setVariable("$USE_TCL_VERSION$", "8.5");
    < }
    < else if (tclSelection.equals("TCL 8.6"))
    ---
    >
    > // Set variable USE_TCL_VERSION to the selected version in the
    > // JComboBox if Tcl support is provided for the operating system
    >
    > if (tclCB.getSelectedIndex() > -1)
    436,437c452
    < ccpp.setVariable("$USE_TCL_VERSION$", "8.6");
    < }
    ---
    > String tclSelection = (String)(tclCB.getSelectedItem());
    438a454,469
    > if (tclSelection.equals("TCL 8.4"))
    > {
    > ccpp.setVariable("$USE_TCL_VERSION$", "8.4");
    > }
    > else if (tclSelection.equals("TCL 8.5"))
    > {
    > ccpp.setVariable("$USE_TCL_VERSION$", "8.5");
    > }
    > else if (tclSelection.equals("TCL 8.6"))
    > {
    > ccpp.setVariable("$USE_TCL_VERSION$", "8.6");
    > }
    > }
    >
    > // Set variable USE_TCL_SYSTEM_PATH
    >
    447,449c478
    <
    < ccpp.setVariable("$STAF_INSTANCE_NAME$", instanceNameTF.getText());
    <
    ---
    >