[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13959308#comment-13959308
 ] 

stack commented on ZOOKEEPER-1897:
----------------------------------

[~fpj] That works boss.

[~michim] This is what fails:

[stack@c2022 hbase-0.99.0-SNAPSHOT]$ ~/bin/java/bin/java -cp 
./lib/zookeeper-3.4.6v2.jar:lib/slf4j-log4j12-1.6.4.jar:lib/slf4j-api-1.6.4.jar:lib/log4j-1.2.17.jar
  org.apache.zookeeper.ZooKeeperMain -server c2020:2181 get -w  "/hbase/rs"

Connecting to c2020:2181
log4j:WARN No appenders could be found for logger 
(org.apache.zookeeper.ZooKeeper).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more 
info.
Command failed: java.lang.IllegalArgumentException: Path must start with / 
character


This is a zk with the patch that I attached here applied.

A clean 3.4.6 gives no indication that it worked (in fact I'm pretty sure it 
does not work given that is what this issue is about -- that command-line args 
are just by-passed):

{code}
[stack@c2022 hbase-0.99.0-SNAPSHOT]$ ~/bin/java/bin/java -cp 
/tmp/zookeeper-3.4.6.jar:lib/slf4j-log4j12-1.6.4.jar:lib/slf4j-api-1.6.4.jar:lib/log4j-1.2.17.jar
  org.apache.zookeeper.ZooKeeperMain -server c2020:2181 get -w  "/hbase/rs"
Connecting to c2020:2181
log4j:WARN No appenders could be found for logger 
(org.apache.zookeeper.ZooKeeper).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more 
info.
{code}




> ZK Shell/Cli not processing commands
> ------------------------------------
>
>                 Key: ZOOKEEPER-1897
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1897
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: java client, scripts
>    Affects Versions: 3.4.6
>            Reporter: Cameron Gandevia
>            Assignee: Edward Ribeiro
>             Fix For: 3.4.7, 3.5.0
>
>         Attachments: ZOOKEEPER-1897.txt, ZOOKEEPER-1897v2.txt
>
>
> When running zookeeper 3.4.5 I was able to run commands using zkCli such as 
> zkCli.sh -server 127.0.0.1:2182 ls /
> zkCli.sh -server 127.0.0.1:2182 get /blah
> After upgrading to 3.4.6 these commands no longer work.
> I think issue https://issues.apache.org/jira/browse/ZOOKEEPER-1535 was the 
> reason the commands were running in previous versions.
> It looks like the client exits when a command is present.
> {code:title=ZooKeeperMain.java}
>     void run() throws KeeperException, IOException, InterruptedException {
>         if (cl.getCommand() == null) {
>             System.out.println("Welcome to ZooKeeper!");
>             boolean jlinemissing = false;
>             // only use jline if it's in the classpath
>             try {
>                 Class consoleC = Class.forName("jline.ConsoleReader");
>                 Class completorC =
>                     Class.forName("org.apache.zookeeper.JLineZNodeCompletor");
>                 System.out.println("JLine support is enabled");
>                 Object console =
>                     consoleC.getConstructor().newInstance();
>                 Object completor =
>                     
> completorC.getConstructor(ZooKeeper.class).newInstance(zk);
>                 Method addCompletor = consoleC.getMethod("addCompletor",
>                         Class.forName("jline.Completor"));
>                 addCompletor.invoke(console, completor);
>                 String line;
>                 Method readLine = consoleC.getMethod("readLine", 
> String.class);
>                 while ((line = (String)readLine.invoke(console, getPrompt())) 
> != null) {
>                     executeLine(line);
>                 }
>             } catch (ClassNotFoundException e) {
>                 LOG.debug("Unable to start jline", e);
>                 jlinemissing = true;
>             } catch (NoSuchMethodException e) {
>                 LOG.debug("Unable to start jline", e);
>                 jlinemissing = true;
>             } catch (InvocationTargetException e) {
>                 LOG.debug("Unable to start jline", e);
>                 jlinemissing = true;
>             } catch (IllegalAccessException e) {
>                 LOG.debug("Unable to start jline", e);
>                 jlinemissing = true;
>             } catch (InstantiationException e) {
>                 LOG.debug("Unable to start jline", e);
>                 jlinemissing = true;
>             }
>             if (jlinemissing) {
>                 System.out.println("JLine support is disabled");
>                 BufferedReader br =
>                     new BufferedReader(new InputStreamReader(System.in));
>                 String line;
>                 while ((line = br.readLine()) != null) {
>                     executeLine(line);
>                 }
>             }
>         }
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to