curator-recipes 低版本 导致的codis加载异常

文章详细介绍了如何通过升级曲棍球版本到2.7.0来解决版本冲突问题,并提供了使用storm-local命令在本地运行风暴集群的方法。同时,通过实例展示了在遇到版本不匹配导致的java.lang.NoSuchMethodError时,如何调整依赖版本以确保程序正常运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

java.lang.NoSuchMethodError: org.apache.curator.utils.PathUtils.validatePath(Ljava/lang/String;)Ljava/lang/String;
at org.apache.curator.framework.recipes.cache.ChildData.<init>(ChildData.java:34)
at org.apache.curator.framework.recipes.cache.PathChildrenCache.<clinit>(PathChildrenCache.java:91)
at com.xxx.framework.cache.plugin.jodis.RoundRobinJedisPool.<init>(RoundRobinJedisPool.java:207)
at com.xxx.framework.cache.plugin.jodis.RoundRobinJedisPool.<init>(RoundRobinJedisPool.java:165)
at com.xxx.framework.cache.plugin.jodis.RoundRobinJedisPool.<init>(RoundRobinJedisPool.java:132)
at com.xxx.framework.cache.impl.jodis.CacheManager.init(CacheManager.java:147)
at com.xxx.framework.cache.impl.jodis.CacheManager.getInstance(CacheManager.java:233)
at com.xxx.opencache.test.service.JodisTest.test(JodisTest.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)



问题是由于 curator-recipes 低版本有问题,所以换成相对高版本的依赖
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>2.8.0</version>
</dependency>

注意用新版本的同时,注意隔离之前的版本依赖


以下文章,启发我关于解决此问题的思路:https://groups.google.com/forum/#!topic/lumify/xfSb0-j1DhY

由于是墙的原因,有人看不了。所以我也粘了出来:

Jayasree Atmakuru
11/18/14


Hi ,

I am building lumify based on centos documentation.

I am getting error in strom jar cmd.

I have created accumulo hadoop based on the cmds given in the documentation.
Still i am getting error on acquiring lock in AccumuloRepositoryAuthorisation create lock method.

please find the error log below:

4959 [ConnectionStateManager-0] WARN org.apache.curator.framework.
state.ConnectionStateManager - There are no ConnectionStateListeners registered.
5006 [main] INFO io.lumify.core.model.user.AccumuloAuthorizationRepository - adding authorization [ontology] for secure graph user
Exception in thread "main" com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting constructor, java.lang.NoSuchMethodError: org.apache.curator.utils.PathUtils.validatePath(Ljava/lang/String;)Ljava/lang/String;
at io.lumify.securegraph.model.ontology.SecureGraphOntologyRepository.<init>(SecureGraphOntologyRepository.java:66)
at io.lumify.securegraph.model.ontology.SecureGraphOntologyRepository.class(SecureGraphOntologyRepository.java:39)
while locating io.lumify.securegraph.model.ontology.SecureGraphOntologyRepository
at io.lumify.core.bootstrap.LumifyBootstrap.configure(LumifyBootstrap.java:137)
at io.lumify.core.bootstrap.LumifyBootstrap.configure(LumifyBootstrap.java:137)
while locating io.lumify.core.model.ontology.OntologyRepository
for parameter 3 at io.lumify.securegraph.model.user.SecureGraphUserRepository.<init>(SecureGraphUserRepository.java:60)
at io.lumify.securegraph.model.user.SecureGraphUserRepository.class(SecureGraphUserRepository.java:39)
while locating io.lumify.securegraph.model.user.SecureGraphUserRepository
at io.lumify.core.bootstrap.LumifyBootstrap.configure(LumifyBootstrap.java:128)
at io.lumify.core.bootstrap.LumifyBootstrap.configure(LumifyBootstrap.java:128)
while locating io.lumify.core.model.user.UserRepository
for parameter 0 at io.lumify.core.cmdline.CommandLineBase.setUserRepository(CommandLineBase.java:157)
while locating io.lumify.storm.StormRunner

1 error
at com.google.inject.internal.Errors.throwProvisionExceptionIfErrorsExist(Errors.java:451)
at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:65)
at com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:944)
at io.lumify.core.bootstrap.InjectHelper.inject(InjectHelper.java:31)
at io.lumify.core.bootstrap.InjectHelper.inject(InjectHelper.java:24)
at io.lumify.core.cmdline.CommandLineBase.run(CommandLineBase.java:66)
at io.lumify.storm.StormRunner.main(StormRunner.java:11)
Caused by: java.lang.NoSuchMethodError: org.apache.curator.utils.PathUtils.validatePath(Ljava/lang/String;)Ljava/lang/String;
at org.apache.curator.framework.recipes.locks.InterProcessMutex.<init>(InterProcessMutex.java:194)
at org.apache.curator.framework.recipes.locks.InterProcessMutex.<init>(InterProcessMutex.java:76)
at org.apache.curator.framework.recipes.locks.InterProcessMutex.<init>(InterProcessMutex.java:66)
at io.lumify.core.model.lock.LockRepository.createLock(LockRepository.java:30)
at io.lumify.core.model.lock.LockRepository.lock(LockRepository.java:53)
at io.lumify.core.model.lock.LockRepository.lock(LockRepository.java:39)
at io.lumify.core.model.user.AccumuloAuthorizationRepository.addAuthorizationToGraph(AccumuloAuthorizationRepository.java:25)
at io.lumify.securegraph.model.ontology.SecureGraphOntologyRepository.<init>(SecureGraphOntologyRepository.java:69)
at io.lumify.securegraph.model.ontology.SecureGraphOntologyRepository$$FastClassByGuice$$7fb7e09b.newInstance(<generated>)
at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:65)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013)
at io.lumify.core.bootstrap.InjectHelper.getInstance(InjectHelper.java:47)
at io.lumify.core.bootstrap.LumifyBootstrap$ConfigurableProvider.get(LumifyBootstrap.java:284)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:65)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:84)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:65)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013)
at io.lumify.core.bootstrap.InjectHelper.getInstance(InjectHelper.java:47)
at io.lumify.core.bootstrap.LumifyBootstrap$ConfigurableProvider.get(LumifyBootstrap.java:284)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:65)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:83)
at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:75)
at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:73)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
at com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:73)
at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:60)
... 5 more

Completed


Christian Béland
12/11/14


Thanks,

It almost work now
- show quoted text -
Marked complete byJoe Ferner See this answer in its original position
All replies


Greg McNutt
11/18/14


HI, we just finished an update to get the VM and the code in sync ourselves. Was a bit of a change to the VM and to the code versions in the code. Namely storm to 0.93rc1 and kryo to 2.21 but also to remove some of the exclusions in the storm standalone jars. This gets all the moving pieces in sync [especially the underlying jar support in storm]

Will work offline with the Lumify crew today to get some of our changes into the main branches.

In the mean time, things do work ok when run locally [like storm-local] -- hope this helps.
- show quoted text -



Jayasree Atmakuru
11/18/14


Hi greg,

thank you very much for your reply.

Will you please elaborate on how to use storm-local.

Regards,
Jayasree.A
- show quoted text -

11/25/14

Joe Ferner This is the configuration I use in IntelliJ.


Jayasree Atmakuru
11/25/14


I am able to run storm jar with out any errors.
I removed everything from my storm-local directory and added the curator jars of 2.7.0 version and zookeeper-3.4.6 jar in storm_home/lob directory.
This workaround helped me in getting my storm jar running.

Can you please tell me why you are using Program arguments as --local?
I am running my storm jar using cmd prompt not from any IDE.

Regards,
Jayasree.A
- show quoted text -

11/26/14

Chao Wang "--local" argument is for running the topology in a in-process storm cluster instead of remote cluster. You don't have to start the storm nimbus service etc to run in local mode. I am trying to deploy the lumify topology to the storm-0.9.2-incubati


Jayasree Atmakuru
11/27/14


Hi ,
Thank you for your reply.

I have resolved the curator jar errors. But Kryo jar is not resolving even though i added 2.17 jar.

What need to be done to resolve this jar error. I have karyo 2.21 jar in the storm_home/ lib directory. I have replace that with 2.17 jar and run again the topology. But the error still remains.

Please suggest me.
- show quoted text -



Christian Béland
12/9/14


Hi,

Were you able to fix this? I currently have to same initial problem... (java.lang.NoSuchMethodError: org.apache.curator.utils.PathUtils.validatePath
- show quoted text -



Chao Wang
12/10/14


just add curator version 2.7.0 jar to the storm home directory
- show quoted text -



Christian Béland
12/11/14


Thanks,

It almost work now
- show quoted text -
Marked complete byJoe Ferner

希望对屏幕前的你有帮助
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值