You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Steve Parker <sc...@cisco.com> on 2000/10/05 20:18:20 UTC

Newbie Questions: How to Set up web.xml files

Not to sound like a complete newbie, but I'm baffled by the documentation
provided and would like some clarification.

I'm running Windows NT 4.0 with Tomcat 3.1 and isapi_redirect.dll.  I would
like to create a new directory called URLTest under my tomcat webapps
directory.  I have also gone into IIS and created a virtual directory with the
same name that points to the same directory.

Here are my questions:

1.  What do I need to change in my uriworkermap.properties file?

I added a line: /URLTest/*=ajp12

2.  What do I need to change in my conf/server.xml file?

I added the lines:

<Context path="/URLTest" docBase="webapps/URLTest" debug="0" reloadable="true"
>
</Context>

3.  What do I need to change in my conf/web.xml file?  I haven't changed
anything.

4. What do I need to change/add in my URLTest/WEB-INF/web.xml file?  Do I even
need a web.xml file in this directory?  If so what would the contents be?

I'm trying to create an applet that makes a URL connection to my servlet, but I
keep getting an IOException when I try to send the data to that URL.

Please, can somebody help me out here?

Thanks,

Steve




Re: Newbie Questions: How to Set up web.xml files

Posted by Steve Parker <sc...@cisco.com>.
The last error is because I didn't update my server.xml file.  Now that I did that and
restarted Tomcat I'm getting the error:

Error reading request null

And the Netscape Java console spits this information out:

java.io.IOException: The document contained no data.
Try again later, or contact the server's administrator.
  at netscape.net.URLConnection.connect(Compiled Code)
  at netscape.net.URLConnection.getInputStream(Compiled Code)
  at com.oreilly.servlet.HttpMessage.sendGetMessage(Compiled Code)
* at com.oreilly.servlet.HttpMessage.sendGetMessage(Compiled Code)
  at DaytimeApplet.getDateUsingHttpText(Compiled Code)
  at DaytimeApplet.refresh(Compiled Code)
  at DaytimeApplet.start(Compiled Code)
  at netscape.applet.DerivedAppletFrame$StartAppletEvent.dispatch(Compiled Code)
  at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)
  at java.awt.EventDispatchThread.run(Compiled Code)
  at netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled Code)

I tried a different applet and I'm getting the same error:

java.io.IOException: The document contained no data.
Try again later, or contact the server's administrator.

Any ideas?

Steve Ruby wrote:

> If it says it can't find it, does it say where it is looking?
>
> You are accessing it something like
> http://site/URLTest/servlet/ServletName
>
> servlet name is case sensitive and unless you modify your web.xml
> you have to have servlet in there.
>
> Steve Parker wrote:
> >
> > Thanks for the quick reply.  I did as you directed and I do have something in the
> > log files now.  The log message in tomcat.log says that it can't find my servlet,
> > but I did put the servlet in the URLTest/WEB-INF/classes directory.  Is this the
> > right place to put this file?  If so, what could the problem be?
> >
> > Thanks again for your help
> >
> > Steve Ruby wrote:
> >
> > > Steve Parker wrote:
> > > >
> > > > I'm running Windows NT 4.0 with Tomcat 3.1 and isapi_redirect.dll.  I would
> > > > like to create a new directory called URLTest under my tomcat webapps
> > > > directory.  I have also gone into IIS and created a virtual directory with the
> > > > same name that points to the same directory.
> > >
> > > You don't want to do that,  YOu should read the IIS howto.html doc.
> > > You should have to create only a virtual directory called jakarta
> > >
> > > > 1.  What do I need to change in my uriworkermap.properties file?
> > > > I added a line: /URLTest/*=ajp12
> > >
> > > yes, you need that
> > >
> > > >
> > > > 2.  What do I need to change in my conf/server.xml file?
> > > > I added the lines:
> > > > <Context path="/URLTest" docBase="webapps/URLTest" debug="0" reloadable="true"
> > > > </Context>
> > >
> > > You do not need to do anything to server.xml, but what you did shouldn't
> > > hurt
> > > anything.
> > >
> > > >
> > > > 3.  What do I need to change in my conf/web.xml file?  I haven't changed
> > > > anything.
> > > >
> > >
> > > nothing
> > >
> > > > 4. What do I need to change/add in my URLTest/WEB-INF/web.xml file?  Do I even
> > > > need a web.xml file in this directory?  If so what would the contents be?
> > > >
> > >
> > > You don't need a web.xml there, unless you wish to have custom settings
> > > for that application (it's own session timeout, any servlet mappings,
> > > etc)
> > >
> > > Before you get the Isapi redirector working you should make sure you
> > > can get what you want from tomcat standalone.. Then when that works
> > > (jsp examples and servlet examples) and your URLTest thing, then
> > > you can worry about isapi..
> > >
> > > the isapi thing is only a redirector so anything that works thourgh IIS
> > > involving tomcat should also work though tomcat stand alone.


Re: Newbie Questions: How to Set up web.xml files

Posted by Steve Ruby <st...@rubysolutions.com>.
If it says it can't find it, does it say where it is looking?

You are accessing it something like
http://site/URLTest/servlet/ServletName

servlet name is case sensitive and unless you modify your web.xml
you have to have servlet in there.

Steve Parker wrote:
> 
> Thanks for the quick reply.  I did as you directed and I do have something in the
> log files now.  The log message in tomcat.log says that it can't find my servlet,
> but I did put the servlet in the URLTest/WEB-INF/classes directory.  Is this the
> right place to put this file?  If so, what could the problem be?
> 
> Thanks again for your help
> 
> Steve Ruby wrote:
> 
> > Steve Parker wrote:
> > >
> > > I'm running Windows NT 4.0 with Tomcat 3.1 and isapi_redirect.dll.  I would
> > > like to create a new directory called URLTest under my tomcat webapps
> > > directory.  I have also gone into IIS and created a virtual directory with the
> > > same name that points to the same directory.
> >
> > You don't want to do that,  YOu should read the IIS howto.html doc.
> > You should have to create only a virtual directory called jakarta
> >
> > > 1.  What do I need to change in my uriworkermap.properties file?
> > > I added a line: /URLTest/*=ajp12
> >
> > yes, you need that
> >
> > >
> > > 2.  What do I need to change in my conf/server.xml file?
> > > I added the lines:
> > > <Context path="/URLTest" docBase="webapps/URLTest" debug="0" reloadable="true"
> > > </Context>
> >
> > You do not need to do anything to server.xml, but what you did shouldn't
> > hurt
> > anything.
> >
> > >
> > > 3.  What do I need to change in my conf/web.xml file?  I haven't changed
> > > anything.
> > >
> >
> > nothing
> >
> > > 4. What do I need to change/add in my URLTest/WEB-INF/web.xml file?  Do I even
> > > need a web.xml file in this directory?  If so what would the contents be?
> > >
> >
> > You don't need a web.xml there, unless you wish to have custom settings
> > for that application (it's own session timeout, any servlet mappings,
> > etc)
> >
> > Before you get the Isapi redirector working you should make sure you
> > can get what you want from tomcat standalone.. Then when that works
> > (jsp examples and servlet examples) and your URLTest thing, then
> > you can worry about isapi..
> >
> > the isapi thing is only a redirector so anything that works thourgh IIS
> > involving tomcat should also work though tomcat stand alone.

Re: Newbie Questions: How to Set up web.xml files

Posted by Steve Parker <sc...@cisco.com>.
Thanks for the quick reply.  I did as you directed and I do have something in the
log files now.  The log message in tomcat.log says that it can't find my servlet,
but I did put the servlet in the URLTest/WEB-INF/classes directory.  Is this the
right place to put this file?  If so, what could the problem be?

Thanks again for your help

Steve Ruby wrote:

> Steve Parker wrote:
> >
> > I'm running Windows NT 4.0 with Tomcat 3.1 and isapi_redirect.dll.  I would
> > like to create a new directory called URLTest under my tomcat webapps
> > directory.  I have also gone into IIS and created a virtual directory with the
> > same name that points to the same directory.
>
> You don't want to do that,  YOu should read the IIS howto.html doc.
> You should have to create only a virtual directory called jakarta
>
> > 1.  What do I need to change in my uriworkermap.properties file?
> > I added a line: /URLTest/*=ajp12
>
> yes, you need that
>
> >
> > 2.  What do I need to change in my conf/server.xml file?
> > I added the lines:
> > <Context path="/URLTest" docBase="webapps/URLTest" debug="0" reloadable="true"
> > </Context>
>
> You do not need to do anything to server.xml, but what you did shouldn't
> hurt
> anything.
>
> >
> > 3.  What do I need to change in my conf/web.xml file?  I haven't changed
> > anything.
> >
>
> nothing
>
> > 4. What do I need to change/add in my URLTest/WEB-INF/web.xml file?  Do I even
> > need a web.xml file in this directory?  If so what would the contents be?
> >
>
> You don't need a web.xml there, unless you wish to have custom settings
> for that application (it's own session timeout, any servlet mappings,
> etc)
>
> Before you get the Isapi redirector working you should make sure you
> can get what you want from tomcat standalone.. Then when that works
> (jsp examples and servlet examples) and your URLTest thing, then
> you can worry about isapi..
>
> the isapi thing is only a redirector so anything that works thourgh IIS
> involving tomcat should also work though tomcat stand alone.


Re: Newbie Questions: How to Set up web.xml files

Posted by Steve Ruby <st...@rubysolutions.com>.
Steve Parker wrote:
> 
> I'm running Windows NT 4.0 with Tomcat 3.1 and isapi_redirect.dll.  I would
> like to create a new directory called URLTest under my tomcat webapps
> directory.  I have also gone into IIS and created a virtual directory with the
> same name that points to the same directory.

You don't want to do that,  YOu should read the IIS howto.html doc.
You should have to create only a virtual directory called jakarta


> 1.  What do I need to change in my uriworkermap.properties file?
> I added a line: /URLTest/*=ajp12

yes, you need that


> 
> 2.  What do I need to change in my conf/server.xml file?
> I added the lines:
> <Context path="/URLTest" docBase="webapps/URLTest" debug="0" reloadable="true"
> </Context>

You do not need to do anything to server.xml, but what you did shouldn't
hurt
anything.

> 
> 3.  What do I need to change in my conf/web.xml file?  I haven't changed
> anything.
>

nothing
 
> 4. What do I need to change/add in my URLTest/WEB-INF/web.xml file?  Do I even
> need a web.xml file in this directory?  If so what would the contents be?
> 

You don't need a web.xml there, unless you wish to have custom settings
for that application (it's own session timeout, any servlet mappings,
etc)


Before you get the Isapi redirector working you should make sure you
can get what you want from tomcat standalone.. Then when that works
(jsp examples and servlet examples) and your URLTest thing, then
you can worry about isapi..

the isapi thing is only a redirector so anything that works thourgh IIS
involving tomcat should also work though tomcat stand alone.