CDK-R / cdkr

Integrating R and the CDK
https://cdk-r.github.io/cdkr/
42 stars 27 forks source link

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 #44

Closed OnlyBelter closed 6 years ago

OnlyBelter commented 7 years ago

Hi, I am using Python to invoke R package by rpy2. Actually this is a django project, I can use cdkr correctly only the first time, when I refresh the website, I get these error message everytime:

Error in .jcall(cn, "Ljava/lang/Object;", "get", as.integer(i - 1)) : 
  java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

I am not good at R, so I would like to know, what kind of situation may cause the size equal to zero?, in cdkr package source code, line 68. Thanks!

rajarshi commented 7 years ago

That is weird, but unfortunately I have no idea how Rpy is instantiating an R session and how that might be affecting the R/Java interface.

When you refresh the website does it start a new R session? In that case it would mean the references to Java objects would be lost. But Im just guessing