Stella,

About the admin port problem, I haven't seen that.  From what I can
gather, the server opens up a socket (the admin port) and listens on
that socket from another process.  I think the intention is to have the
server-control GUI talk to the server using an undisclosed protocol.
For the JSWDK, the stopserver.bat script uses the
com.sun.web.shell.Shutdown class to send a message on this port telling
the server to quit.  After you have run the startserver.bat, check to
see that there is a webserverlog.txt file in that directory, that
usually says what the admin port is.  You should be able to "telnet
localhost port#" and if you see "could not open connection" or some
message like that, then your admin port has quit listening.  It could
mean many things: a) your server has quit entirely, b) the socket is
messed up somehow, c) you are not running the stopserver script from the
same directory where the webserverlog.txt file is. I am assuming that it
reads the port number from the .txt file. I know the port number
changes, but you can also specify a fixed port number in webserver.xml.

Here's what I have done:

I have put all my servlet related stuff under \Users\Shash\servlets. The
example here is from a Win98 laptop I use at work, but I do very similar
things in Linux (mostly the path names and the forward/backward slashes
are the difference, and of course, use a shell window instead of MS-DOZE
;-). I copied the webserver.jar, lib/xml.jar, lib/servlet.jar and
lib/jspengine.jar from JSWDK into this directory.  NOTE: You could leave
the JSWDK separate from your webapplication. I did it two steps, first I
got JSWDK/examples working on its own and then started messing with my
own webapplication and did not want to experiment with what I already
got working.

The "default" webapplication servlets and classes are under
\Users\Shash\servlets\webpages\Web-inf\servlets and are accessed as
http://localhost:8080/servlet/servletname-or-alias.

Then I have copied the JSWDK examples directory under
\Users\Shash\servlets\examples and those servlets are accessed as
http://localhost:8080/examples/servlet/servletname.
Finally, I have created my own WebApplication called "shash" and I put
those servlets in \Users\Shash\servlets\shash\Web-inf\servlets. These
servlets are accessed as http://localhost:8080/shash/servlet

To run the server, in a MS-DOS window, I "cd /Users/Shash/servlets" and
type "startserver" and it says:

JSWDK WebServer Versions 1.0.1
Loaded configuration from: file:C:\Users\Shash\servlets\webserver.xml
endpoint created: localhost/127.0.0.1:8080

To stop the server, from the same directory, I type "stopserver"

Here's the webserver.xml that I use (minus comment-header):

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE WebServer [

<!ELEMENT WebServer (Service+)>
<!ATTLIST WebServer
    id ID #REQUIRED
    adminPort NMTOKEN "">

<!ELEMENT Service (WebApplication*)>
<!ATTLIST Service
    id ID #REQUIRED
    port NMTOKEN "8080"
    hostName NMTOKEN ""
    inet NMTOKEN ""
    docBase CDATA "webpages"
    workDir CDATA "work"
    workDirIsPersistent (false | true) "false">

<!ELEMENT WebApplication EMPTY>
<!ATTLIST WebApplication
    id ID #REQUIRED
    mapping CDATA #REQUIRED
    docBase CDATA #REQUIRED
    maxInactiveInterval NMTOKEN "30">
]>

<WebServer id="webServer">
    <Service id="service0" docBase="/Users/Shash/servlets/webpages"
workDir="/Users/Shash/servlets/work">
        <WebApplication id="examples" mapping="/examples"
docBase="examples" />
        <WebApplication id="shash" mapping="/shash" docBase="shash" />
    </Service>
</WebServer>



Yang XIAO wrote:
>
> Hi, Shash
>
> I'm also in trouble with configure the JSWDK1.0.1. The 1st problem is the
> following when stopping the server
>
> stopserver
> Using classpath:
> ./webserver.jar:./lib/jakarta.jar:./lib/servlet.jar:./lib/jsp.j
> Loaded configuration from:
> file:/home/stella/java/JSWDK/jswdk-1.0.1/webserver.xml
> Problem connecting to admin registry
>
> then I have to kill the java pid to stop it. Do u have any idear about this?
>
> and can any expert in the list give a working example of webserver.xml?
>
> thanks
> Stella
>
> >From: Shash Chatterjee <[EMAIL PROTECTED]>
> >Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> >        Servlet API Technology." <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: how to alter mappings.properties and servlets.properties
> >Date: Wed, 19 Jan 2000 11:36:41 -0600
> >
> >Joseph,
> >
> >Having fought this battle (i.e. trying to learn with only minimal setup
> >info included in JSWDK), I sympathize.
> >
> >I haven't tried this, so be wary of this.  But it should work:
> >
> >First:
> >
> >In webserver.xml, define your webapplication pretty much following the
> >"example" web application.  Then copy the HelloWorldExample from the
> >examples\Web-inf\servlets to C:\jswdk-1.0.1\mywebappl\web-inf\servlets.
> >Then try out:
> >
> >http://localhost:8080/mywebappl/servlet/HelloWorldExample (assuming you
> >use port 8080).
> >
> >If that works, at least your basic setup for your web application is OK.
> >
> >Then:
> >
> >If you have invoked your JSP as http://localhost:8080/mywebappl/some.jsp
> >
> >then the action probably should be "../servlet/myservlet".  Or, you
> >could say, "/mywebappl/servlet/myservlet".  If you used the "relative"
> >form with the "../" then you could presumably move this servlet/jsp to
> >other web applications without having to change the action.  This is
> >probably confusing, since "mywebappl" and "servlet" have nothing to do
> >with "real" paths in your filesystem, but these are "virtual" paths used
> >by the server (in conjunction with the webserver.xml file) to determine
> >where the "real" files are.  However, the "../" works in the browser
> >since it has no clue whether the paths on the server are real or virtual
> >and it simply replaces the "../" with "/mywebappl".
> >
> >Hope this helps (and works ;-).
> >
> >Shash
> >
> >Joseph Seah wrote:
> > >
> > > hi...
> > >
> > > i'm using JSWDK 1.0.1 and want to create my own web application.
> > > i have copy the structure of examples directory in jswdk-1.0.1 directory
> >to
> > > my own directory i.e. c:\jswdk-1.0.1\mywebappl
> > >
> > > i have my servlet (say myservlet.class) in the following directory:
> > >
> > >         c:\jswdk-1.0.1\mywebappl\web-inf\servlets
> > >
> > > i dunno how to edit mappings.properties and servlets.properties files in
> >the
> > >
> > >         c:\jswdk-1.0.1\mywebappl\web-inf
> > >
> > > if i have a myfile.jsp in my C:\jswdk-1.0.1\mywebappl directory which
> > > contains a form...what then should my action attribute be (if i want to
> >post
> > > to myservlet.class)....
> > >
> > > i tried this cannot work...<form method=post
> > > action="./web-inf/servlets/myservlet">
> > >
> > > please help....had trouble with configuring jswdk-1.0.1..
> > >
> > > as i'm very new to jsp and servlet programming...please advice me....
> > >
> > > thank you very much.
> > >
> > > .js
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Talk to your friends online with Yahoo! Messenger.
> > > http://im.yahoo.com
> > >
> > >
> >___________________________________________________________________________
> > > 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
> >
> >___________________________________________________________________________
> >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
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
> ___________________________________________________________________________
> 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

___________________________________________________________________________
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