opencpu package or namespace load failed for 'rJava' - r

I have install.packages("rJava") in R
it is ok
library(rJava) is ok
but when I issue GET request "../library/rJava/R" to opencpu server, it can't be accessed.
../library/rJava is ok
error:HTTP 400 Bad Request,package or namespace load failed for 'rJava'
and /var/log/kern.log: kernel: [92053.630574] type=1400 audit(1427769314.925:227): apparmor="DENIED" operation="open" profile="opencpu-main" name="/proc/21078/stat" pid=21078 comm="sh" requested_mask="r" denied_mask="r" fsuid=33 ouid=33
My Configuration:
R version 3.1.3 (2015-03-09)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu precise (12.04.5 LTS)
Java:version "1.7.0_75"
opencpu:1.4.6

This seems to be a known issue in opencpu and it is in their github too . It is not yet fixed. Please refer this link https://github.com/jeroenooms/opencpu/issues/123 for more details about this bug. I faced this same error when I tried to invoke a function in a package called mallet which depends on rJava.

Related

R Compind package double free or corruption (out) Aborted (core dumped)

I have bumped in this error,
but I have no idea how to investigate if it is related to my c++ packages or is the Compind package.
Thank you
**install.packages("Compind", dependencies=TRUE)
** byte-compile and prepare package for lazy loading
double free or corruption (out)
Aborted (core dumped)
ERROR: lazy loading failed for package ‘Compind’
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/4.1/Compind’
The downloaded source packages are in
‘/tmp/RtmpHSWH4g/downloaded_packages’
Warning message:
In install.packages("Compind", dependencies = TRUE) :
installation of package ‘Compind’ had non-zero exit status
> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.3 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3
You should avoid compiling packages yourself if possible. Add the cran2deb4ubuntu 4.0 PPA and then install via apt-get.
That looks like a problem with a system library. The problem will be that Compind doesn't declare any, so it is likely an issue with one of its many dependencies.
I'd try update.packages(ask=FALSE, checkBuilt=TRUE) first, to make sure the dependencies are up to date. If that doesn't fix the problem, you'll probably have to run R under a debugger to get more info. On Linux, I think you can do that with
R -d gdb
as long as you know how gdb works.

R Bioconductor package error on Linux (GenomicFeatures)

I want to use the function "makeTxDbfromGFF", which is part of the GenomicFeatures package. This function used to work perfectly until now, I get the following output:
makeTxDbFromGFF("/file/to/gencode.v19.annotation.gtf", dataSource="Gencode", organism="Homo sapiens", format="gtf")
>Import genomic features from the file as a GRanges object ... OK
>Prepare the 'metadata' data frame ... OK
>Make the TxDb object ... Error in c(x, value) :
could not find symbol "recursive" in environment of the generic function
This function works on my Mac, but not on my Linux workstation. Here some details to my session:
R version 3.3.3 (2017-03-06)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.1 LTS
I already uninstalled the new version 1.26.3 and installed the previous version (1.24.5), but I get the same error. On my Mac I use the version 1.26.2.
My research so far was not very successful. I just found out it might be due to some inconsistency with other software/packages(?).

Error downloading previous package version in RStudio even though manual download works

I am trying to follow the instructions from RStudio to install an older version of ggplot2 with devtools::install_version. However, I am getting the following error:
> devtools::install_version("ggplot2", version = "2.1.0", repos = "https://cran.r-project.org")
Downloading package from url: https://cran.r-project.org/src/contrib/Archive/ggplot2/ggplot2_2.1.0.tar.gz
/usr/bin/tar: Cannot execute remote shell: No such file or directory
/usr/bin/tar: C\:\\Users\\..\RtmpmqySfr\\file75c16051e90.tar.gz: Cannot open: I/O error
/usr/bin/tar: Error is not recoverable: exiting now
Error: Does not appear to be an R package (no DESCRIPTION)
My R version:
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
My RStudio version:
0.99.902
My devtools version:
devtools_1.12.0
I seem to be able to download the compressed package files directly by going to the URL found by devtools.
Why am I getting this error and how do I fix it?

Can't load package xlsx after upgrading to Sierra

I recently updated to Sierra and it seems like I can't load packages that depends on rJava anymore.
For example:
library(xlsx)
Gives:
Loading required package: rJava
Loading required package: xlsxjars
JavaVM: requested Java version ((null)) not available. Using Java at "" instead.
JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
JavaVM FATAL: Failed to load the jvm library.
Error : .onLoad failed in loadNamespace() for 'xlsx', details:
call: .jinit()
error: JNI_GetCreatedJavaVMs returned -1
Error: package or namespace load failed for ‘xlsx’
Here is my sessions info:
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Sierra 10.12
And Java is updated to the latest version (8.111).
As far as I can understand from some similar posts the java directories is not configured correctly.
You can solve this with terminal commands that fix the wrongly configured directories and there are multiple posts that use this strategy. But this can be rather confusing.
A much easier strategy that worked for me is to use homebrew to install java. After installing Homebrew you can install java with the following commands
brew update
brew cask install java

Problems installing Slidify in RStudio

I am new to R-programming and I am trying to install Slidify and I am currently having a problem. I am running on the below version of RStudio:
R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
I am using the below code to install Slidify:
install_github("slidify", "ramnathv")
install_github("slidifyLibraries", "ramnathv")*
I get the following error:
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
Error: Command failed (1)
In addition: Warning message:
Username parameter is deprecated. Please use ramnathv/slidifyLibraries
I have also tried the below code to install Slidify:
pkgs <- c('ramnathv/slidifyLibraries', 'ramnathv/slidify')
devtools::install_github(pkgs)*
and I get the following error:
Error: Command failed (1)
Does anyone have experience installing Slidify?
1) install_github() function is in devtools package, so first you have to install this package using install.packages("devtools").
2) Then load the library using
library(devtools)
3) Now use your code
install_github("slidify", "ramnathv")
install_github("slidifyLibraries", "ramnathv")
It will work properly.

Resources