Jade: Installation Guide

Lincoln D. Stein, lstein@genome.wi.mit.edu
Whitehead Institute/MIT Center for Genome Research
Danielle et Jean Thierry-Mieg, mieg@kaa.crbm.cnrs-mop.fr
CRBM-CNRS, Montpellier

Contents


Introduction

Jade is a Java library that provides live graphical access to one or more database servers maintained on the Internet or a local area network. The current implementation provides interfaces for ACEDB database servers as well as from local flat files. The interface between the Java and the database layers is sufficiently generic that with a moderate amount of effort Jade can be adapted to serve data from other object-oriented or relational databases (we would be happy to collaborate on such a project).

This document describes the steps required to install Jade over an ACEDB database.

Requirements

It is assumed that the reader has experience installing and configuring Unix Internet daemons and World Wide Web servers. Some experience with the ACEDB database is also required.

Because only the Unix version of the ACEDB server is currently supported, you must have a Unix machine available to install the database itself. The Web server, netclient and Jade layer should run on any Unix or Windows system, although only Unix systems have been tested so far. The MacIntosh can be used to view the data, but not to install the aceserver or the netclient, because this platforms does not support the rpc protocol.

In addition to the software and documents in this file, you'll need a Java-capable Web browser. Browsers include:

    v
  1. Netscape Navigator version 2.0 or higher.
  2. Microsoft Internet Explorer version 3.0 or higher.
  3. The HotJava browser.
A precompiled generic ACEDB browser applet is provided with the Jade system. To extend this browser or to create other applets that use the Jade library, you'll need Sun's freely-distributable Java Development Kit (JDK), or one of the commercial Java development environments. Ports of JDK are currently available for the following platforms:

Java Development Kit Download Sites
OS Site
Solaris http://java.sun.com/
Windows NT http://java.sun.com/
Macintosh http://java.sun.com/
Linux http://www.blackdown.org/
DEC Unix (OSF/1) http://www.osf.org/mall/web/JDK/
Hewlett Packard HPUX http://www.osf.org/mall/web/JDK/
AIX http://www.osf.org/mall/web/JDK/

Architecture of the System

Jade consists of several layers and software components. The layers can be located on the same machine or may be distributed among several machines. They are as follows:
aceserver
This is an ACEDB database running in server mode. In this mode the ACEDB graphical user interface is not available; the server operates silently, listening for requests from clients and servicing them. The aceserver can run on any machine in the local area network.

netclient
This is a small C-language program that serves as an adaptor between the aceserver and the Jade library. Because of Java security restrictions, this program must run on the Web server machine. This can be the same machine that the aceserver runs on, or a different one.

.ace files
These are a series of ACEDB schemas that provide a compatibility layer between ACE and Java. They provide a mapping between an object-oriented ACEDB view of the database, and a relational table-oriented view of the database.

Jade and applet class files
This is a series of .class files which encodes the Java classes used by Jade. You will use these classes when writing your own Java code to communicate with ACEDB. The main browser applet is found in the file Welcome.class. When executed, this applet creates a generic ACEDB browser applet that provides the main entry point for more specialized browsers and displays. The Jade .class files must be located within the Web server's document tree, and are usually located relative to the HTML entry page for the applet (see below).

An HTML entry page for the applet
The browser applet must be embedded within an HTML page in order to be downloaded and executed. This HTML page must be located within the Web server's document tree.

Jade and applet source code
These are the source code for the .class files. They are provided to enable you to extend the browser by adding customized displays or to create your own applets that use the Jade library.

Installing the java source code and applet

Obtaining the Jade distribution

The primary distribution sites for Jade are:
     
          http://alpha.crbm.cnrs-mop.fr/jade/distrib/jade.tar.Z
     
         ftp://ftp.crbm.cnrs-mop.fr/pub/unix/jade/jade.tar.Z
ftp://ftp-genome.wi.mit.edu/pub/software/jade/jade.tar.Z
with documentation in:
     
          http://alpha.crbm.cnrs-mop.fr/jade/distrib/programming.doc.tar.Z
If you are using an FTP (as opposed to a Web-based client), be sure to use binary mode to download.

Unpacking the Jade distribution

Download jade.tar.Z to a directory with at least 20 MB of free space, uncompress and untar it with the command:
zcat jade.tar.Z | tar xf -
This will create a directory jade.version_number containing:

Editing and installing jade.html

Edit (a copy of) the file jade.html. You may want to change the title and the name of the data curator. You should keep the references to Sun Microsystems, Netscape and our work. The important task is to modify the three lines defining the applet, between the <applet> delimiters:
  1. The line:
      <applet codebase="." code="jade.maps.Welcome.class" width=400 height=150>
    indicates that the main browser applet can be found in the file Welcome.class in the directory ./jade/maps relative to the .html document. If you move the location of the jade directory, you'll need to alter the codebase attribute to point to the correct location.
      
  2. The line:
      <param name="netclient" value="alpha.crbm.cnrs-mop.fr">
    must be modified. You should indicate in the value attribute the full name of the machine on which the netclient program is installed. Often this will be the same machine as the Web server.

  3. The line:
      <param name="port" value="20100">
    must be modified to indicate the correct value for netclient's network port, as defined in Installing the netclient.

    Recompiling the ACE server and client

    ACEDB is an object oriented database system which was first distributed in 1990 to maintain the genetic and molecular data of the nematode C.elegans. It was written in collaboration with Richard Durbin and with the help and contribution of many other programmers. In 1995, ACEDB was rewritten to follow a server/client paradigm in which aceserver, the database server, uses the network to respond to requests for data from several database clients.

    Aceserver is fast. The speed and quantity of data that can be handled has been increasing every year. Running on a Linux portable 486 pc, aceserver can handle fifty thousand objects; on a workstation, several hundred thousands; using a high-end DEC server, Otto Ritter has conducted very successful tests on a database of 3 million objects.

    Installing the aceserver code

    aceserver corresponds to the database kernel of acedb, without the graphic and display layers. To run Jade, a few ameliorations were necessary above the latest acedb release 4_3. You must therefore install the aceserver release 4_4 or later which is available both in source code and binary form from:
         
    ftp://ncbi.nlm.nih.gov/repository/acedb
         
    ftp://ftp.crbm.cnrs-mop.fr/pub/acedb/aceserver
    
    If you do not find the server/client in precompiled form, you should recompile as follows:
    1. download the source code ace4/source.*.tar.Z,
    2. uncompress and untar it and then run make
         zcat source.*.tar.Z | tar xf -
         setenv ACEDB_SRC `pwd`
         make tace aceserver netclient
      The system will complain that ACEDB_MACHINE is undefined, and prompt you with a list of known platforms. Select the one that's correct for you with a command like
          setenv ACEDB_MACHINE SOLARIS_4_OPT
      (Solaris 4.X, optimized) and make again. Note that the makefile system is layered. If the make command fails and you want to change the compiler or library flags, please edit one of the files wmake/*_DEF, do not touch makefile or truemake.
    The executables will end as files bin.$ACEDB_MACHINE/netclient, bin.$ACEDB_MACHINE/aceserver, and bin.$ACEDB_MACHINE/tace, where $ACEDB_MACHINE is the machine architecture specified above.

    tace is a command-line (text-only) client for ACEDB. It should be used to initialise the database and to load the initial data set. To create an empty database in the directory $ACEDB, type

    mkdir $ACEDB/database
    cp -r wspec $ACEDB   #cp, because you may want to edit these files
    bin.$ACEDB_MACHINE/tace $ACEDB
    yes  // to accept initialisation
    quit // to quit tace (the // is the acedb comment delimiter)
    

    Installing netclient

    When Jade starts, it attempts to open a Berkeley-style socket connection to the machine and port defined above in the .html document (see above). The Berkeley socket protocol was chosen because it is available on Java implementations on all Unix machines as well as Microsoft Windows and Macintosh machines. Therefore Jade will run on all these platforms.

    At the other end of the socket, Jade expects to find a simple program which can reply to a limited set of requests by returning in specially formatted lists the set of objects matching a query, the content of an object expressed as a tree, or named data tables with parameters.

    In our present implementation, this functionality is provided by netclient a C program derived from aceclient. In turn, netclient communicates with aceserver using the RPC protocol. Aceserver can be located on the same machine or a distant one. With simple modifications, netclient could communicate with other type of servers. In this section we explain how to install netclient. The next section covers aceserver.

    For security reasons, a Java applet can only connect to the machine from which the applet was received. Hence, you must install netclient on the same machine on which the Web server is running. Fortunately netclient is a small program that will not excessively tax your Web server's CPU. Aceserver, on the other hand, is big and should preferably be installed on the machine physically controlling the disks where your ACEDB database is located.

    Netclient runs under the control of the inetd "super daemon". This means that it is launched when necessary and exits when done. A new netclient is launched every time a Java client requests a new ACEDB connection. This means that there may be several copies of netclient running simultaneously.

    To install netclient,

    1. su root
      cd /etc

    2. Edit the file /etc/services, appending to it a line like:
      my.netclient            20100/tcp
      The name and number must be unique to the file. The number indicates the port to use for incoming connections to netclient and must be the same port indicated in the browser applet's HTML document (see Editing and installing jade.html).

    3. Edit the file /etc/inetd.conf to add a line like
      my.netclient  stream  tcp  nowait mieg	/usr/local/bin/netclient netclient -host beta -port 20000100
      • my.netclient is the same name as above.
      • stream tcp nowait is a magic incantation. See any Unix system administration text for the mystical details.
      • mieg should be replaced by the login name of the data curator.
      • /usr/local/bin/netclient should be repalced by the full path to the netclient executable.
      • netclient begins the command line invocation of the executable.
      • -host beta should be replaced by the name of the host holding the aceserver. (beta is the name of a particular computer host in the crbm-cnrs.mop.fr domain.
      • -port 20000100 should be replaced by the port of aceserver (see below).
    4. Send a HUP signal to the inetd daemon to cause it to re-read its configuration file. You can do this manually by using the ps command to find inetd's process number, or you can use the following magic incantation to do it in one fell swoop.
      kill -HUP `ps -aux | grep inetd | grep -v grep | perl -nae 'print $F[1]'`
    5. exit
      To surrender root access.

    Installing the ace server

    The installation of the server is not very different from the installation of the client, but you may want to perform it on a different machine, preferably a fast machine holding the data disks. Note that there is no restriction on the location of that machine, since it is accessed by the netclient daemon and not directly by the Java applet. The netclient and aceserver hosts can differ. For example one could be a 32-bits SUN and the other a 64-bits DEC. However, it's a good idea for both the client and server to be on the same local network.

    Like netclient, aceserver is started by the inetd super daemon. The main difference is that only a single copy of aceserver is allowed to run at any time. It handles incoming requests from multiple clients (including netclient clients) and services them. When a certain amount of time has gone by without any additional requests, aceserver times out and exits. It will be launched again by inetd if needed. Because aceserver uses Sun's RPC (Remote Procedure Call) mechanism, its inetd.conf configuration line has a certain baroque quality to it.

    To install aceserver:

    1. su root
    2. cd /etc
    3. If it is missing, create a symbolic link to the aceserver executable named rpc.acedbd:
      cd bin.$ACEDB_MACHINE;
      ln -s aceserver /usr/local/bin/rpc.acedbd

    4. Append to the file /etc/services a line like:
      my.aceserver            20000100/tcp
      The name and number should be unique. This number is the port number indicated in netclient's invocation line in inetd.conf (see above).

    5. Append to the file /etc/inetd.conf a line like:
      my.aceserver/1 stream rpc/tcp wait mieg  /usr/local/bin/rpc.acedbd rpc.acedbd /net/beta/local1/worm 20000100 1200:1200:0
      • my.aceserver/1 is the same name as given in /etc/services with a /1 (a program version number) appended.
      • stream rpc/tcp wait is a magic incantation. wait specifies that only one copy of aceserver can run at a time.
      • mieg should be replaced by the login name of the data curator.
      • /usr/local/bin/rpc.acedbd should be replaced by the full path to the aceserver executable. If you created a symbolic link as shown in step (3) you won't have to change this.
      • rpc.acedbd is a needed repetition of the name of the executable which begins the invocation line.
      • /net/beta/local1/worm should be the full path to the ace database. That directory must contain the ACEDB subdirectories wspec and database.
      • 1200:1200:0 are server and client timeouts in seconds followed by a limit chunk size (0 means no time out or no limit). The server disconnects inactive clients when they time out, and exits entirely after its own time out. It is restarted automatically by inetd when needed.
    6. Under Solaris there is a slight difference from the configuration described above. The line in inetd.conf must use the service port number, i.e.port number/1, rather than the service name:
       20000100/1 stream rpc/tcp wait mieg /usr/local/bin/rpc.acedbd rpc.acedbd /net/beta/local1/worm 20000100 1200:1200:0
    7. Add /etc/rpc adding at the end a line like
      my.aceserver 20000100 rpc.acedbd
    8. Send a HUP signal to both the inetd and portmap processes:
      kill -HUP `ps -aux | grep portmap | grep -v grep | perl -nae 'print $F[1]'`
      kill -HUP `ps -aux | grep inetd | grep -v grep | perl -nae 'print $F[1]'`
            
      On some machines we've found that it's necessary to reboot in order to convince the portmap program to recognize the new aceserver server.
    9. exit (abandon root access)
    Known bug: we have observed that on dec-alpha, running unix.3.2, the first connection to a non running aceserver fails. Forever, inetd will try to establish it. Since Jade automatically makes a second attempt, and since by that time, the aceserver is running, there is no visible effect. However, when the server times out, inetd, still trying to establish its first connection, restarts the server as soon as it dies. This undesirable Phoenix effect seems to be specific to the dec implementation. It is not observed on Sun or Solaris platforms. If you install Jade on some other platform, please tell us what happens.

    Note that several services running on different databases can run in parallel on the same machine, all of them serving the same Jade interface, a feature used in the USDA grass multimap demo. For each one, declare in the same way a netclient and a corresponding aceserver, each with its own port number and database directory. Remember that all the netclients must run on the Web host, but that the various servers may be on a different machines.

    Configuring the ACEDB database

    From the experience gained with ACEDB, we believe that data displays should be unlinked from the schema. The interface between display and database should be explicit and documented. The user interface should take care that graphical elements should only appear when there is some underlying supporting data.

    To implement these features, although the Jade communication layer can import whole objetcs, we have chosen to import all the data driving our graphic displays in the form of simple tables declared by name on the server side. The tables are essentially simplified "views" on the more complex object-oriented ACEDB schema. This system has the following advantages:

    1. Since the table definition is external to the Java source code, the programmer of the display is automatically documenting his way of accessing the data.
    2. Before loading the table definition on the server side, the data curator can adapt the definition to the schema of the server.
    3. The same table, from the display point of view, can be retrieved from very different schemas. This provides the desired decorrelation between the programming of the display and the construction of the schema and ensures the reusability of the graphic interface.
    4. If the relevant data is lacking from the schema on the server side the table cannot be constructed and retrieved, and it is now straightforward to remove the corresponding menu entries from the display.
    5. Any type of server can be used to feed the display. In particular one can even develop a new display from files taken from the local file system without accessing a database server, and substitute the socket only when the display is ready.
    6. A beneficial side effect of this method is that the preprocessing is transferred to the server side, which is often faster than the client and which has the freedom to buffer the results if this seems adequate.
    For example, in our running demos, indicated below, we use the same display code to show the lineage of the nematode (Cells in the schema, with mothers and daughters) and cereals genealogy (Nodes in the schema, with children and parents). Only the table definitions on the servers differ.

    At any time, data retrieved from the first server can indicate the address of some other server to which Jade can establish independent connections (see below). Depending on the applications, the data retrieved from different servers can be merged or maintained separately.

    Jade is also capable of representing and retrieving ACEDB objects in their full object-oriented tree form, translating ACEDB pointers into Java-style references. We use this possibility in the plain Tree-display of the objects, which implements hypertext facility. However, to write a graphic display, like a genetic map, in the object-oriented form, sacrifices some of Jade's portability, because it assumes a certain database structure and schema.

    Jade can access any preexisting ACEDB database. However, to use table-oriented views effectively you must do some work:

    • Edit $ACEDB/wspec/server.wrm.

      This file is self documented, but you must edit it if you want to limit read access to your data to netclient. In that case,and if netclient and aceserver run on different machines, /tmp is not a correct choice for PUBLIC_DIRECTORY since you must choose a directory visible from both machines. You must choose a directory that is cross-mounted using NFS or other transparent network file system.

    • Edit $ACEDB/wspec/models.wrm.

      You need to add in your models the declaration of the Jade Class It may be part of the distributed models.wrm file, and will later be precompiled in the server source code. As of August 1996 the Jade class is defined as:

      ?Jade Display Text Text Text UNIQUE Text 
            StandAloneDisplay Text
    • Possibly edit the self-documented file meta.jade.ace to indicate which Jade displays are used to display certain classes. This file sets the correspondence between Jade class, ACEDB class, and ACEDB table (see below).

    • Read the new models and the new ace files with the following commands
      bin.$ACEDB_MACHINE/tace $ACEDB
      read-models
      parse meta.jade.ace
      parse tables.jade.ace
      save
      quit
      
    The file $ACEDB/server.log will contain a record of the server activity. Since it grows without limit, you will have to empty it from time to time using a command like:
    cp /dev/null $ACEDB/server.log
    

    Connecting to several servers

    Jade can import data from several servers in parallel. This is specified in the html document in the parameter otherdbs. In the example of the multimap display of the grass database of the USDA (Barnet,Bigwood, Cartinhour), we have the definition
    <applet code=jade.maps.Welcome.class width=400 height=150>
    <param name="title" value="Grass@beta">
    <param name="netclient" value="alpha.crbm.cnrs-mop.fr">
    <param name="port" value="20210">
    <param name="otherdbs" value="ricegenes 20211 maizedb 20213 graingenes 20212 sorghumdb 20214">
    
    These lines associate the names ricegenes, maizedb... to the ports number 20211 and 20212... corresponding on the same host to the netclient services of the rice, maize... servers.

    The first connection is established with the web host on the principal port, 20210 in this example. Later on, the display may require additional connections to other servers. Inside the Java display code, the need to call the secondary servers is hard coded, including a name recognition system, and results in a call:

    jade.db.MultiAccess.display("ricegenes", "Map", locus.name)
    
    This will open the rice database and perform a Map display of the correct marker.

    The relevant point is that although the need to call the rice server is part of the display code, the actual location of the server is part of the configuration of the main server. The grass demo is running at //alpha.crbm.cnrs-mop.fr/jade/grass.html,

    Specifying new displays

    The file meta.jade.ace may contain several other lines. In the grass demo, there is an entry:
    Jade : default
    StandAloneDisplay        jade.grassplot.MapSetPick
    
    This declaration is used to add a new display in the Jade interface. The class jade.grassplot.MapSetPick implements the interface Displayable and the method:
    public String nickName ()  { return "Oxford Grid Selector" ; }
    
    The net result is the appearance of the menu entry Oxford Grid Selector in the menu Display of the Jade main window.

    Associating tables and displays

    A given display will require from the server a number of tables. These tables are required by name, and take the name of the object as run time parameter. The definition of the table may depend on the class of the object beeing displayed. The Jade code does not have to know about those details which are relevant only on the server side. For example, the meta.jade.ace file of the dace server in St Louis has the lines:
    Jade : default
    Display  Chromosome jade.maps.Vmap
    Display  Sequence   jade.maps.Vmap   map.interval link.interval
    
    The second line implies that chromosomes are displayed using the Vmap display code, a standard genetic map display. This code imports its data in several tables, one of which is map.interval.

    The third line is more interesting. In the dace database, we wanted to reuse the same Vmap display for a new purpose. This displays is now also associated to the Sequence class, but when used on a Sequence object, this table name map.interval is remapped to link.interval. The two tables have a very different definition on the server side, but export semantically equivalent tables to the display code.

    Writing table definitions

    The way to actually write the table definitions is out of the scope of this document, since this problem is specific to ACEDB, not to Jade. It would be done in a completelly different way for a different sort of server.

    The important feature on the server side is to be able to answer a request of the form:

    Table -n Table_name Object_Name
    
    by the export of the relevant table using the Object-Name as run time parameter. (this section will be developped later) .

    The ACEDB definition file Jade.tables.ace is self documented.In a few words, that probably only make sense for acedb users, these definitions were constructed using the acedb xace graphic interface, starting the Table-Maker from the main menu, and saving the definition as an ace object via the new "Save Def" button. Unfortunatelly, the current ace.4_3 interface does not correctly allows the handling of parameters and one must finish the preparation by editing in tree-update mode the resulting Table class object, and finally exporting them as ace files.

    Running jade

    Jade is started from netscape or appletviewer by accessing the html applet. Demos are running at
    C. elegans
    http://alpha.crbm.cnrs-mop.fr/jade/jade.html
    Grass
    http://alpha.crbm.cnrs-mop.fr/jade/grass.html
    Astronomy
    http://alpha.crbm.cnrs-mop.fr/jade/astrid.html

    Acknowledgements

    It is a pleasure to acknowledge the contributions of Doug Bigwood, John Barnet and Sam Cartinhour. Their distributed grass database is a perfect test for the jade communication system. Together, we realised on this example that the importation of data via predefined tables, which we were using for convenience in the C.elegans genetic map demo, should really be promoted to a strict rule to allow portability to other schemas, reusability, and abstraction from the particular type of server.

    Copyright Information

    Copyright © 1996 Danielle et Jean Thierry-Mieg and Lincoln Stein. All rights reserved.

    This document and software may be redistributed as long as it is distributed in full and the above copyright statement remains intact. Any additions or modifications should be expressly labeled as such.

    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
    WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    POSSIBILITY OF SUCH DAMAGE.
    

    Danielle et Jean Thierry-Mieg

    Lincoln D. Stein