0
votes

I'm having issues transferring my web app from deployment through Eclipse to a Tomcat server on Linux using a WAR file. I'm using Tomcat 7.0.53. When deploying locally, I am able to create specified folder paths that are put into a folder share, and place files in those locations. When trying to do these processes through a deployed WAR on my Tomcat server, the directories in this folder share aren't created, and the files aren't placed. Through logging, I know these folder destinations and files are created though. Any possible reasons behind this? I'm not sure what code to post at this point, so if needed feel free to tell me.

edit: A coworker suggested the way I am referencing the folder destinations is the windows way as opposed to the linux way. I am referencing the directory as:

\\servername\directory\BP

He has suggested that the linux way would be:

/mtn/servername/directory/BP

Not sure if this matters?

edit: I used /mnt/servername/directory/BP/DEV/num/raw/num2 to try and create this directory in the linux environment, but no luck. I'll have to do research to find out how I can create this directories in the folder share using a linux environment.

1
The user that is running the tomcat on linux has proper permissions (write) on the path you are giving to create the file?Jorge Campos
@JorgeCampos Yes they doantihero989
The path you are trying to write the file is inside the path of your WAR file?Jorge Campos
@JorgeCampos no, it is on a folder share that is accessible through linuxantihero989
Yes that matters a lot (what your co-worker said). In order to avoid such a problem use File.separator when creating a path. Like path = "server" + File.separator + "directory" + File.separator + "BP"Jorge Campos

1 Answers

0
votes

It appeared that the directories were being created in a completely different part of my linux directories. I decided to create a folder at root level that would simulate my Folder Share and then use code to differentiate the destination being written to depending on whether I was in a Production environment or not.

My exact file destinations would be something like:

/Fakejservdc01/folder/folder/RewardsLoyaltyFiles

and if I needed to dig deeper I did what @JorgeCampos told me and used File.separator.

This seemed to fix the problem