Welcome!

PowerBuilder Authors: Chris Pollach, Yeshim Deniz, Jayaram Krishnaswamy, Kevin Benedict, Avi Rosenthal

Related Topics: PowerBuilder

PowerBuilder: Article

Silent...but Effective

Silent?but Effective

As of Sybase's EAServer 4.0, OEM developers and IT organizations can take advantage of two new installation features that allow them to create and deploy applications with an embedded installation of EAServer.

EAServer 4.0 includes features that improve the ability of OEM vendors and IT departments to create and deploy applications that include EAServer. Through EAServer version 3.6.1, end users needed to install EAServer separately from the application using the standard dialog-driven setup routine. Developers deployed their components and applications using Jaguar Manager to install JAR, Jaguar JAR, WAR, and EAR files.

The new features are the Silent Installer and OEM licensing. EAServer 4.0 also includes a command-line interface called JagTool that allows scripted access to configuration and deployment commands. This article examines these features and how you can use them to streamline your EAServer deployments.

Silent Installer
The Silent Installer is an embedded, silent-install feature that allows EAServer to be installed automatically, without end-user intervention, as part of an overall installation script. Figure 1 shows a simplified block diagram of the Silent Installer.

EAServer is increasingly used to develop e-business applications for OEM resale and deployment within IT organizations. Earlier releases required each end user to install EAServer separately from the application. This process gave the user a fragmented view of the application and impeded deployment. Under this scenario the end user was required to install EAServer correctly and to provide the necessary configuration information during installation.

The solution is to use an embedded installation script to perform a silent install of EAServer. As a developer, you can now embed the installation of EAServer within your overall installation process. You can specify in advance how to configure the system by changing an options file used by the Silent Installer. Your application installation becomes a single integrated process, easing deployment and reducing errors. The result is increased reliability, reduced maintenance and support, and a cleaner view to the end user. According to Sybase:

The OEM Installer greatly simplifies the process of embedding an application server because the server install, configuration, and application component deployment is treated as part of a single installation process. When upgrading to a new version, the configuration can be separated from the application component deployment.

OEM Licensing
With EAServer 4.0, Sybase provides a new type of licensing that allows OEMs to license only certain components of EAServer for deployment with its applications.

OEMs use an XML file to specify the entities that have been licensed. The XML file is provided to a utility that creates a "signed JAR" file. EAServer examines its licensing information upon start-up and if it's an OEM license, EAServer will read the signed JAR file, verify its authenticity, and determine the entities that will be loaded. Since the JAR file is signed using the particular OEM license, it's tamperproof.

Running the Silent Installer
The Silent Installer is run from a batch file (NT) called SilentInstallNT.bat, or a shell script (Solaris). The batch file consists of a single line:

java -cp setup.jar run -options SilentInstallNT.txt

When you execute the SilentInstallNT batch file, the setup routine will read from the options file (specified here as SilentInstallNT.txt) and perform a silent install.

The requirements for Silent Installer are essentially the same as for EAServer. However, you do need to have the Java runtime present on the target machine. The SilentInstallNT.bat batch file uses Java to run the installation program. If you don't have "java.exe" in your path, the message you'll get is: "The name specified is not recognizable as an internal or external command, operable program, or batch file."

Controlling the Silent Installer
The Silent Installer allows you to control all of the options presented during the normal installation process. The mechanism for exercising this control is a file called SilentInstallNT.txt. Options mirroring the dialogs presented during normal installation are presented, line by line, in this file. You instruct the Silent Installer to include or exclude an option by setting it to True or False. See Listing 1 for an excerpt from the SilentInstallNT.txt file, then examine Figure 2 to see the corresponding dialog as presented by the normal installation.

If you accept the defaults shipped with SilentInstallNT.txt, the install process starts an installation of Adaptive Server Anywhere 7. This is not a silent install. Numerous dialog boxes are displayed and must be responded to. The option in the SilentInstallNT.txt file that controls this is -P ASASupport.active=True.

If you change this to -P ASASupport.active=False, ASA 7 won't be installed, but you'll have a completely silent installation.

You can create a silent install for ASA that you can run separately from the EAServer installation by creating an .iss file. To do this, run the setup.exe for ASA once, specifying the -r option. Then you can run the ASA installation, passing it the .iss file for a silent install. For complete details, see Part 5 of the ASA 7 User's Guide.

Note: Sybase indicates that the version of ASA that will ship with the GA version of EAServer will have a much "quieter" installation than the one shipped with beta 2.

Using the OEM License Feature
To use the new OEM License feature, create a signed JAR file. As your first step, build an XML file with entries for all the components and servlets licensed by the OEM. Sybase provides a sample XML file, SampleOEM.XML, in the OEM Licensing bundle (see Listing 2). Change the vendor name to reflect the real name of the OEM vendor.

Next, run the utility to create the signed JAR file by executing the batch (or shell) file createsignedjar.bat (NT) or createsignedjar.sh (Solaris), with the name of the XML file as a parameter:

Createsignedjar.bat sampleOEM.XML

When you run this script, you'll get a file called oemlist.jar. Distribute this file in the $JAGUAR/config (Solaris) or %JAGUAR%\ini (NT) folder.

Finishing Touches
Once you've completed the installation, there's still some work to do. You need to configure the listeners on the server and set up connection caches for your database connections. These tasks can also be done from within your installation process. For some configuration tasks you can use the command-line utility JagTool. For others (notably Listeners) you need to modify the .props files directly. I'll take a quick look at JagTool first.

JagTool
JagTool is a command-line interface to Jaguar that allows you to perform many configuration, deployment, and maintenance tasks. Before you run it, make sure that:

  • Jaguar is started (use serverstart.bat).
  • The Jaguar environment variable is set.
  • The "bin" folder is added to your path.
The format of a JagTool command is:

Jagtool [connection-arguments] [command]

Connection arguments allow you to specify any parameters required for connection to the server. Note that, by default, JagTool uses localhost as the host name, jagadmin (no password) as the username, and password and Port 9000 for the IIOP listener. If you change any of these parameters, you need to specify the new ones to JagTool as follows:

-h hostname
-n port
-u user name
-p password
-l logfile

JagTool commands allow you to specify actions to be taken. Some commands require entity identifiers. These take the form of <entity_type>:<entity_name>. An example would be a connection cache named MyConn. The entity identifier would be ConnCache:MyConn.

JagTool accepts these commands: copy, create, delete, deploy, export, gen_skels, gen_stubs, gen_stubsandskels, install, list, list_ver, props, refresh, remove, restart, restore_ver, save_major_ver, save_minor_ver, set_jagadminpasswrd, set_props, shutdown, and sync.

You'll see some examples of how JagTool is used as we work with connection caches.

Note: For complete documentation on JagTool, see the chapter "Using JagTool and Jagant" in the "What's New" documentation shipped with EAServer 4.0.

Connection Caches
For this example I'll show how to create a new connection cache called SBD and set up its properties so that it connects to "EAS Demo DB V4." This example assumes that the connection arguments remain at their default settings. You can issue all JagTool commands from the command prompt or from a script or batch file.

1. Create the connection cache.

jagtool create ConnCache:SBD

2. Set the properties to connect to EAS Demo DB V4.

jagtool set_props ConnCache:SBD com.sybase.jaguar.conncache.conlibdll.nt "odbc32.dll"
jagtool set_props ConnCache:SBD com.sybase.jaguar.conncache.conlibdll.solaris "libodbc.so"
jagtool set_props ConnCache:SBD com.sybase.jaguar.conncache.conlibname "ODBC"
jagtool set_props ConnCache:SBD com.sybase.jaguar.conncache.password.e "sql"
jagtool set_props ConnCache:SBD com.sybase.jaguar.conncache.remotesvrname "EAS Demo DB V4"
jagtool set_props ConnCache:SBD com.sybase.jaguar.conncache.username "dba"

3. Refresh the connection cache.

jagtool refresh ConnCache:SBD

Next, I'll describe how to change the IIOP listener to allow access from outside localhost.

Listeners
Upon installation, the default properties for listeners specify host name as "localhost." You need to change the host name to correspond to the machine name or its IP address to allow machines external to the physical server to attach to Jaguar. You can't modify the properties of Listeners through any command-line interface. You need to directly modify (or copy over) the property files for the Listeners you want to change.

Listener properties are stored in the repository in the %JAGUAR%\Repository\Listener folder ($JAGUAR/Repository/Listener for Solaris). The property file for the listener is named by concatenating the server name to the listener name, separated by an underscore. For example, the property file for the IIOPS listener within the server named "Jaguar" is called jaguar_iiops.props. Listing 3 shows the contents of the properties file for Jaguar's IIOP listener.

Make sure EAServer isn't running when you modify the .props files. If it is, you can use JagTool to shut it down. To change the listener to allow external access, change the entry for "host" to the machine name or its IP address. Listing 4 shows the contents of jaguar_iiop.props after the host entry has been modified to the well-known IP address 192.168.0.1.

You can use a text-replacement utility to change the contents of the file, or you can simply delete the original and copy the modified file in its place. However you choose to do the replacement, you'll need to know the server name or address for each server you install upon.

Note: If you leave any unexpected props files behind in the Listener folder, EAServer won't start all of the listeners. Leave only the file names that were originally in the folder.

Restart the server (using serverstart.bat) and the new listener(s) will be active.

Deploying
You can use JagTool to deploy applications, packages, and components. The syntax for the JagTool command is:

deploy [-type <filetype>] [-stubsandskels <true | false>] [-jagjartype <jartype>] [-install <true | false>] [-overwrite <true | false>] [-strategy <strategy>] [-verbose <true | false>]

Synchronizing
If your EAServer installation is part of a cluster, you can direct JagTool to initiate a synchronization:

sync [-user <username>] [-password <password>] [-clusterfiles <true | false>] [-packagefiles <true | false>] [-webappfiles <true | false>] [-appfiles <true | false>] [-clientappfiles <true | false>] [-connectorfiles <true | false>] [-newprimary <true | false>] [-newversion <true | false>] [-refresh <true | false>] [-restart <true | false>] [-waitfor <waittime>] [-varbose <true | false>] [-cluster <clustername>] [-servers <serverURL>] entity

Further details about the deploy and sync commands (as well as the remainder of the JagTool commands), can be found in the EAServer documentation.

Conclusion
Sybase has added features to EAS 4.0 to improve the ability of an OEM developer or IT organization to create and deploy an e-business application based around EAServer. Silent Install lets you install EAServer as part of an integrated install script without requiring user intervention. The OEM Licensing feature allows you to license and distribute a licensed selection of EAServer entities, and to create a signed JAR file for secure, tamperproof distribution of your components. JagTool gives you command-line access to configuration, deployment, and maintenance functionality that would typically require manual intervention through Jaguar Manager.

More Stories By Millard F. Brown

Millard F. Brown is vice president of Power3, LLC, a company providing consulting and training services for the enterprise. He has beend developing PowerBuilder applications since PowerBuilder 2 and is the co-author of two new PowerBuilder 9 books: PowerBuilder 9: Advanced Client/Server Development and PowerBuilder 9: Internet and Distributed Application Development.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.