栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

安装Apache Atlas遇到的错误

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

安装Apache Atlas遇到的错误

安装apache atlas,启动atlas server报错,查看logs/atlas.20220524-115239.out文件:

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'graphTransactionInterceptor' defined in URL [jar:file:/usr/local/service/atlas/server/webapp/atlas/WEB-INF/lib/atlas-repository-2.1.0.jar!/org/apache/atlas/GraphTransactionInterceptor.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'get' defined in org.apache.atlas.repository.graph.AtlasGraphProvider: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.atlas.repository.graphdb.AtlasGraph]: Factory method 'get' threw exception; nested exception is org.apache.atlas.repository.RepositoryException: Max retries exceeded. Failed to obtain graph instance after 3 retries
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1198)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1100)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1136)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1064)
        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
        ... 45 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'get' defined in org.apache.atlas.repository.graph.AtlasGraphProvider: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.atlas.repository.graphdb.AtlasGraph]: Factory method 'get' threw exception; nested exception is org.apache.atlas.repository.RepositoryException: Max retries exceeded. Failed to obtain graph instance after 3 retries
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1178)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1072)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1136)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1064)
        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
        ... 59 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.atlas.repository.graphdb.AtlasGraph]: Factory method 'get' threw exception; nested exception is org.apache.atlas.repository.RepositoryException: Max retries exceeded. Failed to obtain graph instance after 3 retries
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
        ... 72 more
Caused by: org.apache.atlas.repository.RepositoryException: Max retries exceeded. Failed to obtain graph instance after 3 retries
        at org.apache.atlas.repository.graph.AtlasGraphProvider.retry(AtlasGraphProvider.java:127)
        at org.apache.atlas.repository.graph.AtlasGraphProvider.get(AtlasGraphProvider.java:102)
        at org.apache.atlas.repository.graph.AtlasGraphProvider$$EnhancerBySpringCGLIB$$51f36e5b.CGLIB$get$1()
        at org.apache.atlas.repository.graph.AtlasGraphProvider$$EnhancerBySpringCGLIB$$51f36e5b$$FastClassBySpringCGLIB$$6a41e2ff.invoke()
        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)
        at org.apache.atlas.repository.graph.AtlasGraphProvider$$EnhancerBySpringCGLIB$$51f36e5b.get()
        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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)

这个日志比较粗略,只能判断是SpringBoot在创建图引擎相关对象时报错。

然后查看 logs/application.log,发现如下报错:

       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 org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:58)
        ... 97 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.janusgraph.diskstorage.es.rest.RestElasticSearchClient
        at org.janusgraph.diskstorage.es.rest.RestClientSetup.getElasticSearchClient(RestClientSetup.java:107)
        at org.janusgraph.diskstorage.es.rest.RestClientSetup.connect(RestClientSetup.java:75)
        at org.janusgraph.diskstorage.es.ElasticSearchSetup$1.connect(ElasticSearchSetup.java:51)
        at org.janusgraph.diskstorage.es.ElasticSearchIndex.interfaceConfiguration(ElasticSearchIndex.java:437)
        at org.janusgraph.diskstorage.es.ElasticSearchIndex.(ElasticSearchIndex.java:324)

java.lang.NoClassDefFoundError: Could not initialize class说明是类的初始化出现错误,怀疑是jar包版本不对。

在atlas server的lib目录下(/usr/local/atlas/server/webapp/atlas/WEB-INF/lib)查看es相关的包,找到如下包:

janusgraph-es-0.5.1.jar

这个包的作用应该是连接elasticsearch并进行操作,所以其必然依赖elasticsearch的相关包,是不是这几个包缺失呢,查看lib目录,发现:


有相关的包。

是不是版本不对呢?

于是去Maven上查看janusgraph-es-0.5.1.jar依赖的es版本。

发现,其依赖的es版本是7.6.1:


于是把es相关包换成7.6.1

重新启动atlas,启动成功。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/930307.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号