CV-Devlau opened a new issue, #33892:
URL: https://github.com/apache/shardingsphere/issues/33892

   ## Question
   
   **For English only**, other languages will not accept.
   
   Before asking a question, make sure you have:
   
   - Googled your question.
   - 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**.
   
   
   ```
   we find java version: java8, full_version=1.8.0_432
   Starting the ShardingSphere-Proxy ...
   Exception in thread "main" java.util.ServiceConfigurationError: 
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlRuleConfigurationSwapper:
 Provider 
org.apache.shardingsphere.authority.yaml.swapper.YamlAuthorityRuleConfigurationSwapper
 could not be instantiated
           at java.util.ServiceLoader.fail(ServiceLoader.java:232)
           at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
           at 
java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
           at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
           at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
           at 
org.apache.shardingsphere.infra.spi.RegisteredShardingSphereSPI.load(RegisteredShardingSphereSPI.java:52)
           at 
org.apache.shardingsphere.infra.spi.RegisteredShardingSphereSPI.<init>(RegisteredShardingSphereSPI.java:42)
           at 
org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader.getRegisteredSPI(ShardingSphereServiceLoader.java:59)
           at 
org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader.getServiceInstances(ShardingSphereServiceLoader.java:46)
           at 
org.apache.shardingsphere.infra.yaml.config.shortcut.YamlRuleConfigurationShortcuts.getYamlShortcuts(YamlRuleConfigurationShortcuts.java:39)
           at 
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
           at 
java.util.LinkedList$LLSpliterator.forEachRemaining(LinkedList.java:1235)
           at 
java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
           at 
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
           at 
java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
           at 
java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
           at 
java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
           at 
java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485)
           at 
org.apache.shardingsphere.infra.util.yaml.constructor.ShardingSphereYamlConstructor.<init>(ShardingSphereYamlConstructor.java:45)
           at 
org.apache.shardingsphere.infra.util.yaml.YamlEngine.unmarshal(YamlEngine.java:56)
           at 
org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader.loadServerConfiguration(ProxyConfigurationLoader.java:104)
           at 
org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader.load(ProxyConfigurationLoader.java:84)
           at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:60)
   Caused by: java.lang.NoClassDefFoundError: 
org/apache/shardingsphere/infra/algorithm/core/yaml/YamlAlgorithmConfigurationSwapper
           at 
org.apache.shardingsphere.authority.yaml.swapper.YamlAuthorityRuleConfigurationSwapper.<init>(YamlAuthorityRuleConfigurationSwapper.java:41)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
           at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
           at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
           at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
           at java.lang.Class.newInstance(Class.java:442)
           at 
java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
           ... 20 more
   Caused by: java.lang.ClassNotFoundException: 
org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfigurationSwapper
           at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
           at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
           ... 27 more
   ```
   
   
   ```
   #
   # Licensed to the Apache Software Foundation (ASF) under one or more
   # contributor license agreements.  See the NOTICE file distributed with
   # this work for additional information regarding copyright ownership.
   # The ASF licenses this file to You under the Apache License, Version 2.0
   # (the "License"); you may not use this file except in compliance with
   # the License.  You may obtain a copy of the License at
   #
   #     http://www.apache.org/licenses/LICENSE-2.0
   #
   # Unless required by applicable law or agreed to in writing, software
   # distributed under the License is distributed on an "AS IS" BASIS,
   # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   # See the License for the specific language governing permissions and
   # limitations under the License.
   #
   
   
######################################################################################################
   # 
   # If you want to configure governance, authorization and proxy properties, 
please refer to this file.
   # 
   
######################################################################################################
   
   #mode:
   #  type: Cluster
   #  repository:
   #    type: ZooKeeper
   #    props:
   #      namespace: governance_ds
   #      server-lists: localhost:2181
   #      retryIntervalMilliseconds: 500
   #      timeToLiveSeconds: 60
   #      maxRetries: 3
   #      operationTimeoutMilliseconds: 500
   #
   authority:
     users:
       - user: root@%
         password: root
       - user: sharding
         password: sharding
     # privilege:
     #   type: DATABASE_PERMITTED
     #   props:
     #     user-database-mappings: sharding@%=*
   #
   #transaction:
   #  defaultType: XA
   #  providerType: Atomikos
   #
   #sqlParser:
   #  sqlStatementCache:
   #    initialCapacity: 2000
   #    maximumSize: 65535
   #  parseTreeCache:
   #    initialCapacity: 128
   #    maximumSize: 1024
   #
   #logging:
   #  loggers:
   #  - loggerName: ShardingSphere-SQL
   #    additivity: true
   #    level: INFO
   #    props:
   #      enable: false
   #
   #sqlFederation:
   #  sqlFederationEnabled: false
   #  executionPlanCache:
   #    initialCapacity: 2000
   #    maximumSize: 65535
   #
   props:
   #  system-log-level: INFO
   #  max-connections-size-per-query: 1
   #  kernel-executor-size: 16  # Infinite by default.
   #  proxy-frontend-flush-threshold: 128  # The default value is 128.
   #  # sql-show is the same as props in logger ShardingSphere-SQL, and its 
priority is lower than logging rule
   #  sql-show: false
   #  check-table-metadata-enabled: false
   #    # Proxy backend query fetch size. A larger value may increase the 
memory usage of ShardingSphere Proxy.
   #    # The default value is -1, which means set the minimum value for 
different JDBC drivers.
   #  proxy-backend-query-fetch-size: -1
   #  proxy-frontend-executor-size: 0 # Proxy frontend executor size. The 
default value is 0, which means let Netty decide.
   #  proxy-frontend-max-connections: 0 # Less than or equal to 0 means no 
limitation.
     proxy-default-port: 3308 # Proxy default port.
   #  proxy-netty-backlog: 1024 # Proxy netty backlog.
   #  cdc-server-port: 33071 # CDC server port
   #  proxy-frontend-ssl-enabled: false
   #  proxy-frontend-ssl-cipher: ''
   #  proxy-frontend-ssl-version: TLSv1.2,TLSv1.3
   
   ```
   ```
   #
   # Licensed to the Apache Software Foundation (ASF) under one or more
   # contributor license agreements.  See the NOTICE file distributed with
   # this work for additional information regarding copyright ownership.
   # The ASF licenses this file to You under the Apache License, Version 2.0
   # (the "License"); you may not use this file except in compliance with
   # the License.  You may obtain a copy of the License at
   #
   #     http://www.apache.org/licenses/LICENSE-2.0
   #
   # Unless required by applicable law or agreed to in writing, software
   # distributed under the License is distributed on an "AS IS" BASIS,
   # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   # See the License for the specific language governing permissions and
   # limitations under the License.
   #
   
   
######################################################################################################
   #
   # Here you can configure the rules for the proxy.
   # This example is configuration of readwrite-splitting rule.
   #
   
######################################################################################################
   #
   # databaseName: readwrite_splitting_db
   #
   # dataSources:
   #   primary_ds:
   #     url: 
jdbc:mysql://127.0.0.1:3306/hayne?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true&serverTimezone=GMT%2B8&allowMultiQueries=true
   #     username: root
   #     password: 123456
   #     connectionTimeoutMilliseconds: 30000
   #     idleTimeoutMilliseconds: 60000
   #     maxLifetimeMilliseconds: 1800000
   #     maxPoolSize: 50
   #     minPoolSize: 1
   #   replica_ds_0:
   #     url: 
jdbc:mysql://127.0.0.1:3307/hayne?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true&serverTimezone=GMT%2B8&allowMultiQueries=true
   #     username: root
   #     password: mysql!@#2024
   #     connectionTimeoutMilliseconds: 30000
   #     idleTimeoutMilliseconds: 60000
   #     maxLifetimeMilliseconds: 1800000
   #     maxPoolSize: 50
   #     minPoolSize: 1
   #  replica_ds_1:
   #    url: jdbc:postgresql://127.0.0.1:5432/demo_replica_ds_1
   #    username: postgres
   #    password: postgres
   #    connectionTimeoutMilliseconds: 30000
   #    idleTimeoutMilliseconds: 60000
   #    maxLifetimeMilliseconds: 1800000
   #    maxPoolSize: 50
   #    minPoolSize: 1
   #
   # rules:
   # - !READWRITE_SPLITTING
   #   dataSourceGroups:
   #     readwrite_ds:
   #       writeDataSourceName: primary_ds
   #       readDataSourceNames:
   #         - replica_ds_0
   #       loadBalancerName: random
   #   loadBalancers:
   #     random:
   #       type: RANDOM
   
   
######################################################################################################
   #
   # If you want to connect to MySQL, you should manually copy MySQL driver to 
lib directory.
   #
   
######################################################################################################
   
   databaseName: readwrite_splitting_db
   
   dataSources:
     write_ds:
       url: jdbc:mysql://127.0.0.1:3306/hayne?useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     read_ds_0:
       url: jdbc:mysql://127.0.0.1:3307/hayne?useSSL=false
       username: root
       password: mysql!@#2024
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     read_ds_1:
       url: jdbc:mysql://127.0.0.1:3307/hayne?useSSL=false
       username: root
       password:  mysql!@#2024
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   
   rules:
   - !READWRITE_SPLITTING
     dataSourceGroups:
       readwrite_ds:
         writeDataSourceName: write_ds
         readDataSourceNames:
           - read_ds_0
           - read_ds_1
         loadBalancerName: random
     loadBalancers:
       random:
         type: RANDOM
    
   ```


-- 
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