Han Hui Wen  created ZEPPELIN-5508:
--------------------------------------

             Summary: Zepplin 0.10 can not run java program in windows 10
                 Key: ZEPPELIN-5508
                 URL: https://issues.apache.org/jira/browse/ZEPPELIN-5508
             Project: Zeppelin
          Issue Type: Bug
          Components: shell
    Affects Versions: 0.10.0
            Reporter: Han Hui Wen 


{noformat}
 {noformat}
Run following script :
{noformat}
%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));    }}{noformat}
Get following error message:
{noformat}
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{noformat}
 After investigation ,found that the  interpreter.cmd file has bugs.

 

line 135 in interpreter.cmd
{noformat}
"%ZEPPELIN_RUNNER%" !JAVA_INTP_OPTS! %ZEPPELIN_INTP_MEM% -cp 
'%ZEPPELIN_CLASSPATH_OVERRIDES%;%CLASSPATH%' %ZEPPELIN_SERVER% 
"%CALLBACK_HOST%" %PORT%{noformat}
 Compared with interpreter.sh,Several command line arguments are missing。

line 313 in interpreter.sh
{noformat}
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}"){noformat}
atfer added following in  interpreter.cmd:
{noformat}
if /I "%~1"=="-i" set INTP_GROUP_ID=%~2
if /I "%~1"=="-r" set INTP_PORT=%~2{noformat}
 and change 
{noformat}
"%ZEPPELIN_RUNNER%" !JAVA_INTP_OPTS! %ZEPPELIN_INTP_MEM% -cp 
'%ZEPPELIN_CLASSPATH_OVERRIDES%;%CLASSPATH%' %ZEPPELIN_SERVER% 
"%CALLBACK_HOST%" %PORT% %INTP_GROUP_ID% %INTP_PORT%{noformat}
 

The java interpreter work fine after the fixing.

 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to