Uploaded image for project: 'Zeppelin'
  1. Zeppelin
  2. ZEPPELIN-5508

Zepplin 0.10 can not run java program in windows 10

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.10.0
    • Fix Version/s: None
    • Component/s: shell
    • Labels:
      None

      Description

       

      Run following script :

      %java
      import java.util.HashMap;
      import java.util.Map;
      import org.apache.zeppelin.java.JavaInterpreterUtils;public class HelloWorld {    public static void main(String[] args) {        Map<String, Long> counts = new HashMap<>();
              counts.put("hello",4L);
              counts.put("world",5L);        System.out.println(JavaInterpreterUtils.displayTableFromSimpleMap("Word","Count", counts));    }}

      Get following error message:

      org.apache.zeppelin.interpreter.InterpreterException: java.io.IOException: Interpreter process is not running
      SLF4J: Class path contains multiple SLF4J bindings.
      SLF4J: Found binding in [jar:file:/D:/app/zeppelin-0.10.0-bin-all/interpreter/java/zeppelin-java-0.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: Found binding in [jar:file:/D:/app/zeppelin-0.10.0-bin-all/lib/slf4j-log4j12-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
      SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
      Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
      	at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer.main(RemoteInterpreterServer.java:300)	at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.open(RemoteInterpreter.java:129)
      	at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.getFormType(RemoteInterpreter.java:271)
      	at org.apache.zeppelin.notebook.Paragraph.jobRun(Paragraph.java:440)
      	at org.apache.zeppelin.notebook.Paragraph.jobRun(Paragraph.java:71)
      	at org.apache.zeppelin.scheduler.Job.run(Job.java:172)
      	at org.apache.zeppelin.scheduler.AbstractScheduler.runJob(AbstractScheduler.java:132)
      	at org.apache.zeppelin.scheduler.RemoteScheduler$JobRunner.run(RemoteScheduler.java:182)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: java.io.IOException: Interpreter process is not running
      SLF4J: Class path contains multiple SLF4J bindings.
      SLF4J: Found binding in [jar:file:/D:/app/zeppelin-0.10.0-bin-all/interpreter/java/zeppelin-java-0.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: Found binding in [jar:file:/D:/app/zeppelin-0.10.0-bin-all/lib/slf4j-log4j12-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
      SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
      Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
      	at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer.main(RemoteInterpreterServer.java:300)	at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.internal_create(RemoteInterpreter.java:157)
      	at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.open(RemoteInterpreter.java:126)
      	... 13 more

       After investigation ,found that the  interpreter.cmd file has bugs.

       

      line 135 in interpreter.cmd

      "%ZEPPELIN_RUNNER%" !JAVA_INTP_OPTS! %ZEPPELIN_INTP_MEM% -cp '%ZEPPELIN_CLASSPATH_OVERRIDES%;%CLASSPATH%' %ZEPPELIN_SERVER% "%CALLBACK_HOST%" %PORT%

       Compared with interpreter.sh,Several command line arguments are missing。

      line 313 in interpreter.sh

      INTERPRETER_RUN_COMMAND+=("${ZEPPELIN_RUNNER}" "${JAVA_INTP_OPTS_ARRAY[@]}" "${ZEPPELIN_INTP_MEM_ARRAY[@]}" "-cp" "${ZEPPELIN_INTP_CLASSPATH_OVERRIDES}:${ZEPPELIN_INTP_CLASSPATH}" "${ZEPPELIN_SERVER}" "${CALLBACK_HOST}" "${PORT}" "${INTP_GROUP_ID}" "${INTP_PORT}")

      atfer added following in  interpreter.cmd:

      if /I "%~1"=="-i" set INTP_GROUP_ID=%~2
      if /I "%~1"=="-r" set INTP_PORT=%~2

       and change 

      "%ZEPPELIN_RUNNER%" !JAVA_INTP_OPTS! %ZEPPELIN_INTP_MEM% -cp '%ZEPPELIN_CLASSPATH_OVERRIDES%;%CLASSPATH%' %ZEPPELIN_SERVER% "%CALLBACK_HOST%" %PORT% %INTP_GROUP_ID% %INTP_PORT%

       

      The java interpreter work fine after the fixing.

       

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              huiwenhan Han Hui Wen
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: