0

One of the developers here has written some Java code which uses the Apache FileUtils FileCopy command to copy a csv from a host server (linux) to a file share (EMC NAS).

The share's setup such that 'Everyone' has 'Full Control' (i.e. to ensure there are no permissions issues - we'll later restrict permissions once things are proven to work).

The code runs under TomCat/Apache.

It works copying the file from one directory on the host server to another; just not when attempting to copy to the remote share (no errors appear to be thrown / nothing happens - the code just continues as if the copy had worked, but nothing shows up in the destination). The same issue occurs when attempting to write a new file to the share.

http://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/FileUtils.html

Has anyone seen this behaviour before / any ideas what may cause it? Thanks in advance.

JohnLBevan
  • 22,735
  • 13
  • 96
  • 178
  • @JohnBevan do you have the code? It could be a simple catch(Exception e) {//do nothing}. We need some code – Eugene Apr 26 '13 at 10:52

1 Answers1

1

I honestly doubt that any errors are just silently ignored unless you on purpose catch the exception and discard it.

One common problem is that Tomcat running with default settings does not follow symbolic links. If you are using a symbolic link to access the NAS, you have to enable symbolic links by setting allowLinking="true" in your web app context.

The problem may of course also be that Tomcat is running with an enabled security manager and that the security manager configuration disallows access to the NAS mount point.

jarnbjo
  • 33,923
  • 7
  • 70
  • 94
  • Thanks Jarnbjo - I agree that you should see Exceptions - my only guess is there's something in the FileCopy method which catches the error and doesn't rethrow it (i.e. a bug). I'll feed back as soon as I hear back from the developer on how he gets on. – JohnLBevan Apr 29 '13 at 09:06