Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This occurs because the return value of PathChildrenCache.getListenable() has changed in Curator 5.0.0 (note: the full list of breaking changes can be found at the Curator website). You can work around this problem by creating a mini-JAR containing older versions of the changed Curator classes and making sure that that JAR is earlier in your classpath than the Curator 5.0.0 JARs. To create this JAR in Maven see below. If the community needs it, the Apache Curator team will consider publishing a mini-jar in the future. Please engage us via our mailing lists or Jira.

Maven Snippet

Code Block
languagexml
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<executions>
    <execution>
        <id>unpack</id>
        <phase>compile</phase>
        <goals>
            <goal>unpack</goal>
        </goals>
        <configuration>
            <artifactItems>
                <artifactItem>
                    <groupId>org.apache.curator</groupId>
                    <artifactId>curator-recipes</artifactId>
                    <version>4.3.0</version>
                    <type>jar</type>
                    <overWrite>false</overWrite>
                    <outputDirectory>${project.build.directory}/classes</outputDirectory>
                    <destFileName>curator-4_0-recipes.jar</destFileName>
                    <includes>
                        org/apache/curator/framework/recipes/cache/NodeCache*.*,
                        org/apache/curator/framework/recipes/cache/PathChildrenCache*.*,
                        org/apache/curator/framework/recipes/cache/*Operation.*,
                        org/apache/curator/framework/recipes/locks/ChildReaper*
                        org/apache/curator/framework/recipes/locks/Reaper*,
                        org/apache/curator/framework/recipes/nodes/PersistentNode*,
                        org/apache/curator/framework/recipes/queue/DistributedDelayQueue*,
                        org/apache/curator/framework/recipes/queue/DistributedIdQueue*,
                        org/apache/curator/framework/recipes/queue/DistributedPriorityQueue*,
                        org/apache/curator/framework/recipes/queue/DistributedQueue*,
                        org/apache/curator/framework/recipes/queue/QueueBase*,
                        org/apache/curator/framework/recipes/shared/SharedValue*,
                        org/apache/curator/framework/recipes/shared/SharedValueReader*
                    </includes>
                </artifactItem>
                <artifactItem>
                    <groupId>org.apache.curator</groupId>
                    <artifactId>curator-framework</artifactId>
                    <version>4.3.0</version>
                    <type>jar</type>
                    <overWrite>false</overWrite>
                    <outputDirectory>${project.build.directory}/classes</outputDirectory>
                    <destFileName>curator-4_0-recipes.jar</destFileName>
                    <includes>
                        org/apache/curator/framework/listen/ListenerContainer*
                    </includes>
                </artifactItem>
            </artifactItems>
        </configuration>
    </execution>
</executions>
</plugin>
    

...