rApache and rJava

16 views
Skip to first unread message

AJ Adsuar

unread,
Aug 22, 2019, 8:00:41 AM8/22/19
to rapache
Hi,
   I'm experiencing problems on creating scripts the includes the XLConnect library.

For the following code:

library(rJava)
cat
("HELLO WORLD!!!\n")

I'm getting the following 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 '/usr/local/lib/R/site-library/rJava/libs/rJava.so':
  libjvm
.so: cannot open shared object file: No such file or directory
Traceback:
9: stop(msg, call. = FALSE, domain = NA)
8: value[[3L]](cond)
7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
6: tryCatchList(expr, classes, parentenv, handlers)
5: tryCatch({
       attr
(package, "LibPath") <- which.lib.loc
       ns
<- loadNamespace(package, lib.loc)
       env
<- attachNamespace(ns, pos = pos, deps, exclude, include.only)
   
}, error = function(e) {
       P
<- if (!is.null(cc <- conditionCall(e)))
           paste
(" in", deparse(cc)[1L])
       
else ""
       msg
<- gettextf("package or namespace load failed for %s%s:\n %s",
           sQuote
(package), P, conditionMessage(e))
       
if (logical.return)
           message
(paste("Error:", msg), domain = NA)
       
else stop(msg, call. = FALSE, domain = NA)
   
})
4: library(rJava)
3: eval(exprs[i], envir)
2: eval(exprs[i], envir)
1: sys.source(file = "/var/www/html/R/test.R", envir = .rAenv)

I've checked that the same code works smoothly out of the rapache scope, so I'm guessing that there is something wrong with the connectivity between rJava and rapache.

Can you help me?

Kind regards,
   AJ Adsuar

---


You can find below some info about:

Ubuntu

ubuntu:~/$ uname -a
Linux HoB 5.2.0-10-generic #11-Ubuntu SMP Tue Jul 30 19:19:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
ubuntu
:~/$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Eoan Ermine (development branch)
Release: 19.10
Codename: eoan

Apache

ubuntu:~/$ apache2 -v  
Server version: Apache/2.4.41 (Ubuntu)
Server built:   2019-08-14T14:36:32

Java and javareconf

ubuntu:~/$ sudo R CMD javareconf
*** JAVA_HOME is not a valid path, ignoring
Java interpreter : /usr/bin/java
Java version     : 11.0.4
Java home path   : /usr/lib/jvm/java-11-openjdk-amd64
Java compiler    : /usr/bin/javac
Java headers gen.:
Java archive tool: /usr/bin/jar


trying to compile
and link a JNI program
detected JNI cpp flags    
: -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
detected JNI linker flags
: -L$(JAVA_HOME)/lib/server -ljvm
gcc
-std=gnu99 -I"/usr/share/R/include" -DNDEBUG -I/usr/lib/jvm/java-11-openjdk-amd64/include -I/usr/lib/jvm/java-11-openjdk-amd64/include/linux    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-k1TtL4/r-base-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c conftest.c -o conftest.o
gcc
-std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o conftest.so conftest.o -L/usr/lib/jvm/java-11-openjdk-amd64/lib/server -ljvm -L/usr/lib/R/lib -lR




JAVA_HOME        
: /usr/lib/jvm/java-11-openjdk-amd64
Java library path: $(JAVA_HOME)/lib/server
JNI cpp flags    
: -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
JNI linker flags
: -L$(JAVA_HOME)/lib/server -ljvm
Updating Java configuration in /usr/lib/R
Done.

rApache

Version 1.2.9

R

ubuntu:~/$ R --version
R version
3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)


R
is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU
General Public License versions 2 or 3.
For more information about these matters see
https
://www.gnu.org/licenses/.


Reply all
Reply to author
Forward
0 new messages