springboot整合 elasticjob 3.x 启动报错 Error creating bean with name zookeeperRegistryCenter

现象

Failed to introspect bean class [org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter]
Caused by: java.lang.NoClassDefFoundError: org/apache/curator/framework/recipes/cache/CuratorCache
Caused by: java.lang.ClassNotFoundException: org.apache.curator.framework.recipes.cache.CuratorCache

原因

spring-boot-starter-parent 版本太低,无法推荐到合适的curator版本.

解决方法

pom文件添加,指定版本, 5.1.0为高版本spring-boot-starter-parent推荐的版本

        <dependency>
            <groupId>org.apache.curator</groupId>
            <artifactId>curator-recipes</artifactId>
            <version>5.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.curator</groupId>
            <artifactId>curator-framework</artifactId>
            <version>5.1.0</version>
        </dependency>

猜你喜欢

转载自blog.csdn.net/LiZhen314/article/details/134777859
今日推荐