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

   It throw "Caused by: java.lang.NoClassDefFoundError: 
org/apache/seata/core/context/RootContext" err when I use 
   shardingsphere-proxy: 5.5.3. But it can support for 5.1.1.
   
   ```
   Caused by: java.lang.NoClassDefFoundError: 
org/apache/seata/core/context/RootContext
           at 
org.apache.shardingsphere.transaction.base.seata.at.SeataTransactionalSQLExecutionHook.start(SeataTransactionalSQLExecutionHook.java:36)
           at 
org.apache.shardingsphere.infra.executor.sql.hook.SPISQLExecutionHook.start(SPISQLExecutionHook.java:36)
           at 
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:90)
           at 
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:65)
           at 
org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.syncExecute(ExecutorEngine.java:99)
           at 
org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.parallelExecute(ExecutorEngine.java:95)
           at 
org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.execute(ExecutorEngine.java:78)
           at 
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor.execute(JDBCExecutor.java:66)
           at 
org.apache.shardingsphere.proxy.backend.connector.jdbc.executor.ProxyJDBCExecutor.execute(ProxyJDBCExecutor.java:74)
           at 
org.apache.shardingsphere.proxy.backend.connector.ProxySQLExecutor.useDriverToExecute(ProxySQLExecutor.java:235)
           at 
org.apache.shardingsphere.proxy.backend.connector.ProxySQLExecutor.execute(ProxySQLExecutor.java:192)
           at 
org.apache.shardingsphere.proxy.backend.connector.StandardDatabaseProxyConnector.doExecute(StandardDatabaseProxyConnector.java:238)
           at 
org.apache.shardingsphere.proxy.backend.connector.StandardDatabaseProxyConnector.execute(StandardDatabaseProxyConnector.java:194)
           at 
org.apache.shardingsphere.proxy.backend.handler.data.type.UnicastDatabaseProxyBackendHandler.execute(UnicastDatabaseProxyBackendHandler.java:63)
           at 
org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:96)
           at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.doExecuteCommand(CommandExecutorTask.java:126)
           at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:121)
           at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:78)
           ... 4 common frames omitted
   Caused by: java.lang.ClassNotFoundException: 
org.apache.seata.core.context.RootContext
           ... 22 common frames omitted
   [ERROR] 2026-03-03 16:15:25.813 [ShardingSphere-Command-0] 
o.a.s.p.f.c.CommandExecutorTask - Exception occur: 
   java.lang.RuntimeException: java.lang.NoClassDefFoundError: 
org/apache/seata/core/context/RootContext
           at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:87)
           at com.alibaba.ttl.TtlRunnable.run(TtlRunnable.java:60)
           at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
           at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
           at java.base/java.lang.Thread.run(Thread.java:1474)
   Caused by: java.lang.NoClassDefFoundError: 
org/apache/seata/core/context/RootContext
           at 
org.apache.shardingsphere.transaction.base.seata.at.SeataTransactionalSQLExecutionHook.start(SeataTransactionalSQLExecutionHook.java:36)
           at 
org.apache.shardingsphere.infra.executor.sql.hook.SPISQLExecutionHook.start(SPISQLExecutionHook.java:36)
           at 
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:90)
           at 
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:65)
           at 
org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.syncExecute(ExecutorEngine.java:99)
           at 
org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.parallelExecute(ExecutorEngine.java:95)
   :
   ```
   
    global.yaml
   ```
   #
   # 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: Standalone
     repository:
       type: JDBC
   
   authority:
     users:
       - user: sharding@%
         password: sharding
     privilege:
       type: ALL_PERMITTED
   
   transaction:
     defaultType: LOCAL
     providerType: Atomikos
   
   sqlParser:
     sqlStatementCache:
       initialCapacity: 2000
       maximumSize: 65535
     parseTreeCache:
       initialCapacity: 128
       maximumSize: 1024
   
   sqlFederation:
     sqlFederationEnabled: false
     executionPlanCache:
       initialCapacity: 2000
       maximumSize: 65535
   
   props:
     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 org.apache.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: 23307 # 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
   ```
   
   database-sharding.yaml
   ```
   # 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 sharding rule.
   #
   
######################################################################################################
   
   databaseName: sharding_db
   
   dataSources:
     ds_0:
       url: 
jdbc:mysql://127.0.0.1:3306/sre_agent?serverTimezone=UTC&useSSL=false&charset=utf8mb4&parseTime=True&allowPublicKeyRetrieval=true
       username: sharding
       password: sharding
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 500
       minPoolSize: 10
       customPoolProps:
         leakDetectionThreshold: 30000
         registerMbeans: true
   
   rules:
   - !SHARDING
     tables:
       tbl_group:
         actualDataNodes: ds_0.tbl_group_${0}_${0}
         tableStrategy:
           complex:
             shardingColumns: app_id,group_id
             shardingAlgorithmName: tbl_group_strategy
     defaultDatabaseStrategy:
       none:
     defaultTableStrategy:
       none:
     defaultKeyGenerateStrategy:
       keyGeneratorName: snowflake
       column: id
   
     shardingAlgorithms:
       tbl_group_strategy:
         type: COMPLEX_INLINE
         props:
           algorithm-expression: 
tbl_group_${app_id}_${Math.abs(group_id.hashCode()) % 2}
   
     keyGenerators:
       snowflake:
         type: SNOWFLAKE
         props:
           worker-id: 561
   ```
   
   test
   ```
   mysql> show databases;
   +--------------------+
   | Database           |
   +--------------------+
   | information_schema |
   | mysql              |
   | performance_schema |
   | sharding_db        |
   | shardingsphere     |
   | sys                |
   +--------------------+
   6 rows in set (0.031 sec)
   
   mysql> use sharding_db;
   Database changed
   mysql> show tables;
   +-----------------------+
   | Tables_in_sharding_db |
   +-----------------------+
   | tbl_group             |
   +-----------------------+
   1 row in set (0.019 sec)
   
   mysql> SELECT 1;
   ERROR 30000 (HY000): Unknown exception.
   More details: java.lang.RuntimeException: java.lang.NoClassDefFoundError: 
org/apache/seata/core/context/RootContext
   ```
   
   


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