tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lava Saleem <lnsal...@ualr.edu>
Subject Re: HTTP status 404
Date Thu, 09 Dec 2010 19:40:14 GMT
Hi Mark,
I have changed my web.xml file to the one you send me and added the
welcome-file-list so I will not need to navigate to
localhost:8080/filename/filename.htm, I changed the index.htm to
filename.htm    then I navigated to  localhost:8080/filename and it didn't
work , I also copied the filename.war file to the webapps and nothing
changed

 however after changing the web.xml file when I navigate to
localhost:8080/filename/filename.htm   the filename pops up, on the manager
side its says running but the session stays zero  so to be honest I'm kinda
confuse is it working now ?if I changed the web.xml shouldn't be working on
localhost:8080/filename/ ?

Thanks
Lava

On Thu, Dec 9, 2010 at 1:15 PM, Mark Eggers <its_toasted@yahoo.com> wrote:

> In the absence of a web.xml file with the following:
>
>    <welcome-file-list>
>        <welcome-file>filename.htm</welcome-file>
>    </welcome-file-list>
>
> You will have to navigate to:
>
> localhost:8080/filename/filename.htm
>
> In another message I posted a minimal web.xml file. Change index.html to
> filename.htm (if this is what you want your welcome file to be). Then
> navigating
> to:
>
> localhost:8080/filename/
>
> will work.
>
> If you want to create a war file, do the following:
>
> 1. Change to the directory filename
> 2. jar cf ../filename.war .
> 3. cd ..
> 4. jar tf filename.war (should give you the complete structure)
>
> One way to use the war file:
>
> 1. Copy filename.war to $CATALINA_HOME/webapps
>
> If running, the default configuration of Tomcat will explode the war file
> and
> you will see a filename directory in $CATALINA_HOME/webapps along with
> filename.war. If you look inside that directory, you will see your web
> application structure.
>
> . . . . . just my two cents.
>
> /mde/
>
> ----- Original Message ----
> From: Lava Saleem <lnsaleem@ualr.edu>
> To: users <users@tomcat.apache.org>
> Sent: Thu, December 9, 2010 9:10:13 AM
> Subject: Re: HTTP status 404
>
>  Hello everyone,
> Thanks for the replies I really appreciate your feedback
>
> I have the structure as the following
> webapps
> |
> filename
>    |- filename.htm
> *    |-*WEB-INF
>            |- web.xml
>    |-META-INF
>            |-context.xml
>
> after having this structure,I use the following command
>
> CATALINA_BASE/webapps/filename/ jar -cvf filename.war *.*
>
> then I deploy the file in the tomcat manager and I have the following error
>
> HTTP status 404
> description the requested resource (/filename/)is not available
>
> I assumed that I don't need the  java classes and lib in the WEB-INF  since
> I'm only having single html file with java script, Do you think I need any
> ?
> if so how do I know which files I need ?
>
> I also extracted the filename.war just to see whats in there and I see only
> the filename.htm and the META-INF  there is no WEB-INF it is disappearing
>
> Thanks
> Lava
>
> On Wed, Dec 8, 2010 at 4:35 PM, André Warnier <aw@ice-sa.com> wrote:
>
> >  Lava Saleem wrote:
> >
> >> Hi everyone,
> >> I have  a single page html file with java script embadded in it, I have
> >> created a war file for it and deployed it successfully but when I click
> on
> >> the page I get the below error, the structure of my war file is the
> >> following
> >>
> >> webapp --> filename --> WEB-INF--> filename.htm  + web.xml + META-INF
> >> +  classes + lib
> >>
> >> I did not modify the web.xml since I don't need the servlets do I need
> to
> >> modify anything?
> >>
> >> HTTP status 404
> >> description the requested resource (/filename/)is not available
> >>
> >>
> > Hi.
> > Except the 404 error which your are getting, not much above makes any
> sense
> > at all.
> >
> > So it is better to forget all that, and start new.
> > You really have to learn to walk before you can run.
> >
> > First, consider the directory structure of a standard Tomcat installation
> :
> >
> > (CATALINA_HOME)
> > (=CATALINA_BASE)
> >      |
> >      |- bin (tomcat "programs" and scripts)
> >      |- conf (configuration files)
> >      |- lib (global library files)
> >      |- logs (logfiles)
> >      |- webapps (* web applications *)
> >            |- ROOT  (the special, top-level, default web application)
> >            |- app1 (a web application)
> >            |- app2 (another web application)
> >            |- ...
> >            |- lastapp (another web application)
> >
> > In the above, "(CATALINA_HOME)" represents the top directory of your
> Tomcat
> > installation, the one under which the rest of Tomcat is found.
> > For example, on your system it may be "C:\tomcat" or "C:\program
> > files\Apache Software Foundation\tomcat6.0" or "/usr/share/tomcat6" or
> > "/usr/local/tomcat6" or whatever.
> >
> > The "webapps" sub-directory is what is important for you now.  That is
> > where you will put "web applications", composed of static html pages
> (with
> > or without javascript in them), JSP pages (special html pages with
> embedded
> > Java code), java servlets (compiled java applications), etc..
> >
> > The ROOT web application is special.  It is the "default application".
> > When you use a URL like : http://yourserver.yourcompany.com/abc.html
> > Tomcat is going to look for "abc.html" under the webapps/ROOT directory.
> >
> > The other subdirectories under "webapps" are each one separate web
> > application.
> > To access for example the application named "app1", you will have to use
> a
> > URL starting with "http://yourserver.yourcompany.com/app1/...."
> > For example, if you place a html page named "xyz.html" in the
> subdirectory
> > (CATALINA_HOME)/webapps/app1, then the URL to call it up will be
> > http://yourserver.yourcompany.com/app1/xyz.html
> >
> > Under such a web application directory like ../webapps/app1, there is
> also
> > a structure.
> > It looks like this :
> >
> > (CATALINA_HOME)
> > (=CATALINA_BASE)
> >      |- webapps (* dir, top of all web applications *)
> >            |
> >            |- app1 (dir, contains the web application named "app1")
> >                - public files (html etc..)
> >                - WEB-INF (directory)
> >                     |- files (private)
> >                     |- web.xml (configuration file for the application)
> >                     |- classes (dir.)
> >                           |- compiled java classes, like servlets
> >                     |- lib (dir)
> >                           |- java libraries for this webapp
> >                - META-INF (dir.)
> >                     |- context.xml (more settings for the application)
> >
> > Basically everything under "app1" is optional.  Tomcat will supply a
> > default if needed.
> > Of course, you will want at least one file under there, to make the
> execise
> > meaningful.
> >
> > What is in the sub-directories WEB-INF and META-INF, can never be
> obtained
> > directly by a browser. Tomcat will not allow it.
> > So if you enter the following URL in the browser :
> > http://yourserver.yourcompany.com/app1/WEB-INF/something
> > Tomcat will respond with an error, even if "something" exists.
> >
> >
> > But to start, I suggest that you just
> > - stop tomcat
> > - create a new sub-directory under ../webapps/, for example "myapp".
> > - under that subdirectory, place a file called "myfile.html"
> > - verify that the ownership and permissions of these files are such that
> > the Tomcat user can read them
> > - start Tomcat
> > - in the browser, enter the URL :
> > http://yourserver.yourcompany.com/myapp/myfile.html
> > and enjoy.
> >
> > Now play around with the above :
> > - create another page "mypage2.html", place it alongside "myfile.html",
> > start Tomcat and call up the new page in the browser.
> > - then stop Tomcat again, and create another subdirectory under
> "webapps",
> > put something there, start Tomcat and call it up with the browser.
> > - then stop Tomcat again, create a sub-directory "WEB-INF" under one of
> > your webapps, put something in it, start Tomcat and try to call up that
> > file.
> >
> > When you understand exactly how that works, then go read this page
> (again)
> > :
> >
> > http://tomcat.apache.org/tomcat-6.0-doc/appdev/deployment.html
> >
> > And then you should come back for more questions about how to make .war
> > files and deploy them properly.
> > (tip : a .war file is just a zip file with the same content as the "app1"
> > subdirectory above.  It has to be named "app1.war", and you have to copy
> it
> > under /webapps/ for Tomcat to understand what you want).
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Lava Saleem
Ph.D Candidate
Systems Engineering Dept. ETAS 357
University of Arkansas at Little Rock
2801 S University Avenue
Little Rock, AR 72204
Tel: (501) 920 6261
Email: lnsaleem@ualr.edu

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message