-1

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

is there any way to make it work?

VextoR
  • 5,087
  • 22
  • 74
  • 109
  • Why do you want to do this? It seems like a problem, which may be solved better with a different approach. Maybe a Database would be a better solution. – Christian Kuetbach May 16 '12 at 15:16
  • 1
    If you are running Tomcat as a service it will be running as a local system account and is unlikely to have access to network shares. It certainly won't have access to c$ which requires admin rights to view. – Mark Thomas May 17 '12 at 12:30

1 Answers1

0

If you are on windows make network drive using file exploer, so you will assign the remote path to "local" disk letter. Then use this path. This must work because mapping between local disk letter and the remote path is done utilizing the OS tools. All application will see this as a local drive.

Other way is to try to write something like following:

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

It will probably work but I am not sure.

The first way is preferable.

AlexR
  • 114,158
  • 16
  • 130
  • 208
  • The first way *must* work. What are you doing? Go to file exploer, map network drive to this path. Call it N:. No try that path `N:\Projects\Customers\test/phrases`: just open command prompt and run command `dir N:\Projects\Customers\test/phrases`. If it work try to put this exact path to the tomcat configuration. – AlexR May 16 '12 at 16:13
  • catalina.log: `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)` – VextoR May 17 '12 at 08:06
  • and for first method **cmd dir** working, but catalina says it can't read: `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:4319) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4488) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)` – VextoR May 17 '12 at 08:16