I have been working with the jsdk2.0 for a couple of months.  I just
installed the jsdk2.1 yesterday.  I can't figure out how to run from my
IDE/debugger.  I am running on NT4.0 with Visual Cafe as my
IDE/debugger.

Under jsdk2.0 I simply set sun.servlet.http.HttpServer as my project's
main class and supplied the arguments I needed for testing (-s
I:\jsdk2.0\debugging\servlet.properties -p 80).

In 2.1 what I was doing in 2.0 obviously won't work given the changes.
>From looking at the SimpleStartup.java class in <install_dir>/etc
(I:\jsdk2.1\etc in my environment), I am trying to write my own
SimpleStartup class to run the server so that I can run this class from
my IDE/debugger.

After much struggling I have finally been able to get the server
started, but it only gives me 404 errors when I try to access anything.

Below is a version of my SimpleStartup class:

import com.sun.web.core.*;
import com.sun.web.server.*;
import java.net.*;
import java.io.File;

public class SimpleStartup {

    public static void main(String[] args) {

      int port = 8080;
      InetAddress inet = null;
      String hostname = null;
      String documentBase = "file://I:/jsdk2.1/webpages";
      String tempDir = "I:/jsdk2.1/tmp";

      HttpServer server = new HttpServer(port, inet, hostname);
      try {
        server.setDocumentBase(new URL(documentBase));
        server.setTempDir(new File(tempDir));
        server.start();
      } catch (MalformedURLException mue) {
        System.out.println(mue.getMessage());
      } catch (HttpServerException hse) {
        System.out.println(hse.getMessage());
      }

    }
}

The server starts up fine if I launch it through startserver.bat.

I can't figure out how this should work.  Is this documented anywhere?

thanks,
--Barry
________________________________________________________
NetZero - We believe in a FREE Internet.  Shouldn't you?
Get your FREE Internet Access and Email at
http://www.netzero.net/download/index.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to