You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by psnj86 <pr...@gmail.com> on 2021/04/21 13:28:25 UTC

import org.apache.zookeeper.data.Stat cannot be resolved in V3.5.5

Hi,

I am trying to upgrade Zookeeper server and client from V3.4.6 to V3.5.5
When I upgrade, org.apache.zookeeper.data.Stat is not resolved as it is not
the usual place as in 3.4.6
We extensively use Stat to check if node exists in the zookeeper using
checkExists() and use getStat().
Without importing org.apache.zookeeper.data.Stat, all these are not getting
resolved. Should we use an alternate class for this?
Any reason why it is moved? But strangely I see it is being used in package
org.apache.zookeeper.server by DataTree.java. I am not able to locate it
inside org.apache.zookeeper.server as well.
Could anyone throw some light on it?

Thanks,
Pradheep



--
Sent from: http://zookeeper-user.578899.n2.nabble.com/

Re: import org.apache.zookeeper.data.Stat cannot be resolved in V3.5.5

Posted by Damien Diederen <dd...@apache.org>.
Hi Pradheep,

> I am trying to upgrade Zookeeper server and client from V3.4.6 to
> V3.5.5

Note that the latest version in the 3.5 series is 3.5.9; I would suggest
using that one.

That being said:

> When I upgrade, org.apache.zookeeper.data.Stat is not resolved as it is not
> the usual place as in 3.4.6
> We extensively use Stat to check if node exists in the zookeeper using
> checkExists() and use getStat().
> Without importing org.apache.zookeeper.data.Stat, all these are not getting
> resolved. Should we use an alternate class for this?
> Any reason why it is moved? But strangely I see it is being used in package
> org.apache.zookeeper.server by DataTree.java. I am not able to locate it
> inside org.apache.zookeeper.server as well.
> Could anyone throw some light on it?

Yes.  That (autogenerated) class used to be embedded in the main
ZooKeeper JAR:

    $ jar tf zookeeper-3.4.6/dist-maven/zookeeper-3.4.6.jar org/apache/zookeeper/data/Stat.class
    org/apache/zookeeper/data/Stat.class

For 3.5, it was moved out of it, to zookeeper-jute-3.5.5.jar (with all
the other Jute-generated classes):

    $ jar tf apache-zookeeper-3.5.5-bin/lib/zookeeper-3.5.5.jar org/apache/zookeeper/data/Stat.class

    $ jar tf apache-zookeeper-3.5.5-bin/lib/zookeeper-jute-3.5.5.jar org/apache/zookeeper/data/Stat.class
    org/apache/zookeeper/data/Stat.class

That new JAR should be added to your CLASSPATH.

HTH, -D