Created on 01-26-2018 04:52 PM - edited 08-17-2019 09:51 PM
I am trying to start metron rest in ambari cluster with cent os 7 ec2 amazon instance nodes. When I start metron rest I get the below error in metorn rest node log file.
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) ... 28 more Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.mysql.jdbc.Driver at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ... 41 more Caused by: java.lang.IllegalStateException: Cannot load driver class: com.mysql.jdbc.Driver at org.springframework.util.Assert.state(Assert.java:392) at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.determineDriverClassName(DataSourceProperties.java:214) at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.initializeDataSourceBuilder(DataSourceProperties.java:174) at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:42) at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Tomcat.dataSource(DataSourceConfiguration.java:53) 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) ... 42 more
What could be the issue. I have installed and configured mysql database proerly on the node. And mysql jdbc jar has been downloaded in the node and configured the path in configuration as below.
Created 01-26-2018 05:25 PM
Can you please check the PATH where the MySQL connection driver is present to verify if it has proper read permission?
Also please check if you can put the mysql-connection-java*.jar in some common location like: (instead of "/home/centos") else other users might not be able to read the jar file.
Example:
# cd $METRON_HOME/lib # wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.45.tar.gz # tar xf mysql-connector-java-5.1.41.tar.gz
.
Created 01-26-2018 05:25 PM
Can you please check the PATH where the MySQL connection driver is present to verify if it has proper read permission?
Also please check if you can put the mysql-connection-java*.jar in some common location like: (instead of "/home/centos") else other users might not be able to read the jar file.
Example:
# cd $METRON_HOME/lib # wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.45.tar.gz # tar xf mysql-connector-java-5.1.41.tar.gz
.
Created 01-28-2018 11:14 PM
Or you can try installing the mysql-connector-java driver to some common location from where every user has atleast read access to it like:
Example:
# ls -l /usr/local/bin/mysql-connector-java-5.1.41-bin.jar -rw-r--r--. 1 root root 992808 Jan 15 02:08 /usr/local/bin/mysql-connector-java-5.1.41-bin.jar
Created 02-05-2018 06:56 AM
@Jay Kumar SenSharma : Thanks for the response. It solved the issue. I moved the lib jar to /usr/local/bin and gave ownership and permission to the metron user account. Now it worked.