tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Static files not being displayed
Date Fri, 28 Oct 2011 19:47:16 GMT
> From:
> André Warnier <>
> To:
> Tomcat Users List <>
> Date:
> 10/28/2011 03:35 PM
> Subject:
> Re: Static files not being displayed
> Francis GALIEGUE wrote:
>> On Fri, Oct 28, 2011 at 21:08, André Warnier <> wrote:
>>> Rajkumar Singh wrote:
>>>> Hello guys,
>>>> I am using tomcat version 6.0.29. The tomcat is deployed on the OS 
> Linux.
>>>> I created a war file named ROOT.war and dropped it under the tomcat
>>>> "webapps" folder. The WAR consists of JSP, JAR, XML and static files 
> like
>>>> images, javascript and CSS.
>>>> The tomcat expanded the WAR file properly and I was able to get to the
>>>> dynamic files of my application through the URL. However what I 
> noticed was
>>>> that all the static files are not fetched from the server. I get 404 
> error
>>>> in my firebug (Using firefox as my browser).
>>>> And the dynamic files are shown correctly, no problem with that. Even 
> my
>>>> application is making the database call and making right transaction 
> with it
>>>> Can someone please help me in resolving the issue? Is there any
>>>> configuration that needs to be done on the tomcat server. To let you 
> all
>>>> know, this is the first time I am working on the tomcat 6 version.
>>> To my knowledge, there is nothing "special" in terms of configuration
>>> required to allow Tomcat to serve static files, if they are in the 
> right
>>> place.
>>> (Of course, this applies to a "standard" Tomcat downloaded from
>>>; things may be different for pre-packaged Tomcat's 
> from
>>> other sources).
>>> To get more help, you will need to provide some additional information.
>>> Since you are using firebug, you should be able to see which exact URL 
> the
>>> browser requests for one of these static elements.
>>> Give us an example, and also tell us the path of this same element on 
> disk.
>>> What may also help is the content of the ./WEB-INF/web.xml file of your
>>> application, and the ./META-INF/context.xml if there is one (all 
> comments
>>> and passwords removed).
>>> And also tell us where you got your Tomcat from, and where you find 
> Tomcat's
>>> "server.xml" file.
>> I'd say, first, configure an AccessLogValve and give the output of it.
>> Tomcat definitely cannot find the requested files and there has to be
>> a reason for it.
> There is certainly a reason, but we don't know yet if it is really Tomcat 
> sending the 404 
> replies.
> The access log would help, presuming the requests really go to that same 
> Tomcat.
> But the firebug data should tell us that.

Rajkumar, this way :

Rajkumar Singh wrote:
 > I am sure all the request are going to the tomcat server since firebug
 > clearly shows the same domain name for the file that are retrieved and
 > those that are not.
(reply at the end, not at the beginning)

Then, in your server.xml, uncomment this section :

          <!--<Valve className="org.apache.catalina.valves.AccessLogValve"
                 prefix="tomcat_access." suffix=".log" pattern="common"

That will make Francis happy. :-)

Then, answer ny other questions :
- what is a request URL for one of these static files, as firebug clearly shows it for the

request line ? (I mean, paste that URL here please)
- what is the path on disk of that same file ?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message