You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by "Jordan Zimmerman (JIRA)" <ji...@apache.org> on 2018/12/04 20:33:00 UTC

[jira] [Commented] (CURATOR-488) NoSuchMethodError calling client close() in 3.4 compatibility mode

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

Jordan Zimmerman commented on CURATOR-488:
------------------------------------------

We pushed a change yesterday as part of CURATOR-472 that should fix this. When did you try this? Can you try again with a fresh pull?

> NoSuchMethodError calling client close() in 3.4 compatibility mode 
> -------------------------------------------------------------------
>
>                 Key: CURATOR-488
>                 URL: https://issues.apache.org/jira/browse/CURATOR-488
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Client
>    Affects Versions: TBD
>         Environment: Windows 7 x64
>            Reporter: Boris Dainson
>            Priority: Major
>         Attachments: pom.xml
>
>
> Affected version is 4.0.2-SNAPSHOT. Version 4.0.1 is not affected
> When closing client it is calling zooKeeper.close(waitForShutdownTimeoutMs) This method is only supported starting from ZK 3.5. So when running in compatibility mode with ZK 3.4.x it throws NoSuchMethodError.  So for ZK 3.4.x need to use  zooKeeper.close() with no arguments. 
>  
> To reproduce:
> Start ZK 3.4 server locally. 
> In pom.xml add dependency on zookeeper 3.4.13 and exclude default dependency (on 3.5). Full pom.xml is attached. 
>  
> Run this code snippet: 
> public class CloseTest {
>    public static void main(String[] args) throws Exception
> {     CuratorFramework client = CuratorFrameworkFactory.newClient("localhost:2181", new  ExponentialBackoffRetry(1000, 3));     client.start();     client.close();   }
> }
>  
> It will throw exception: 
> Exception in thread "main" java.lang.NoSuchMethodError: org.apache.zookeeper.ZooKeeper.close(I)Z
>  at org.apache.curator.HandleHolder.internalClose(HandleHolder.java:158)
>  at org.apache.curator.HandleHolder.closeAndClear(HandleHolder.java:78)
>  at org.apache.curator.ConnectionState.close(ConnectionState.java:125)
>  at org.apache.curator.CuratorZookeeperClient.close(CuratorZookeeperClient.java:266)
>  at org.apache.curator.CuratorZookeeperClient.close(CuratorZookeeperClient.java:249)
>  at org.apache.curator.framework.imps.CuratorFrameworkImpl.close(CuratorFrameworkImpl.java:388)
>  at leader.CloseTest.main(CloseTest.java:11)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)