Execute R script not working in PDI 5.1 CE

425 views
Skip to first unread message

Sumit Bansal

unread,
May 4, 2015, 5:14:19 AM5/4/15
to pentaho-...@googlegroups.com
Hi Group,

I am using PDI 5.1.0 CE and installed the Execute R script plugin from market place .it was successfully installed and i can see execute R Script step under scripting folder.when i am drawing the step then i m getting this error:

org.pentaho.di.core.exception.KettlePluginException:
Unexpected error loading class:
de/dekarlab/pentahor/plugin/PRCalcMeta : Unsupported major.minor version 51.0

at org.pentaho.di.core.plugins.PluginRegistry.loadClass(PluginRegistry.java:484)
at org.pentaho.di.core.plugins.PluginRegistry.loadClass(PluginRegistry.java:336)
at org.pentaho.di.ui.spoon.Spoon.newStep(Spoon.java:6470)
at org.pentaho.di.ui.spoon.trans.TransGraph$5.drop(TransGraph.java:612)
at org.eclipse.swt.dnd.DNDListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.notifyListeners(Unknown Source)
at org.eclipse.swt.dnd.DropTarget.Drop(Unknown Source)
at org.eclipse.swt.dnd.DropTarget$3.method6(Unknown Source)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(Unknown Source)
at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method)
at org.eclipse.swt.dnd.DragSource.drag(Unknown Source)
at org.eclipse.swt.dnd.DragSource.access$000(Unknown Source)
at org.eclipse.swt.dnd.DragSource$1.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1297)
at org.pentaho.di.ui.spoon.Spoon.waitForDispose(Spoon.java:7801)
at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:9130)
at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:638)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.pentaho.commons.launcher.Launcher.main(Launcher.java:151)
Caused by: java.lang.UnsupportedClassVersionError: de/dekarlab/pentahor/plugin/PRCalcMeta : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at org.pentaho.di.core.plugins.KettleURLClassLoader.loadClassFromThisLoader(KettleURLClassLoader.java:76)
at org.pentaho.di.core.plugins.KettleURLClassLoader.loadClass(KettleURLClassLoader.java:99)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.pentaho.di.core.plugins.PluginRegistry.loadClass(PluginRegistry.java:466)
... 29 more

Also i have added the following variable:

R_HOME:C:\Program Files\R\R-3.1.3
R_LIBS_USER :C:\Program Files\R\R-3.1.3\library
Path :C:\Program Files\R\R-3.1.3\bin\i386


can any one tell me how i can use Execute R script with PDI 5.1.0.

Regards
Sumit

Dan

unread,
May 4, 2015, 5:18:24 AM5/4/15
to pentaho-...@googlegroups.com

I tried this a few months ago and also found it didn't work.

The ee step works fine though but I guess that doesn't help!

Presumably the step did work when it came out years ago so I guess something changed in pdi?

Sent from my phone

--
You received this message because you are subscribed to the Google Groups "Pentaho Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pentaho-commun...@googlegroups.com.
To post to this group, send email to pentaho-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pentaho-community/531323e5-44ab-4dfb-b1f1-e0efe484b9f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sumit Bansal

unread,
May 4, 2015, 5:22:33 AM5/4/15
to pentaho-...@googlegroups.com
Hi Dan,

Thanks a lot for your quick response.Is there any other alternative to integrate 'R' with PDI 5.x CE

Thanks & Regards
Sumit Bansal
BI Developer

--
You received this message because you are subscribed to a topic in the Google Groups "Pentaho Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pentaho-community/ovjADZ0A3Jk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pentaho-commun...@googlegroups.com.

To post to this group, send email to pentaho-...@googlegroups.com.

Pedro Alves

unread,
May 4, 2015, 5:38:16 AM5/4/15
to pentaho-...@googlegroups.com
That error says you need java 7 for that step. It's a community step, you could get in touch with the author / contribute a fix

Sumit Bansal

unread,
May 4, 2015, 5:41:16 AM5/4/15
to pentaho-...@googlegroups.com
Ok Pedro..thanks for the suggestion .

Thanks & Regards
Sumit Bansal
BI Developer

Kleyson Rios

unread,
May 4, 2015, 8:48:53 AM5/4/15
to pentaho-...@googlegroups.com
Some time ago I had to develop a project that was needed to integrate with R.

I didn't create a kettle plugin, but I developed an UDJS to address the needs.

I didn't test the plugin available on Marketplace, but it is using the same resources that I used (JRI library).

I've written a documentation to make my 'plugin' work, maybe it can help.

1. Check if the operating system is 32bit or 64bit.
2. Make sure the java installed is 32bit or 64bit, compatible with the system.
3. Make sure that the environment variables JAVA_HOME and PENTAHO_JAVA_HOME correctly point to the java directory.
4. Go at r-project site, download the package and perform the installation according to the operating system (32bit or 64bit).
5. Execute R console and install the package rJava.
    > Install.packages ("rJava")
6. Check that the R is using the correct version of java (x86 or x64) according to the operating system.
    > Sys.getenv ("JAVA_HOME")
7. Setar correctly the environment variables below
    R_HOME = C: \ Program Files \ R \ R-3.0.1
    R_INCLUDE_DIR =% R_HOME% \ include \
    R_SHARE_DIR =% R_HOME% \ share \
    R_DOC_DIR =% R_HOME% \ doc \



Windows Configuration

⇒ If the environment is x86 (32-bit)

    
Include in the Path:%R_HOME%\bin\i386;%R_HOME%\library\rJava\jury\i386

    
To use the Kettle:
        
Copy jri.dll (64bit) and jri.jar to KETTLE_HOME\libswt\win32

⇒ If the environment is x64 (64-bit)

    
Include in the Path:%R_HOME%\bin\x64;%R_HOME%\library\rJava\jury\x64

    
To use the Kettle:
        
Copy jri.dll
and jri.jar to KETTLE_HOME\libswt\win64
        
Edit pan.bat / kitchen.bat and change "-Djava.library.path =% KETTLE_DIR% \ package libswt \ win32" to "-Djava.library.path =% KETTLE_DIR% \ package libswt \ win64"

⇒ Steps for both (x32 or x64)

    
Copy jri.jar to KETTLE_HOME\libext

    
To use in the Pentaho Server
        
Copy jri.jar to PENTAHO_HOME\biserver-ce\tomcat\webapps\pentaho\WEB-INF\lib\




But, there is an important drawback using JRI. It's not multithread, I mean, if you execute two or more times the step
simultaneously the execution of the codes may get mixed and you get unexpected results.

In my case to fix the problem, I had to use a new approach, that was using R-Server. Then your r-step become a client of the R Server, so now, we can have as many as
simultaneously execution without any problem.

Best Regards.



Dan

unread,
May 10, 2015, 1:56:56 PM5/10/15
to pentaho-...@googlegroups.com
Fantastic Kleyson that's really interesting.  It's a pretty amazing thing in our community that you can always get a technology to work with PDI even if it doesn't appear to be supported!

I also came across this yesterday, Caio (community god) has got a plugin on github:


Enjoy!
Dan

--
You received this message because you are subscribed to the Google Groups "Pentaho Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pentaho-commun...@googlegroups.com.
To post to this group, send email to pentaho-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages