Linda,

On 10/7/20 10:36, Haddix, Linda wrote:
> We are in the process of upgrading from Tomcat 8.0.36 to Tomcat 9.0.37
> for the samesite cookie issue.  We found very few differences in the
> version except for
> 
> a context (static)  in server.xml for static content now gives a 404 in
> tomcat.  I have checked the logs and it is getting past apache 2.4 to
> tomcat.
> 
> I have tried adding crossContext=”true” to all applications including
> static but it did not help.

You shouldn't need crossContext="true" unless your application includes
code like this:

  req.getRequestDispatcher("/otherapp/resource").forward(req,rsp);

> The only change made to server.xml is secretRequired=”false”

This should not affect anything about the context deployments, etc.

> I have seen a number of posts where other people have the same issue but
> I have not found any replies to the question.

I don't recall any such questions. References?

> Tomcat logs
> 
> 172.24.30.28 - - [07/Oct/2020:09:59:13 -0400] "GET
> /static/bp_images/5013678_RH.gif HTTP/1.1" 404 790
> 
> 172.24.30.28 - - [07/Oct/2020:09:59:13 -0400] "GET
> /static/bp_images/5013682_RH.gif HTTP/1.1" 404 790
> 
> 172.24.30.28 - - [07/Oct/2020:09:59:13 -0400] "GET
> /static/bp_images/5013936_RH.gif HTTP/1.1" 404 790

What does "DIR I:\" show?

> From server.xml
> 
>      <Host name="localhost"  appBase="webapps" unpackWARs="true"
> autoDeploy="false" deployOnStartUp="true" >
> 
>                                 <Context docBase="i:/" path="/static" />

Do you have another application deployed? You may want to use
<PostResources> in the application instead of a whole extra <Context>
just for this static content. It will be more flexible in the long run.

How are you launching Tomcat? Are you using a Windows Service or are you
running bin\startup.bat or similar?

If you are using the Windows Service, you should check the effective
service user and the permissions for I:\

This item appears in the changelog for Tomcat 9.0.23 (and 8.5.44):

"
Update: 63310: Update to Commons Daemon 1.2.0. This provides improved
support for Java 11. This also changes the user configured by the
Windows installer for the Windows service from Local System to the lower
privileged Local Service. (markt)
"

This item is unfortunately not present in the Migration Guide(s), but
probably should be.

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to