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

2023-12-05

现象

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>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

springboot整合 elasticjob 3.x 启动报错 Error creating bean with name zookeeperRegistryCenter 的相关文章

随机推荐