1. 程式人生 > >elastic Job 引入jar 包衝突解決辦法

elastic Job 引入jar 包衝突解決辦法

在使用Elastic job的時候,自己執行demo沒有問題,但是加入到專案中就會出現如下的問題

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'regCenter': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.curator.framework.CuratorFramework.blockUntilConnected(ILjava/util/concurrent/TimeUnit;)Z

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.sprucetec.rdw.api.BoneLauncher.main(BoneLauncher.java:16)
Caused by: java.lang.NoSuchMethodError: org.apache.curator.framework.CuratorFramework.blockUntilConnected(ILjava/util/concurrent/TimeUnit;)Z

at com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter.init(ZookeeperRegistryCenter.java:100)

我的eclipse  如下,找到自己剛匯入的包,看看有那些衝突,在用exclude去掉低版本,我的問題就解決了



我的問題解決了。