Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor() #3658

Closed
xiaolongyuan opened this issue Dec 4, 2019 · 2 comments

Comments

@xiaolongyuan
Copy link

Bug Report

java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor()Lcom/google/common/util/concurrent/ListeningExecutorService;

	at org.apache.curator.framework.listen.ListenerContainer.addListener(ListenerContainer.java:41)
	at org.apache.curator.framework.imps.CuratorFrameworkImpl.start(CuratorFrameworkImpl.java:257)
	at org.apache.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperRegistryCenter.initCuratorClient(CuratorZookeeperRegistryCenter.java:108)
	at org.apache.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperRegistryCenter.init(CuratorZookeeperRegistryCenter.java:75)
	at org.apache.shardingsphere.orchestration.internal.registry.RegistryCenterServiceLoader.load(RegistryCenterServiceLoader.java:53)
	at org.apache.shardingsphere.orchestration.internal.keygen.LeafSnowflakeKeyGenerator.initializeRegistryCenter(LeafSnowflakeKeyGenerator.java:179)
	at org.apache.shardingsphere.orchestration.internal.keygen.LeafSnowflakeKeyGenerator.initializeLeafSnowflakeKeyGeneratorIfNeed(LeafSnowflakeKeyGenerator.java:120)
	at org.apache.shardingsphere.orchestration.internal.keygen.LeafSnowflakeKeyGenerator.generateKey(LeafSnowflakeKeyGenerator.java:112)

Which version of ShardingSphere did you use?

4.0.0-RC3

Which project did you use? Sharding-JDBC or Sharding-Proxy?

Sharding-Jdbc

Expected behavior

Actual behavior

Reason analyze (If you can)

project guava: 27.0.1-jre

curator is old. guava is 18.0

update curator to 4.x

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

Example codes for reproduce this issue (such as a github link).

@xiaolongyuan
Copy link
Author

config:

      tables:
        account_bill:
          key-generator:
            column: id
            type: LEAF_SNOWFLAKE
            props:
              serverList: 172.16.3.150:2181
              serviceId: account_bill_id
              maxTimeDifference: 1000

project guava 18.0

Error:




java.lang.NoSuchMethodError: org.apache.curator.CuratorZookeeperClient.startAdvancedTracer(Ljava/lang/String;)Lorg/apache/curator/drivers/OperationTrace;

	at org.apache.curator.framework.imps.ExistsBuilderImpl.pathInForegroundStandard(ExistsBuilderImpl.java:221)
	at org.apache.curator.framework.imps.ExistsBuilderImpl.pathInForeground(ExistsBuilderImpl.java:216)
	at org.apache.curator.framework.imps.ExistsBuilderImpl.forPath(ExistsBuilderImpl.java:175)
	at org.apache.curator.framework.imps.ExistsBuilderImpl.forPath(ExistsBuilderImpl.java:32)
	at org.apache.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperRegistryCenter.isExisted(CuratorZookeeperRegistryCenter.java:156)
	at org.apache.shardingsphere.orchestration.internal.keygen.LeafSnowflakeKeyGenerator.initializeTimeNodeIfNeed(LeafSnowflakeKeyGenerator.java:199)
	at org.apache.shardingsphere.orchestration.internal.keygen.LeafSnowflakeKeyGenerator.initializeLeafSnowflakeKeyGeneratorIfNeed(LeafSnowflakeKeyGenerator.java:121)
	at org.apache.shardingsphere.orchestration.internal.keygen.LeafSnowflakeKeyGenerator.generateKey(LeafSnowflakeKeyGenerator.java:112)
	at org.apache.shardingsphere.core.rule.ShardingRule.generateKey(ShardingRule.java:362)
	at org.apache.shardingsphere.core.route.router.sharding.keygen.GeneratedKey.createGeneratedKey(GeneratedKey.java:105)
	at org.apache.shardingsphere.core.route.router.sharding.keygen.GeneratedKey.getGenerateKey(GeneratedKey.java:68)
	at org.apache.shardingsphere.core.route.router.sharding.ShardingRouter.route(ShardingRouter.java:99)
	at org.apache.shardingsphere.core.route.PreparedStatementRoutingEngine.route(PreparedStatementRoutingEngine.java:63)
	at org.apache.shardingsphere.core.PreparedQueryShardingEngine.route(PreparedQueryShardingEngine.java:59)
	at org.apache.shardingsphere.core.BaseShardingEngine.executeRoute(BaseShardingEngine.java:91)
	at org.apache.shardingsphere.core.BaseShardingEngine.shard(BaseShardingEngine.java:74)
	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.shard(ShardingPreparedStatement.java:222)
	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.execute(ShardingPreparedStatement.java:163)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
	at com.sun.proxy.$Proxy74.execute(Unknown Source)
	at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)
	at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
	at org.apache.ibatis.executor.ReuseExecutor.doUpdate(ReuseExecutor.java:52)
	at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
	at com.sun.proxy.$Proxy65.insert(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278)
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)

@terrymanu
Copy link
Member

terrymanu commented Dec 4, 2019

Please resolve the conflict in your app scope.
Maven can help you to analyze the conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants