duanqiaoyanyu opened a new issue, #22837:
URL: https://github.com/apache/shardingsphere/issues/22837

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub 
issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response anymore and we cannot reproduce it on current information, we 
will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   5.2.1
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   
   ### Expected behavior
   start normal
   
   ### Actual behavior
   start error
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   ```yaml
   spring.shardingsphere.mode.type=Cluster
   spring.shardingsphere.mode.repository.type=Nacos
   spring.shardingsphere.mode.repository.props.server-lists=localhost:8848
   ```
   
   ```xml
       <dependencies>
           <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               
<artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
               <version>5.2.1</version>
           </dependency>
           <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               
<artifactId>shardingsphere-cluster-mode-repository-nacos</artifactId>
               <version>5.2.1</version>
           </dependency>
       </dependencies>
   ```
   
   ```
   2022-12-12 21:04:07.061 ERROR 2664 --- [           main] 
o.s.boot.SpringApplication               : Application run failed
   
   org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'dataSource' defined in class path resource 
[org/apache/shardingsphere/spring/boot/ShardingSphereAutoConfiguration.class]: 
Bean instantiation via factory method failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested 
exception is java.util.ServiceConfigurationError: 
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository: 
Provider 
org.apache.shardingsphere.mode.repository.cluster.zookeeper.CuratorZookeeperRepository
 could not be instantiated
        at 
org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:657)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:637)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1341)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1181)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879)
 ~[spring-context-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
 ~[spring-context-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:755) 
[spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
        at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) 
[spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
        at 
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:402)
 [spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:312) 
[spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1247) 
[spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1236) 
[spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
        at 
com.cskaoyan.ShardingsphereJdbcApplication.main(ShardingsphereJdbcApplication.java:10)
 [classes/:na]
   Caused by: org.springframework.beans.BeanInstantiationException: Failed to 
instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw 
exception; nested exception is java.util.ServiceConfigurationError: 
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository: 
Provider 
org.apache.shardingsphere.mode.repository.cluster.zookeeper.CuratorZookeeperRepository
 could not be instantiated
        at 
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:652)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        ... 19 common frames omitted
   Caused by: java.util.ServiceConfigurationError: 
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository: 
Provider 
org.apache.shardingsphere.mode.repository.cluster.zookeeper.CuratorZookeeperRepository
 could not be instantiated
        at java.util.ServiceLoader.fail(ServiceLoader.java:232) ~[na:1.8.0_333]
        at java.util.ServiceLoader.access$100(ServiceLoader.java:185) 
~[na:1.8.0_333]
        at 
java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384) 
~[na:1.8.0_333]
        at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) 
~[na:1.8.0_333]
        at java.util.ServiceLoader$1.next(ServiceLoader.java:480) 
~[na:1.8.0_333]
        at 
org.apache.shardingsphere.infra.util.spi.ShardingSphereServiceLoader.load(ShardingSphereServiceLoader.java:53)
 ~[shardingsphere-infra-util-5.2.1.jar:5.2.1]
        at 
org.apache.shardingsphere.infra.util.spi.ShardingSphereServiceLoader.register(ShardingSphereServiceLoader.java:47)
 ~[shardingsphere-infra-util-5.2.1.jar:5.2.1]
        at 
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepositoryFactory.<clinit>(ClusterPersistRepositoryFactory.java:33)
 ~[shardingsphere-cluster-mode-repository-api-5.2.1.jar:5.2.1]
        at 
org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder.build(ClusterContextManagerBuilder.java:49)
 ~[shardingsphere-cluster-mode-core-5.2.1.jar:5.2.1]
        at 
org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.createContextManager(ShardingSphereDataSource.java:76)
 ~[shardingsphere-jdbc-core-5.2.1.jar:5.2.1]
        at 
org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.<init>(ShardingSphereDataSource.java:57)
 ~[shardingsphere-jdbc-core-5.2.1.jar:5.2.1]
        at 
org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory.createDataSource(ShardingSphereDataSourceFactory.java:62)
 ~[shardingsphere-jdbc-core-5.2.1.jar:5.2.1]
        at 
org.apache.shardingsphere.spring.boot.ShardingSphereAutoConfiguration.dataSource(ShardingSphereAutoConfiguration.java:105)
 ~[shardingsphere-jdbc-core-spring-boot-starter-5.2.1.jar:5.2.1]
        at 
org.apache.shardingsphere.spring.boot.ShardingSphereAutoConfiguration$$EnhancerBySpringCGLIB$$2817c86a.CGLIB$dataSource$0(<generated>)
 ~[shardingsphere-jdbc-core-spring-boot-starter-5.2.1.jar:5.2.1]
        at 
org.apache.shardingsphere.spring.boot.ShardingSphereAutoConfiguration$$EnhancerBySpringCGLIB$$2817c86a$$FastClassBySpringCGLIB$$8f24cc51.invoke(<generated>)
 ~[shardingsphere-jdbc-core-spring-boot-starter-5.2.1.jar:5.2.1]
        at 
org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) 
~[spring-core-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
 ~[spring-context-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.apache.shardingsphere.spring.boot.ShardingSphereAutoConfiguration$$EnhancerBySpringCGLIB$$2817c86a.dataSource(<generated>)
 ~[shardingsphere-jdbc-core-spring-boot-starter-5.2.1.jar:5.2.1]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[na:1.8.0_333]
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[na:1.8.0_333]
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[na:1.8.0_333]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_333]
        at 
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        ... 20 common frames omitted
   Caused by: java.lang.NoClassDefFoundError: 
org/apache/curator/connection/StandardConnectionHandlingPolicy
        at 
org.apache.curator.framework.CuratorFrameworkFactory$Builder.<init>(CuratorFrameworkFactory.java:147)
 ~[curator-framework-4.0.1.jar:4.0.1]
        at 
org.apache.curator.framework.CuratorFrameworkFactory$Builder.<init>(CuratorFrameworkFactory.java:130)
 ~[curator-framework-4.0.1.jar:4.0.1]
        at 
org.apache.curator.framework.CuratorFrameworkFactory.builder(CuratorFrameworkFactory.java:78)
 ~[curator-framework-4.0.1.jar:4.0.1]
        at 
org.apache.shardingsphere.mode.repository.cluster.zookeeper.CuratorZookeeperRepository.<init>(CuratorZookeeperRepository.java:71)
 ~[shardingsphere-cluster-mode-repository-zookeeper-curator-5.2.1.jar:5.2.1]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method) ~[na:1.8.0_333]
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
 ~[na:1.8.0_333]
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 ~[na:1.8.0_333]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
~[na:1.8.0_333]
        at java.lang.Class.newInstance(Class.java:442) ~[na:1.8.0_333]
        at 
java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380) 
~[na:1.8.0_333]
        ... 40 common frames omitted
   Caused by: java.lang.ClassNotFoundException: 
org.apache.curator.connection.StandardConnectionHandlingPolicy
        at java.net.URLClassLoader.findClass(URLClassLoader.java:387) 
~[na:1.8.0_333]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_333]
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) 
~[na:1.8.0_333]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_333]
        ... 50 common frames omitted
   ```
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to