Tomcat – How to specify path in Apache tomcat catalina for folder on different server

tomcatwindows-server-2003

On apache tomcat

C:\Program Files\Apache Software Foundation\Tomcat
6.0\conf\Catalina\localhost\

we can change folders for another by specify it in XML like: THE_FOLDER.xml and in that xml we can change that THE_FOLDER path

<Context path="/MF_PHRASES" reloadable="true" docBase="C:\Projects\Customers\test\phrases" workDir="C:\Projects\Customers\test\phrases" />

but it doesn't work for folder located on other server:

<Context path="/MF_PHRASES" reloadable="true" docBase="\\192.168.0.100\c$\Projects\Customers\test\phrases" 
workDir="\\192.168.0.100\c$\Projects\Customers\test\phrases" />

not working

Tried 2 methods:

1) mapping through network drive, got the error:

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base
Z:\Projects\Customers\test\phrases does not exist or is not a readable
directory at
org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:142)
at
org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:431‌​9)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4488)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)

2) file://192.168.0.100/c$/Projects/Customers/test/phrases

SEVERE: Error deploying configuration descriptor MF_PHRASES_NEW.xml
java.io.IOException: The filename, directory name, or volume label
syntax is incorrect at java.io.WinNTFileSystem.canonicalize0(Native
Method) at java.io.Win32FileSystem.canonicalize(Unknown Source) at
java.io.File.getCanonicalPath(Unknown Source) at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:658)
at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)

is there any way to make it work?

Best Answer

In the first case, like mahnsc said, looks like its a permission thing. The user that owns Tomcat cannot read/write in that directory. In the second case, it's more possible that the docBase attribute does not understand paths containing IP addresses.