Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Metron-Rest start failed

avatar
New Member

I use Metron-0.4.3 with an Ambari Cluster, but when I start Metron-Rest, the log shows:

18/03/25 22:19:51 INFO context.ContextLoader: Root WebApplicationContext: initialization completed in 6871 ms 18/03/25 22:19:52 INFO servlet.FilterRegistrationBean: Mapping filter: 'characterEncodingFilter' to: [/*] 18/03/25 22:19:52 INFO servlet.FilterRegistrationBean: Mapping filter: 'hiddenHttpMethodFilter' to: [/*] 18/03/25 22:19:52 INFO servlet.FilterRegistrationBean: Mapping filter: 'httpPutFormContentFilter' to: [/*] 18/03/25 22:19:52 INFO servlet.FilterRegistrationBean: Mapping filter: 'requestContextFilter' to: [/*] 18/03/25 22:19:52 INFO servlet.DelegatingFilterProxyRegistrationBean: Mapping filter: 'springSecurityFilterChain' to: [/*] 18/03/25 22:19:52 INFO servlet.ServletRegistrationBean: Mapping servlet: 'dispatcherServlet' to [/] 18/03/25 22:20:04 INFO jpa.LocalContainerEntityManagerFactoryBean: Building JPA container EntityManagerFactory for persistence unit 'default' 18/03/25 22:20:05 INFO jpa.LocalContainerEntityManagerFactoryBean: Initialized JPA EntityManagerFactory for persistence unit 'default' 18/03/25 22:20:06 WARN embedded.AnnotationConfigEmbeddedWebApplicationContext: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sensorIndexingConfigServiceImpl' defined in URL [jar:file:/usr/metron/0.4.3/lib/metron-rest-0.4.3.jar!/org/apache/metron/rest/service/impl/SensorIndexingConfigServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'client' defined in class path resource [org/apache/metron/rest/config/ZookeeperConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.curator.framework.CuratorFramework]: Factory method 'client' threw exception; nested exception is java.lang.NullPointerException: connectionString cannot be null 18/03/25 22:20:06 INFO jpa.LocalContainerEntityManagerFactoryBean: Closing JPA EntityManagerFactory for persistence unit 'default' Mar 25, 2018 10:20:06 PM org.apache.catalina.core.StandardService stopInternal INFO: Stopping service Tomcat Mar 25, 2018 10:20:06 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads WARNING: The web application [ROOT] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: 18/03/25 22:20:06 WARN boot.SpringApplication: Error handling failed (Error creating bean with name 'delegatingApplicationListener' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'metaDataSourceAdvisor': Cannot resolve reference to bean 'methodSecurityMetadataSource' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' is defined) 18/03/25 22:20:06 ERROR boot.SpringApplication: Application startup failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sensorIndexingConfigServiceImpl' defined in URL [jar:file:/usr/metron/0.4.3/lib/metron-rest-0.4.3.jar!/org/apache/metron/rest/service/impl/SensorIndexingConfigServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'client' defined in class path resource [org/apache/metron/rest/config/ZookeeperConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.curator.framework.CuratorFramework]: Factory method 'client' threw exception; nested exception is java.lang.NullPointerException: connectionString cannot be null 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:1148) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1051) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:751) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) at org.apache.metron.rest.MetronRestApplication.main(MetronRestApplication.java:29) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'client' defined in class path resource [org/apache/metron/rest/config/ZookeeperConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.curator.framework.CuratorFramework]: Factory method 'client' threw exception; nested exception is java.lang.NullPointerException: connectionString cannot be null at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1128) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1023) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:207) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1128) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1056) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741) ... 19 more Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.curator.framework.CuratorFramework]: Factory method 'client' threw exception; nested exception is java.lang.NullPointerException: connectionString cannot be null at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ... 32 more Caused by: java.lang.NullPointerException: connectionString cannot be null at org.apache.metron.guava.base.Preconditions.checkNotNull(Preconditions.java:229) at org.apache.curator.ensemble.fixed.FixedEnsembleProvider.<init>(FixedEnsembleProvider.java:39) at org.apache.curator.framework.CuratorFrameworkFactory$Builder.connectString(CuratorFrameworkFactory.java:193) at org.apache.curator.framework.CuratorFrameworkFactory.newClient(CuratorFrameworkFactory.java:94) at org.apache.curator.framework.CuratorFrameworkFactory.newClient(CuratorFrameworkFactory.java:79) at org.apache.metron.rest.config.ZookeeperConfig.client(ZookeeperConfig.java:55) at org.apache.metron.rest.config.ZookeeperConfig$EnhancerBySpringCGLIB$f3f9596e.CGLIB$client$0(<generated>) at org.apache.metron.rest.config.ZookeeperConfig$EnhancerBySpringCGLIB$f3f9596e$FastClassBySpringCGLIB$b1301973.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356) at org.apache.metron.rest.config.ZookeeperConfig$EnhancerBySpringCGLIB$f3f9596e.client(<generated>) 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) ... 33 more

Who can help me? What's wrong with it?

1 ACCEPTED SOLUTION

avatar
Super Collaborator
5 REPLIES 5

avatar
Super Collaborator

Hello @Wang Ao, can you check in Ambari (Services -> Metron -> Configs -> REST) that the Metron REST settings are properly configured? Here's an example that you can use:

Metron JDBC Driver = org.h2.Driver
Metron JDBC password = root
Metron JDBC platform = h2
Metron JDBC URL = jdbc:h2:file:~/metrondb
Metron JDBC username = root
Active Spring profiles = dev

avatar
New Member

Hello, thank you for help me. I have solved this problem. I installed with metron-rest deb package, but it lost rest_application...Now metron-rest start normally, but another problem arised:In mysql database, metron.users table does not have any user. Can you help me?

avatar
New Member

@Wang Ao since you used the metron-rest deb to install , You can try manually creating those users, refer below docs

https://docs.hortonworks.com/HDPDocuments/HCP1/HCP-1.4.1/bk_installation/content/installing_rest_app...

avatar
Super Collaborator

Sure.. refer to these steps for creating the table and adding the user.

https://docs.hortonworks.com/HDPDocuments/HCP1/HCP-1.4.1/bk_installation/content/installing_rest_app...

avatar
New Member

Thank you very much!~~