apache > db
Apache Derby Fortune Server Tutorial
 
Font size:      

Troubleshooting Check List

Are you checking this page because something went wrong? Verify you did each of the steps listed below.

  1. The PATH variable includes the JDK bin directory:

    Windows:
    C:\> set PATH=%PATH%;C:\jdk1.4\bin
    
    UNIX Korn Shell:
    $ PATH=/opt/sun-jdk-1.4.2.04/bin/bin:$PATH
    $ export PATH
    
  2. JDK 1.3 or higher is installed:

    java -version
  3. JAVA_HOME is set to the root location of your JDK installation:

    Windows:
    C:\> set JAVA_HOME=C:\jdk1.4
    
    UNIX Korn Shell:
    $ JAVA_HOME=/opt/sun-jdk-1.4.2.04
    $ export JAVA_HOME
    
  4. CLASSPATH includes the Fortune Server jar files:

    Windows:
    C:\> set CLASSPATH=%FORTUNE_HOME%\lib\derby.jar;
        %FORTUNE_HOME%\lib\derbytools.jar;
        %FORTUNE_HOME%\lib\commons-math-1.0-RC1.jar;
        %FORTUNE_HOME%\lib\jakarta-regexp-1.3.jar;%CLASSPATH%
    
    UNIX Korn Shell:
    $ CLASSPATH=$FORTUNE_HOME/lib/derby.jar:
        $FORTUNE_HOME/lib/derbytools.jar: 
        $FORTUNE_HOME/lib/commons-math-1.0-RC1.jar:
        $FORTUNE_HOME/lib/jakarta-regexp-1.3.jar:$CLASSPATH
    $ export CLASSPATH
    
  5. Verify that the CLASSPATH includes the Derby jars:

    java org.apache.derby.tools.sysinfo
  6. Verify that Derby can find the fortunes database and the Jakarta jar files:

    Windows:
    java -Dderby.system.home=%FORTUNE_HOME% org.apache.derby.tools.ij
    
    UNIX:
    java -Dderby.system.home=$FORTUNE_HOME org.apache.derby.tools.ij
    
    Run these SQL statements:
    connect 'jdbc:derby:fortunes';
    select count(*) from fortunes;
    values tutRand(1,500);
    values tutMatch('abc', 'a');
    
  7. CATALINA_HOME is set to the root location of the Tomcat install:

    Windows:
    C:\> set CATALINA_HOME=C:\tomcat\jakarta-tomcat-5.0.28
    
    UNIX Korn Shell:
    $ CATALINA_HOME=/home/jta/Jakarta/jakarta-tomcat-5.0.28
    $ export CATALINA_HOME
    
  8. Tomcat works by itself. Start Tomcat, then connect to your browser:

    http://localhost:8080
  9. Copy Fortune Server jars to Tomcat:

    
    Windows:
    C:\> copy %FORTUNE_HOME%\lib\* %CATALINA_HOME%\common\lib
    
    UNIX Korn Shell:
    $ cp $FORTUNE_HOME/lib/* $CATALINA_HOME/common/lib