• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Giving path of a mapped drive in Context Path in Server.xml

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone

I have terabytes of image data in F:\ on my server but that has gone full and now I have attached a storage device and mapped its folder as G:\. I want all the data to go in this so that the images are accessible to the application. I have changed the following

<Context
docBase="F:/DataServer"
path="/srv"
reloadable="true">

to

<Context
docBase="G:/DataServer"
path="/srv"
reloadable="true">

G:\ is here a folder on the storage device which has been mapped as a network folder G:\. If I access a file from command prompt or through run command such as opening a file G:\srv\images\abc.jpg, it works perfectly fine.

Earlier the path http://website/srv/images/abc.jpg was showing the image correctly but now the results are not coming. Kindly help if I am missing something.
 
Bartender
Posts: 20838
125
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Parmandersingh!

A web server is not a file server, so just because you defined G: as a network share and setup a Tomcat Context, that won't make G: accessible to web clients. In fact, since a Context defines an entire webapp, not just a data directory, using Context purely for data access doesn't really work anyway. You'd have to structure the Context target as a WAR.

Beyond that, I recommend reading the Tomcat docs carefully. For security reasons, Tomcat generally defaults to refusing to honor symbolic links in webapp resource paths and must be explicitly instructed to override that behavior.

From my own practical experience, putting a WAR on a network share resulted in I/O errors accessing the WAR, but that was back around Tomcat 5, plus there may have been local transport problems.
 
parmindersingh aziz
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Tim!

I shall read the documentation. In that case, why is it working with F:\ where images are stored and that is a different drive than C:\ where Tomcat has been installed. What are practical ways to override these defaults explicitly. I use Tomcat 5.5

Thanks in advance.
 
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say you mapped a drive to G:, did you do that for the process in which Tomcat is running? If so, how did you do that?
 
parmindersingh aziz
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Paul! I am using Microsoft Storage Server 2008 R2 and added it on the LAN. And then mapped a folder to G:\. I did not understand when you said if it has been mapped for the process in which Tomcat is running. Please elaborate.
 
Paul Clapham
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your Windows machine has many processes running on it. Have a look at the Task Manager if you have no idea about that. Right now my machine has 75 processes running. So when you map your G: drive to some folder somewhere, you just map it for the process which supports your GUI interface, and NOT for any of the other processes.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!