Table of Contents Previous Section

Problems With Scripted Applications

Scripted example applications (HelloWorld, TimeOff, etc.) are the simplest ones and don't contain compiled code.


Problem

The web browser does not launch or launches the incorrect URL

Checklist

  1. Check the debugging statements printed in the command-shell window.

    When you launch a WebObjects application from the command line, the application computes its own URL, launches the web browser, and enters the URL in the browser. It prints messages about the values it computes to standard output.

    Check the standard output (the command-shell window) for these messages:

    Reading WebServer configuration from /NextLibrary/WOAdaptors/Configuration/WebServerConfig.plist
    Opening application's URL in Browser:
    url

    The application uses the information in the configuration file NeXT_ROOT/NextLibrary/WOAdaptors/WebServerConfig.plist to compute its URL. This file is created during the installation.

    Corrective action:
    If you see these messages but your web browser doesn't launch, you might not have a browser installed on your system, or WebObjects cannot find the browser. This is always true on Solaris and HP-UX. If the URL looks correct (as described below), open your browser and type that URL into it.

    If you see a message that says "No Adaptor URL in WebServerConfig.plist," either the WebServerConfig.plist file is missing, or the WOAdaptorURL key is missing from it. The file should look something like this:

    {

    DocumentRoot = "/NextLibrary/WebServer/htdocs";
    WOAdaptorURL = "http://localhost/cgi-bin/WebObjects";
    }

    If WOAdaptorURL is missing, the web browser does not launch when you launch a WebObjects application. You can enter WOAdaptorURL or you can type the URL in the browser and connect to the running application that way.

    This base URL value of WOAdaptorURL is of the form:

    http://localhost/cgi-bin/WebObjects

    cgi-bin is the name of your HTTP server's cgi-bin directory. You specify this name when you configure your HTTP server. The cgi-bin directory name is often cgi-bin, but it may have a different name. For example, the Microsoft Internet Information Server uses the name Scripts.

    WebObjects is the name of the WebObjects CGI adaptor as you see it in your HTTP server's cgi-bin directory. Usually, the name is WebObjects. If you're using Windows NT, the adaptor name might be WebObjects.exe (however, some older Netscape servers don't use the .exe extension.)

    If the base URL's cgi-bin and WebObjects adaptor names look correct, consider the localhost value. On most sites, localhost accesses the server on the local host. However, some sites require a domain name as well (http://localhost.apple.com). If your HTTP server isn't running on your local machine, use the host name of the machine running the server in place of "localhost" in the URL above.


Problem

A simple scripted application won't run properly.

Checklist

  1. Check that you can load a static page.

    Check that the examples are installed correctly by attempting to load a static page. For example, try to load the WebObjects Home Page:

    http://localhost/WebObjects/Documentation/WOHomePage.html

    (If your HTTP server isn't running on your local machine, use the host name of the machine running the server in place of "localhost" in the URL above.)

    Corrective action:
    If your browser displays a message saying that it was unable to connect or that the connection was refused, your HTTP server is probably not running. Check that your server is running. Otherwise, see the Checking the Installation section for information on how to fix your installation of WebObjects.

  2. Check that the WebObjects adaptor is functioning.

    Check that the WebObjects adaptor is installed correctly and can run. Use your browser to open this URL (which specifies the WebObjects adaptor, but fails to specify an application name):

    http://localhost/cgi-bin/WebObjects

    (Again, replace "localhost" with the name of the host running your HTTP server. Replace "cgi-bin" with the actual name of the directory that contains scripts and CGI programs on your server.) If the WebObjects adaptor is installed correctly, it returns a list of WebObjects applications located under the document root.

    If the adaptor is installed incorrectly or can't run, the browser will display a message like this:

    404 Not Found
    The requested URL /cgi-bin/WebObjects was not found on this server.

    Corrective action:
    Make sure you've supplied the right names in the URL for the host ("localhost" in the example above) and for the cgi-bin directory (often named "Scripts" or "cgiPrograms" rather than "cgi-bin"). Otherwise, see the Checking the Installation section for information on how to fix your installation of WebObjects.

Table of Contents Next Section