I'm working on windows, with Tomcat 9.0 / Java 8 One of my servlet will create and manage quite a lot of images. So we decided to store those on a network disk.
On my Windows server I mounted the resource on P:/
To access images outside Tomcat, I set the context in the host of server.xml. To be sure that it was working fine, I first tried in local like this :
<Context docBase="C:/IMG/" path="/RepIMG" />
Then if I try to access : http://localhost/RepIMG/test.jpg The image is displayed.
But if I change my context to :
<Context docBase="P:/IMG/" path="/RepIMG" />
Tomcat will not start at all with this error : Caused by: java.lang.IllegalArgumentException: L'ensemble de ressources principal [P:] est invalide
=> The main ressource [P:] is not valid
If I try to access directly P:/IMG/test.jpg with Chrome it works fine. I checked the permissions on the folder and everything seems to be ok.
Since it's working when I access a local disk I assume the issue is the fact that I try to access a mounted disk.
Is there something to specify or some way to troubleshoot this? To know exactly what's wrong?