Hi all, Recently I am trying to write my own interpreter for scala, using Zeppelin-0.6.0-snapshot built from source code.
I followed the instructions in https://zeppelin.apache.org/docs/0.6.0-SNAPSHOT/development/writingzeppelininterpreter.html, but I failed to make my interpreter work. So then I tried to write a much simpler interpreter (doing nothing but print messages only in each overriding methods) and I still failed to make the interpreter work. I got confused and didn't know* if I missed some important steps :( . *Any help will be appreciated. Here are the steps how I wrote my interpreter: 1. Write a java file named SimpleInterpreter.java, design a class named SimpleInterpreter and the class extends Interpreter provided by Zeppelin. Then I implement the constructor and 8 methods: open(), close(), interpreter(), cancel(), getProgress(), getFormType(), getScheduler(), completion(). 2. Compile the project using sbt. I think it's OK to compile the code using sbt instead of mvn. The important thing is to get the jar anyway. Here the SimpleInterpreter doesn't have other dependencies except Zeppelin Interpreter. 3. Make a directory named simple in [Zeppelin-Home]/interpreter/, copy the jar generated by sbt to the new directory. The jar contains SimpleInterpreter.class only. And no other jars need to be copied. 4. Create a new file named interpreter-setting.json in the new directory and write three key-value pairs: "group": "org", "name": "simple", "className": "simple.SimpleInterpreter" (Here I have a question that why "org" instead of "simple" is shown in the option box of "Interpreter group" when I create my interpreter in web UI.) 5. add "simple.SimpleInterpreter" in the value of "zeppelin.interpreters" in zeppelin-site.xml under [Zeppelin-Home]/conf. I attach related files mentioned above in this email. But then after I restart the zeppelin daemon and try to run any scripts using my interpreter, I get no results except a small Error. And if I look into the log file, I get the some exceptions and it seems failed to find my interpreter. Details can be seen in the attachments. Sorry to make a long email. And hope anyone could offer me some help. Bests, ZHAO Yunjian Research Assistant, The Chinese University of Hong Kong ᐧ
INFO [2016-06-27 12:56:24,819] ({qtp3447021-19}
Note.java[putDefaultReplName]:121) - defaultInterpreterName is 'simple'
INFO [2016-06-27 12:56:25,058] ({qtp3447021-19}
NotebookServer.java[sendNote]:475) - New operation from 137.189.90.142 : 46785
: anonymous : GET_NOTE : 2BQEW7ERV
INFO [2016-06-27 12:56:27,020] ({qtp3447021-18}
NotebookServer.java[sendNote]:475) - New operation from 137.189.90.142 : 46785
: anonymous : GET_NOTE : 2BNG74XJA
INFO [2016-06-27 12:56:35,165] ({qtp3447021-19}
InterpreterFactory.java[createInterpretersForNote]:574) - Create interpreter
instance simple for note 2BNG74XJA
ERROR [2016-06-27 12:56:35,167] ({qtp3447021-19}
NotebookServer.java[runParagraph]:1088) - Exception from run
java.lang.NullPointerException
at
org.apache.zeppelin.interpreter.InterpreterFactory.updatePropertiesFromRegisteredInterpreter(InterpreterFactory.java:908)
at
org.apache.zeppelin.interpreter.InterpreterFactory.createRemoteRepl(InterpreterFactory.java:893)
at
org.apache.zeppelin.interpreter.InterpreterFactory.createInterpretersForNote(InterpreterFactory.java:585)
at
org.apache.zeppelin.notebook.NoteInterpreterLoader.createOrGetInterpreterList(NoteInterpreterLoader.java:96)
at
org.apache.zeppelin.notebook.NoteInterpreterLoader.get(NoteInterpreterLoader.java:165)
at org.apache.zeppelin.notebook.Note.run(Note.java:450)
at
org.apache.zeppelin.socket.NotebookServer.runParagraph(NotebookServer.java:1086)
at
org.apache.zeppelin.socket.NotebookServer.onMessage(NotebookServer.java:182)
at
org.apache.zeppelin.socket.NotebookSocket.onWebSocketText(NotebookSocket.java:56)
at
org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextMessage(JettyListenerEventDriver.java:128)
at
org.eclipse.jetty.websocket.common.message.SimpleTextMessage.messageComplete(SimpleTextMessage.java:69)
at
org.eclipse.jetty.websocket.common.events.AbstractEventDriver.appendMessage(AbstractEventDriver.java:65)
at
org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextFrame(JettyListenerEventDriver.java:122)
at
org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:161)
at
org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:309)
at
org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:214)
at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:220)
at org.eclipse.jetty.websocket.common.Parser.parse(Parser.java:258)
at
org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:632)
at
org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:480)
at
org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)
ERROR [2016-06-27 12:56:35,171] ({qtp3447021-19}
NotebookServer.java[afterStatusChange]:1188) - Error
java.lang.NullPointerException
at
org.apache.zeppelin.interpreter.InterpreterFactory.updatePropertiesFromRegisteredInterpreter(InterpreterFactory.java:908)
at
org.apache.zeppelin.interpreter.InterpreterFactory.createRemoteRepl(InterpreterFactory.java:893)
at
org.apache.zeppelin.interpreter.InterpreterFactory.createInterpretersForNote(InterpreterFactory.java:585)
at
org.apache.zeppelin.notebook.NoteInterpreterLoader.createOrGetInterpreterList(NoteInterpreterLoader.java:96)
at
org.apache.zeppelin.notebook.NoteInterpreterLoader.get(NoteInterpreterLoader.java:165)
at org.apache.zeppelin.notebook.Note.run(Note.java:450)
at
org.apache.zeppelin.socket.NotebookServer.runParagraph(NotebookServer.java:1086)
at
org.apache.zeppelin.socket.NotebookServer.onMessage(NotebookServer.java:182)
at
org.apache.zeppelin.socket.NotebookSocket.onWebSocketText(NotebookSocket.java:56)
at
org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextMessage(JettyListenerEventDriver.java:128)
at
org.eclipse.jetty.websocket.common.message.SimpleTextMessage.messageComplete(SimpleTextMessage.java:69)
at
org.eclipse.jetty.websocket.common.events.AbstractEventDriver.appendMessage(AbstractEventDriver.java:65)
at
org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextFrame(JettyListenerEventDriver.java:122)
at
org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:161)
at
org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:309)
at
org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:214)
at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:220)
at org.eclipse.jetty.websocket.common.Parser.parse(Parser.java:258)
at
org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:632)
at
org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:480)
at
org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)
INFO [2016-06-27 12:56:35,207] ({qtp3447021-19}
NotebookServer.java[afterStatusChange]:1193) - Job 20160627-115957_41516124 is
finished
INFO [2016-06-27 12:59:39,707] ({Thread-13}
AbstractValidatingSessionManager.java[validateSessions]:271) - Validating all
active sessions...
INFO [2016-06-27 12:59:39,707] ({Thread-13}
AbstractValidatingSessionManager.java[validateSessions]:304) - Finished session
validation. No sessions were stopped
interpreter-setting.json
Description: application/json
