0

如果我在 Maven 中使用以下依赖项运行 Renjin,我会在 Java 中得到 NullPointerException:

 <dependencyManagement>
<dependencies>
  <dependency>
    <groupId>org.renjin</groupId>
    <artifactId>renjin-script-engine</artifactId>
    <version>0.9.2725</version>
  </dependency>
  <dependency>
    <groupId>org.renjin.cran</groupId>
    <artifactId>e1071</artifactId>
    <version>1.7-0-b8</version>
  </dependency>
  <dependency>
    <groupId>org.renjin.cran</groupId>
    <artifactId>ranger</artifactId>
    <version>0.11.2-b1</version>
  </dependency>
</dependencies>

我在 Java 中得到的异常是:

 org.renjin.eval.EvalException: java.lang.NullPointerException

at org.renjin.eval.Context.evaluateCall(Context.java:416)
at org.renjin.eval.Context.evaluate(Context.java:282)
at org.renjin.eval.Context.evaluate(Context.java:264)
at org.renjin.eval.Context.evaluateExpressionVector(Context.java:390)
at org.renjin.eval.Context.evaluate(Context.java:280)
at org.renjin.eval.Context.evaluate(Context.java:264)
at org.renjin.script.RenjinScriptEngine.eval(RenjinScriptEngine.java:168)
at org.renjin.script.RenjinScriptEngine.eval(RenjinScriptEngine.java:127)
at de.bayern.statistik.zensus2021.hhgen.worker.modul5.common.renjin.example.RenjinQuickStartTest.renjinTestModellTest(RenjinQuickStartTest.java:332)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
Caused by: java.lang.NullPointerException
at org.renjin.primitives.Conditions.signalCondition(Conditions.java:210)
at org.renjin.eval.EvalException.initContext(EvalException.java:66)
at org.renjin.eval.ClosureDispatcher.apply(ClosureDispatcher.java:85)
at org.renjin.eval.ClosureDispatcher.applyClosure(ClosureDispatcher.java:50)
at org.renjin.sexp.Closure.apply(Closure.java:83)
at org.renjin.eval.Context.evaluateCall(Context.java:407)
... 33 more

我已经在 R 版本 4.0.2 中测试了我的代码,它确实有效!

请你帮帮我。

感谢您的支持!

此致,

比那尔塔斯

4

1 回答 1

0

使用最新版本的 Renjin(版本 0.9.276)和 Maven 依赖项:

<groupId>org.renjin</groupId>
<artifactId>renjin-script-engine</artifactId>
<version>3.5-beta76</version>

我在 Java 中得到以下异常:

org.renjin.eval.EvalException: cannot read workspace version 3 written by R 3.5.0; need R 3.5.0 or newer

所以我的问题是:仁进的新版本什么时候出来?

感谢您的支持!

此致,

皮纳尔

于 2020-11-13T12:36:15.600 回答