Hi,
I try to connect to my PostgreSQL server using DatabaseConnector::connect, but I get the next error:
> conn <- DatabaseConnector::connect(connectionDetails)
Connecting using PostgreSQL driver
Error in rJava::.jcall(p, "Ljava/lang/Object;", "setProperty", names(properties)[I], :
java.lang.NullPointerException
I couldn’t find a solution online. Can someone help me with that?
I tried removing and reinstalling java, rjava, DatabaseConnector, but nothing helped.
Something is weird, I do have rJava, and I can load it. But when I tried to reinstall it, I get the next error:
Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/home/user1/R/x86_64-koji-linux-gnu-library/4.0/00LOCK-rJava/00new/rJava/libs/rJava.so':
libiconv.so.2: cannot open shared object file: No such file or directory
So I found libiconv.so.2, and add it to the ld path, but then I get another error when I try to reinstall rJava:
Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/home/user1/R/x86_64-koji-linux-gnu-library/4.0/00LOCK-rJava/00new/rJava/libs/rJava.so':
/home/user1/R/x86_64-koji-linux-gnu-library/4.0/00LOCK-rJava/00new/rJava/libs/rJava.so: undefined symbol: JNI_GetDefaultJavaVMInitArgs
Error: loading failed
So maybe it’s related to some other installations (working on Linux). Do you have any clue?
I did the same thing on ubuntu using OracleJDK version 8, it is working fine. Can you kindly tell me which java versions are you using OpenJDK or Oracle JDK?
So, I tried it again after this incident, it is working fine with my steps.
Unfortunately, it still doesn’t work for me. I’m working on an EC2 Centos instance. I tried to install directly, or from anaconda, I tried the open JDK, and I tried Oracle JDK (couldn’t find for anaconda). But still I’m getting the same error of:
java.lang.NullPointerException
Does anyone have a conda environment that works OHDSI packages?
Can you please help me understand what configuration works for you? Which R and Java version, as well as other essential R packages’ version?
Alternatively, how can I debug that?
I’m running Windows, with Oracle Java 1.8, R 4.1.2. We’ve got unit tests set up on MacOS and Ubuntu as well (see here). I’m not exactly sure what Java those are running.
If you’d like to try to debug, maybe you could try running this code? This seems to be causing a problem in your setup (in mine it just produces ‘NULL’ as output)::