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="\\\c$\Projects\Customers\test\phrases" 
workDir="\\\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://$/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?

  • 1
    Is tomcat running as a user that has access to that share? – mahnsc May 19 '12 at 15:56

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.