Bug 57892

Summary: Log once a warning if a symbolic link is ignored (e.g. to web.xml )
Product: Tomcat 7 Reporter: Ralf Hauser <hauser>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: NEW ---    
Severity: enhancement    
Priority: P2    
Version: 7.0.56   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Ralf Hauser 2015-05-05 13:53:15 UTC
In private WebXml ContextConfig.getDefaultWebXmlFragment() or also getWebXmlSource() nothing is found if the web.xml is a symlink.

Please add a message to stderr/catalina.out if the system ignores an existing web.xml

Background:

In an eclipse installation, I use several configurations in server.xml like

<Context path=""
docBase="/home/me/workspace/project1/" reloadable="true"
workDir="/home/me/workspace/project1/work" ...

If the web.xml is symlink it fails.

Such an error message would have saved me quite some time.
Comment 1 Mark Thomas 2015-05-05 14:01:21 UTC
The behaviour w.r.t. symlinks is documented under the allowLinking attribute of the context (note it moves to Resources in 8.0.x). Any linked resource is ignored by default.

I'm not convinced that only web.xml deserves special treatment.

We probably don't want a message on every attempted access. One message per application the first time any symlink is skipped is probably sufficient.

In terms of log level, WARN seems most appropriate.
Comment 2 Ralf Hauser 2015-05-05 23:00:00 UTC
Agreed such warnings need not be restricted to web.xml

Also agreed that not every attempted access needs to be warned.
But I would warn once per attempted distinct path as there is sometimes quite some log output and users who grep for their filename wouldn't necessarily find it if it wasn't the first one.