Tomcat 6.0 fails to read symlink(symbolic link) file

Hello all experts, Im in a situation where Tomcat simply does not want to read this file through the symlink....
I checked permissions..OK
Also checked file & tomcat owner...all OK.

This is what I have my /tomcat/conf/Catalina/local/appname.xml
<Context>
<Resource name="jdbc/black"
driverClassName="oracle.jdbc.OracleDriver"
auth="Container"
type="javax.sql.DataSource"
url=......................
username="blah"
password="whoaaa"/>

<Resource name="jdbc/brown"
.
.
<Resource name="jdbc/purple"

.
.
<Context path="/appname" override="true" docBase="appname" reloadable="false" crossContext="true" allowLinking="true"/>
</Context>

I tried to add /tomcat/webapps/appname/META-INF/context.xml ( still doesnt work)

<Context>
<Context path="/appname" override="true" docBase="appname" reloadable="false" crossContext="true" allowLinking="true"/>
</Context>

but my app still does not read the symbolically linked file but if replaced with the real file , works fine.
My tomcat version is 6.0.14 on linux RHEL 5 & jdk1.6.0_16
Any ideas where the issue might be?
All help is very much appreciated.

I don't know details about Tomcat, but it seems it does an lstat() then checks the attributes and aborts if not a "plain file".
Try a hard link instead - it is much harder to detect a hard-link!

i tried to do a hardlink but fails because the target file is on a different filesystem.
:frowning:

it was a bad xml file. fixed that and it worked fine.wrong context declaration( syntax was OK though) prohibited the entire line to be ignored hence the symlink wasn't being read(mainly the allowLinking=true)
once fixed , it got picked up.

1 Like