Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perstore/util/settings.js: cannot find local.json when deploying to Tomcat under RIngoJS #44

Open
allencblee opened this issue Dec 7, 2012 · 1 comment

Comments

@allencblee
Copy link

When using ringojs and deploying the war to servlet container like tomcat, the following error appears:

JavaException: java.io.FileNotFoundException: /Applications/springsource/sts-3.1.0.RELEASE/STS.app/Contents/MacOS/local.json (No such file or directory) trying to load local.json, make sure local.json is in your current working directory (perstore/util/settings.js#19)
at perstore/util/settings.js:19
at perstore/store/filesystem.js:13 (anonymous)
at pintura/media/html.js:5

It's because perstore/util/settings.js assumes that local.json is in the current working directory. However, when using an application server, the work directory is the directory of the app server, not the directory of the war.

@neonstalwart
Copy link
Member

when using node, the first statement i have in my index.js (assuming that index.js is the entry point to your application) is process.chdir(__dirname); and i have local.json in that same dir. this lets me start the application from any dir (eg node /some/path/to/index.js) without any issues with paths.

i'm not familiar with ringo and so i'm not sure but it looks like fs.changeWorkingDirectory(module.directory); might do the same thing (http://ringojs.org/api/master/fs/#changeWorkingDirectory and http://ringojs.org/api/master/globals/#module.directory)

does that work for you?

kriszyp added a commit to kriszyp/perstore that referenced this issue Nov 25, 2013
kriszyp added a commit to kriszyp/perstore that referenced this issue Nov 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants