Beginner servlet question: accessing files in a .war, which path?

Posted by Navigateur on Stack Overflow See other posts from Stack Overflow or by Navigateur
Published on 2010-12-27T13:01:14Z Indexed on 2010/12/28 12:53 UTC
Read the original article Hit count: 156

Filed under:
|

When a third-party library I'm using tries to access a file, I'm getting "Error opening ... file ... (No such file or directory)" even though I KNOW the file is in the WAR. I've tried both packaged (.war) and "exploded" (directory) deployment, and the file is definitely there. I've tried setting full permissions on it too. It's on Unix (Ubuntu). File is war/dict/index.sense and the error is "dict/index.sense (No such file or directory)".

It works fine on my Windows computer when running in hosted mode as a GWT app from Eclipse, just not when I transfer it to the Unix machine for deployment.

My question is: has anybody experienced this before and/or are there differences in relative path that I should consider i.e. what's the root path for relative file access in a war?

© Stack Overflow or respective owner

Related posts about file

Related posts about servlets