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

error while loading the package, "cannot open file './config/jar_config.json': No such file or directory" #25

Open
eheisman opened this issue Mar 7, 2022 · 5 comments

Comments

@eheisman
Copy link
Owner

eheisman commented Mar 7, 2022

i am getting error while loading the package.. i am attaching the error message below. can anyone help me to fix this?

Error: package or namespace load failed for ‘dssrip’:
.onLoad failed in loadNamespace() for 'dssrip', details:
call: file(con, "r")
error: cannot open the connection
In addition: Warning message:
In file(con, "r") :
cannot open file './config/jar_config.json': No such file or directory

Originally posted by @Indhu905 in #18 (comment)

@eheisman
Copy link
Owner Author

eheisman commented Mar 7, 2022

@Indhu905: As a work around, you can set a dss_config_filename as an R option before loading the package to point to a copy of this file living in your home directory. You can find an example copy to use in the /config/ directory of the package. Without this option set, it tries to use the one provided with the package, which appears not to be loading correctly. This needs to be fixed, hence creating a new issue. I have run into it setting up dssrip on several new machines now.

Prior to loading the package or in your .Rprofile:

options(dss_config_filename = "/path/to/dss_jar_config.json")

You may also want to include the following, if the only difference in the jar_config.json you are using is the location where DSSVue is installed.

options(dss_override_location="c:\\programs\\HEC-DSSVue-v3.0.00.212\\")

The names of the .jar files and their locations have changed over the last few releases of HEC-DSSVue, so if you are having trouble, you may need to check that all of the .jar files referenced in the jar_config.json file exist and are named correctly for the version you are using. I have successfully tested the current jar_config.json with HEC-DSSVue 3.0.0.212, linked from README, but cannot provide help making it work with newer or older versions.

@Indhu905
Copy link

Indhu905 commented Mar 8, 2022

Thank you sir, it actually worked

@danielrodonnell
Copy link

I have successfully run the workaround above, but when I run library(dssrip) I am now getting this error:

Error: package or namespace load failed for ‘dssrip’:
.onLoad failed in loadNamespace() for 'dssrip', details:
call: file(con, "r")
error: cannot open the connection
In addition: Warning message:
In file(con, "r") :
cannot open file 'C:/Users/DOdonnell/AppData/Local/R/win-library/4.2/dssrip/dssrip.config': Permission denied

I suspect this has to do with file permissions, but I'm not 100% sure about that. When I chmod the dssrip.config directory the error remains. I'm on a CA state computer though, so it's possible my chmod isn't sticking. I guess I'm just looking for a second opinion on whether this is a file permissions issue.

@danielrodonnell
Copy link

As a follow-up to the above, I ran into a host of issues installing the package that all had to do with me being on a state computer. I found a simple workaround that fixes most of these issues (except the above), which I'd like to share with you if you're interested. At CDFW, we have a dire need of the dssrip package, and I think adding this workaround to the install code could be really helpful to a lot of us!

@eheisman
Copy link
Owner Author

eheisman commented May 8, 2023

@danielrodonnell - Yes, this package was initially developed on a personal machine and then has a few work arounds using options() calls that I implemented to work on a corporate or government managed computer. I would be interested in your work arounds. I apologize it did not work out of the box for you - I've not had significant time to maintain this package in the last few years, but I know many find it useful.

You ought to be able to load the dssrip.config file from your user directory instead by adding the following to your .Rprofile file or the top of the script before loading the library.

options(dss_config_filename="~\\dssrip.config")

I also have the following in my .Rprofile file, which may be required to make it work right.

options(dss_override_location="c:\\projects\\dssrip\\monolith")  # install java dependencies elsewhere, the JNI javaheclib.dll file often cannot be read from C:\users\... directories due to security settings. 
options(dss_default_config="monolith-win-x86_64") # which version of the dependencies to use
options(dss_allowed_states="untested") # allow that version, it is more tested now...
options(dssrip_debug=T) # debugging required for some reason.

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

3 participants