rjava

Run Rscript from Spring MVC with Wildfly 9

旧时模样 提交于 2019-12-11 12:57:12
问题 I am trying to run Rscript from JAVA code. I am able to do so. Now I am trying to run same JAVA code from a Spring MVC project and using Wildfly 9 to run the project. For the first time when I am trying to execute JAVA code (to run Rscript) is working fine and giving correct result, but on running 2nd time it is giving error and Wildfly stops running. Below is the error that I am getting: A fatal error has been detected by the Java Runtime Environment: Internal Error (0xc0000029), pid=6768,

rJava fails while invoking RJDBC library from OpenCPU API

冷暖自知 提交于 2019-12-11 12:26:44
问题 Goal : To use RJDBC with OpenCPU AJAX Post call. Use case : I need to connect with Apache phoenix database and get some data. And on that data I am supposed to do analytics. So to connect with Phoenix i am using rjdbc(phoenix doesn't support any other option to connect). Environment : public.opencpu.org Here is what I am trying: html <textarea> library(RJDBC) .. do some data fetching and then r statistics </textarea> <br /> <button id="submitbutton" >Execute</button> <br /> <br /> <div id=

compile rJava on mac for Java 1.7

只谈情不闲聊 提交于 2019-12-11 09:55:41
问题 Mac OS 10.8.4, R 3.1.0, rJava 0.9.6, RStudio 0.98 I would like to compile rJava from source so that it can run Java 1.7, ideally from within RStudio. Have read a number of websites giving advice about reconfiguring R for 1.7 and setting compiler flags (how to get rJava 0.9-3 to work on OS X 10.7.4 with Oracle Java 1.7?), but when I try install.packages("rJava",type='source'), I continue to run into: ... checking JNI data types... configure: error: One or more JNI types differ from the

Problems with JRI

与世无争的帅哥 提交于 2019-12-11 08:15:17
问题 I am trying to run an example of JRI and being unsuccessful, here is a link to the example. http://blog.comsysto.com/2013/07/10/java-r-integration-with-jri-for-on-demand-predictions/ import org.rosuda.JRI.Rengine; import org.rosuda.JRI.REXP; public class HelloRWorld { Rengine rengine; // initialized in constructor or autowired public void helloRWorld() { rengine.eval(String.format("greeting <- '%s'", "Hello R World")); REXP result = rengine.eval("greeting"); System.out.println("Greeting from

How I can load add-on R libraries into JRI and execute from Java?

此生再无相见时 提交于 2019-12-11 07:25:40
问题 I am working with a Java and I need to use an add-on R library and use the functions within that library. I tried the answers provided in the following questions How I can load a R script into JRI and execute from Java? Problem loading R own created libraries in Java/JRI code but I still get a NullPointerException. Can anyone point out the error. Thankyou Here is the code which I am using: import org.rosuda.JRI.REXP; import org.rosuda.JRI.RVector; import org.rosuda.JRI.Rengine; public class

rJava doesn't load in R 3.4.2 and MacOS Sierra 10.12.6

孤人 提交于 2019-12-11 05:59:46
问题 Here's the error I get: > library(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 '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so': dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: @rpath/libjvm.dylib Referenced from: /Library/Frameworks/R

Setup R and Java application on OSX 10.7.2

半腔热情 提交于 2019-12-11 05:27:38
问题 We've been running an application on windows where we use R and Java and I'm trying to migrate over to a Unix system. I've searched through the forums and Google and can't find anything that is clear on the environment variable setup. The application uses Java, Tomcat, and R. (On windows we usually install JGR so R can run in java, but it seems on MAC rJava is the way to get this working) So I've got java version "1.6.0_29", R version 2.14.1, rJava 0.9-3, and tomcat 7.0.20 installed. I need

rJava class not found exception

为君一笑 提交于 2019-12-11 05:09:31
问题 I'm just trying to get a simple example of accessing a custom java class from within R using rJava. HelloWorld.java class HelloWorld { public static void main(String[] args){ System.out.println("Hello World!"); } } compiled .java to .class as such: javac HelloWorld.java R code (ran from same directory as HelloWorld.java and HelloWorld.class. library(rJava) > .jinit() [1] 0 > .jnew("HelloWorld") Error in .jnew("HelloWorld") : java.lang.ClassNotFoundException Thank you for any pointers. 回答1:

how to pass a rJava .jnew call multiple parameters?

淺唱寂寞╮ 提交于 2019-12-11 02:28:16
问题 the documentation describes how to pass a single parameter. No worries there. My challenge is trying to pass multiple parameters to java constructors that take them. For example: foo <- .jnew("some/java/class/that/takes/two/parameters", ???) Comma delimiting doesn't work, nor does putting a space between them. How does one do this? 回答1: This document explains how to work with different constructors. See section " looking up constructors and methods ". Apparently you have to call the new()

REngine does not invoke R Console

天涯浪子 提交于 2019-12-10 23:24:55
问题 Collected the code from one of the site, it does not invoke R Console from REngine. It breaks after creating REngine and does not go to try and catch. problem: Rengine re=new Rengine(args, true, new TextConsole2()); System.out.println("Rengine created, waiting for R"); Sample code (rtest2.java) - rJava/examples import java.io.*; import java.awt.*; import javax.swing.*; import org.rosuda.JRI.Rengine; import org.rosuda.JRI.REXP; import org.rosuda.JRI.RMainLoopCallbacks; import org.rosuda.JRI