Options

"[SOLVED] rapidminer hanging after installing R extension"

AjAj Member Posts: 23 Contributor II
edited June 2019 in Help
Hello,

I have Fedora 17 installed in my computer with
"uname -r" giving me the output
3.3.4-5.fc17.i686

I had compiled and installed R, by creating the creating the shared library, i.e
make distclean
"./configure --enable-R-shlib"
make
make install

After that, I have installed "rJava" package
install.packages("rJava")

I have the following commands in ".bashrc" file
export R_HOME=/usr/local/lib/R
export JAVA_HOME=/usr/local/lib/jdk
export LD_LIBRARY_PATH=/usr/local/lib/R/lib
export PATH=$JAVA_HOME/bin:/usr/local/lib/R/lib:/usr/local/lib/R/bin:$PATH

I checked that they are all working, by typing the following commands

echo $R_HOME
/usr/local/lib/R

echo $JAVA_HOME
/usr/local/lib/jdk

echo $LD_LIBRARY_PATH
/usr/local/lib/R/lib

echo $PATH
/usr/local/lib/jdk/bin:/usr/local/lib/R/lib:/usr/local/lib/R/bin:/usr/lib/qt-3.3/bin:/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/ajay/.local/bin:/home/ajay/bin

java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) Client VM (build 23.3-b01, mixed mode)

Now, I have installed rapidminer-5.2.008 , and then added R extension
Next, on rapidminer pop-up window, I pointed to "libjri.so"
rapidminer.r.native_lib=/usr/local/lib/R/library/rJava/jri/libjri.so

With the above configuration, when I restart rapidminer again, I am getting the following messages. But, rapidminer gets stuck in the loading process where it shows
"Initializing plugin GUI", with the following messages in the command prompt
----------------------------------------------------------------------------------------------------------------------------------------
Sep 28, 2012 10:07:58 PM com.rapidminer.tools.ParameterService init
INFO: Reading configuration resource com/rapidminer/resources/rapidminerrc.
Sep 28, 2012 10:07:59 PM com.rapidminer.tools.I18N <clinit>
INFO: Set locale to en.
Sep 28, 2012 10:07:59 PM com.rapid_i.Launcher ensureRapidMinerHomeSet
INFO: Property rapidminer.home is not set. Guessing.
Sep 28, 2012 10:07:59 PM com.rapid_i.Launcher ensureRapidMinerHomeSet
INFO: Trying parent directory of '/home/ajay/rapidminer/lib/rapidminer.jar'...gotcha!
Sep 28, 2012 10:08:01 PM com.rapidminer.PluginInitR initPlugin
INFO: Trying to load R Library...
Sep 28, 2012 10:08:01 PM org.rosuda.JRI.Rengine <clinit>
INFO: Creating Connection to R...
Sep 28, 2012 10:08:01 PM org.rosuda.JRI.Rengine loadLibrary
INFO: Trying to loaded R library from /usr/local/lib/R/library/rJava/jri/libjri.so
Sep 28, 2012 10:08:01 PM org.rosuda.JRI.Rengine loadLibrary
INFO: Engine ID: class org.rosuda.JRI.Rengine ClassLoader:PluginClassLoader ([file:/home/ajay/.RapidMiner5/managed/rmx_r-5.2.0.jar])
Sep 28, 2012 10:08:01 PM org.rosuda.JRI.Rengine loadLibrary
INFO: Successfully loaded R library from /usr/local/lib/R/library/rJava/jri/libjri.so(true)
Sep 28, 2012 10:08:12 PM com.rapidminer.parameter.ParameterTypePassword decryptPassword
WARNING: Password in XML file looks like unencrypted plain text.
Sep 28, 2012 10:08:17 PM com.rapidminer.tools.jdbc.JDBCProperties <init>
WARNING: Missing database driver class name for ODBC Bridge (e.g. Access)
Sep 28, 2012 10:08:17 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver ca.ingres.jdbc.IngresDriver not found. Probably the driver is not installed.
Sep 28, 2012 10:08:17 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver oracle.jdbc.driver.OracleDriver not found. Probably the driver is not installed.
ARGUMENT 'LANGUAGE=en' __ignored__
----------------------------------------------------------------------------------------------------------------------------------------

Just to see whether there would be any difference by inputting different dynamic library file , I changed the dynamic library to "libR.so" by changing the file "./.RapidMiner5/5_2_008_rapidminerrc.Linux"
rapidminer.r.native_lib=/usr/local/lib/R/lib/libR.so
With the above change, rapidminer loads, but R extension is not loaded, and I am getting the following messages in command prompt
----------------------------------------------------------------------------------------------------------------------------------------
Sep 28, 2012 10:15:12 PM com.rapidminer.tools.ParameterService init
INFO: Reading configuration resource com/rapidminer/resources/rapidminerrc.
Sep 28, 2012 10:15:12 PM com.rapidminer.tools.I18N <clinit>
INFO: Set locale to en.
Sep 28, 2012 10:15:12 PM com.rapid_i.Launcher ensureRapidMinerHomeSet
INFO: Property rapidminer.home is not set. Guessing.
Sep 28, 2012 10:15:12 PM com.rapid_i.Launcher ensureRapidMinerHomeSet
INFO: Trying parent directory of '/home/ajay/rapidminer/lib/rapidminer.jar'...gotcha!
Sep 28, 2012 10:15:14 PM com.rapidminer.PluginInitR initPlugin
INFO: Trying to load R Library...
Sep 28, 2012 10:15:14 PM org.rosuda.JRI.Rengine <clinit>
INFO: Creating Connection to R...
Sep 28, 2012 10:15:14 PM org.rosuda.JRI.Rengine loadLibrary
INFO: Trying to loaded R library from /usr/local/lib/R/lib/libR.so
Sep 28, 2012 10:15:14 PM org.rosuda.JRI.Rengine loadLibrary
INFO: Engine ID: class org.rosuda.JRI.Rengine ClassLoader:PluginClassLoader ([file:/home/ajay/.RapidMiner5/managed/rmx_r-5.2.0.jar])
Sep 28, 2012 10:15:14 PM org.rosuda.JRI.Rengine loadLibrary
INFO: Successfully loaded R library from /usr/local/lib/R/lib/libR.so(true)
Sep 28, 2012 10:15:23 PM com.rapidminer.parameter.ParameterTypePassword decryptPassword
WARNING: Password in XML file looks like unencrypted plain text.
Sep 28, 2012 10:15:29 PM com.rapidminer.tools.jdbc.JDBCProperties <init>
WARNING: Missing database driver class name for ODBC Bridge (e.g. Access)
Sep 28, 2012 10:15:29 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver ca.ingres.jdbc.IngresDriver not found. Probably the driver is not installed.
Sep 28, 2012 10:15:29 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver oracle.jdbc.driver.OracleDriver not found. Probably the driver is not installed.
Exception in thread "R-Deamon" Sep 28, 2012 10:15:35 PM com.rapidminer.tools.r.JRIRSession initializeEngine
SEVERE: Could not initialize R via JRI. Reason: Unable to initialize R
Sep 28, 2012 10:15:35 PM com.rapidminer.gui.r.RConsole <init>
SEVERE: Could not acquire connection to R: Could not initiate session with native R. Try using server. Reason: Could not initialize R via JRI. Reason: Unable to initialize R
java.lang.UnsatisfiedLinkError: org.rosuda.JRI.Rengine.rniSetupR([Ljava/lang/String;)I
at org.rosuda.JRI.Rengine.rniSetupR(Native Method)
at org.rosuda.JRI.Rengine.setupR(Rengine.java:313)
at org.rosuda.JRI.Rengine.run(Rengine.java:1092)
Sep 28, 2012 10:15:35 PM com.rapidminer.PluginInitR initGui
SEVERE: Could not acquire connection to R. Could not load Console.
----------------------------------------------------------------------------------------------------------------------------------------
I have also tried 5.1 version, and I am getting same errors.

Please help me install R extension with rapidminer as I have spent many hours solving this problems, and have no concrete ideas of how to solve this problem.

Thanks a lot,
Ajay

Answers

  • Options
    AjAj Member Posts: 23 Contributor II
    Hello,

    I have tried many combinations and I was thinking that my environment variables were not set correctly etc.

    I was finally able to figure out the solution based on the following three posts

    http://rapid-i.com/rapidforum/index.php/topic,4113.0.html
    http://rapid-i.com/rapidforum/index.php/topic,4138.msg18630.html#msg18630
    http://r.789695.n4.nabble.com/Where-is-the-tcltk-package-td3434915.html

    It basically boils down to installing compiling R such that it has "tcltk" capabilities. I should have been able to guess that something was wrong when I was installing "rJava" (install.packages("rJava"). Instead of a graphical pop-up coming up to allow me to select the server from where I should download the "rJava" package, I was being presented a text menu, where I had to enter the number of the server from a numeric list. This happened because of me installing a Fedora version.

    Following are the details

    1) check for installation of tcl, tk, tcl-devel, tk-devel (I am referring to RPM type distros. For debian etc, as mentioned in the posts it is tcl8.5-dev etc or so)
    rpm -q tk
    rpm -q tcl

    The above should have been installed and they are installed by default by Linux distributions. If they are not, install them with
    yum install tcl
    yum install tk

    Installing just the user version of tcl and tk, like the above, is not enough, one has to install tcl-devel and tk-devel also for the whole thing to work
    yum install tcl-devel
    yum install tk-devel

    2) After downloading R, install it with the following options
    make uninstall (if you already have a compiled and installed version of R)
    make distclean
    ./configure --with-tcltk --enable-R-shlib

    (Why "--enable-R-shlib", please read
    http://rpy.sourceforge.net/rpy_faq.html
    and also
    http://rapid-i.com/rapidforum/index.php/topic,3603.msg13519.html#msg13519

    3) Set the necessary variables. Mine are set as follows in ".bashrc" of root as well as in my own user profile
    export JAVA_HOME=/etc/alternatives/java_sdk (wherever your Java SDK installation is)

    export R_HOME=/usr/local/lib/R (This is where R installation has been done)

    export LD_LIBRARY_PATH=/usr/local/lib/R/lib (This is not mentioned in pop-up help menu of rapidminer as most of the users are probably using Windows)

    export PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/bin:/usr/local/bin:$R_HOME/bin:$R_HOME/lib:$PATH
    (May be /jre/bin is not need, but I included it. Also may be /usr/local/bin is not needed, but I included it as a copy of "R" and "RScript" were there, although they were there in $R_HOME/bin also.

    4) Start Rapidminer, and when it asks for jri library, point it to "$R_HOME//library/rJava/jri/libjri.so" . If rapidminer is not allowing to change it because you have already selected something else earlier, edit
    "rapidminer.r.native_lib" to the above value, replacing $R_HOME with your system specific path. This is to be done in the file
    ".RapidMiner5/5_2_008_rapidminerrc.Linux" (.RapidMiner5 directory will be in your home directory)

    5) Rapidminer started at this point, and again as earlier. It got hung at "Initializing plugin GUI". But, this time it prompted me to select the server (earlier because of not having "tcltk", it did not have a way to allow me to select the server). I choose a server to install, and following message was mentioned in the console
    "installing to /home/ajay/.RapidMiner5/rLibPath/JavaGD/libs"
    Therefore, if someone cannot get tcl/tk working, may be they can install JavaGD or something like that, which I am not sure.

    I wrote a simple R script in rapidminer and it worked fine.

    I had spent more a week trying to figure out what is wrong !!!

    Developers please include the necessary changes in your next release to check for the packages that I have mentioned above, so that a future users of rapidminer do not have to go through what I have been through.

    Thanks for providing rapidminer,
    Ajay

Sign In or Register to comment.