Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.9.0
-
None
-
None
-
0.9.0
Description
Zeppelin open safety certification, the execution ZSession.createFromExistingSession(clientConfig, interpreter, sessionId) method, return an error message'Unable to call rest api, status: 405, statusText: Method Not Allowed, message: Method Not Allowed‘
The cause of the problem:
ZSession createFromExistingSession direct call zeppelinClient.getSession(this.getSessionId()) method, not for safety certification
*Modify*
The new method:
public static ZSession createFromExistingSession(ZeppelinClient zeppelinClient, String interpreter, String sessionId) throws Exception { return createFromExistingSession(zeppelinClient, interpreter, sessionId, (MessageHandler)null); } public static ZSession createFromExistingSession(ZeppelinClient zeppelinClient, String interpreter, String sessionId, MessageHandler messageHandler) throws Exception { ZSession session = new ZSession(zeppelinClient, interpreter, sessionId); session.reconnect(messageHandler); return session; } private ZSession(ZeppelinClient zeppelinClient, String interpreter, String sessionId) throws Exception { this.zeppelinClient = zeppelinClient; this.interpreter = interpreter; this.sessionInfo = new SessionInfo(sessionId); }
*Call*
1.enable security authentication
// ZeppelinClient zeppelinClient = new ZeppelinClient(clientConfig); zeppelinClient.login(userName,password); ZSession.createFromExistingSession(zeppelinClient,interpreter, sessionId);
2.close security authentication
// ZeppelinClient zeppelinClient = new ZeppelinClient(clientConfig); ZSession.createFromExistingSession(zeppelinClient,interpreter, sessionId);