Hello list,
I've installed Metron via Ambari and everything works except the
Metron
REST interface. It fails with the following error message: "Cannot
load
driver class: com.mysql.jdbc.Driver". I got the MySQL configuration
items
from here:
https://github.com/apache/incubator-metron/tree/master/metro
n-interface/metron-rest. Any ideas on what might be going wrong?
The full log:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.4.1.RELEASE)
2017-05-08T10:16:46.408 ERROR
[org.springframework.boot.SpringApplication]
- Application startup failed
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error
creating bean with name 'webSecurityConfig': Unsatisfied dependency
expressed through field 'dataSource'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating
bean with name 'dataSource' defined in class path resource
[org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]:
Bean instantiation via factory method failed; nested exception is
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.annotation.AutowiredAnnota
tionBeanPostProcessor$AutowiredFieldElement.inject(A
utowiredAnnotationBeanPostProcessor.java:569)
at
org.springframework.beans.factory.annotation.InjectionMetada
ta.inject(InjectionMetadata.java:88)
at
org.springframework.beans.factory.annotation.AutowiredAnnota
tionBeanPostProcessor.postProcessPropertyValues(AutowiredAnn
otationBeanPostProcessor.java:349)
at
org.springframework.beans.factory.support.AbstractAutowireCa
pableBeanFactory.populateBean(AbstractAutowireCapableBeanFac
tory.java:1219)
at
org.springframework.beans.factory.support.AbstractAutowireCa
pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at
org.springframework.beans.factory.support.AbstractAutowireCa
pableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at
org.springframework.beans.factory.support.AbstractBeanFactor
y$1.getObject(AbstractBeanFactory.java:306)
at
org.springframework.beans.factory.support.DefaultSingletonBe
anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.AbstractBeanFactor
y.doGetBean(AbstractBeanFactory.java:302)
at
org.springframework.beans.factory.support.AbstractBeanFactor
y.getBean(AbstractBeanFactory.java:197)
at
org.springframework.beans.factory.support.DefaultListableBea
nFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:751)
at
org.springframework.context.support.AbstractApplicationConte
xt.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
at
org.springframework.context.support.AbstractApplicationConte
xt.refresh(AbstractApplicationContext.java:541)
at
org.springframework.boot.context.embedded.EmbeddedWebApplica
tionContext.refresh(EmbeddedWebApplicationContext.java:122)
at
org.springframework.boot.SpringApplication.refresh(SpringApp
lication.java:761)
at
org.springframework.boot.SpringApplication.refreshContext(Sp
ringApplication.java:371)
at
org.springframework.boot.SpringApplication.run(SpringApplica
tion.java:315)
at
org.springframework.boot.SpringApplication.run(SpringApplica
tion.java:1186)
at
org.springframework.boot.SpringApplication.run(SpringApplica
tion.java:1175)
at
org.apache.metron.rest.MetronRestApplication.main(MetronRest
Application.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
ssorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.springframework.boot.loader.MainMethodRunner.run(MainMet
hodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.
java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.
java:50)
at org.springframework.boot.loader.PropertiesLauncher.main(
PropertiesLauncher.java:525)
Caused by: org.springframework.beans.factory.BeanCreationException:
Error
creating bean with name 'dataSource' defined in class path resource
[org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]:
Bean instantiation via factory method failed; nested exception is
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.ConstructorResolve
r.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at
org.springframework.beans.factory.support.AbstractAutowireCa
pableBeanFactory.instantiateUsingFactoryMethod(AbstractAutow
ireCapableBeanFactory.java:1128)
at
org.springframework.beans.factory.support.AbstractAutowireCa
pableBeanFactory.createBeanInstance(AbstractAut
owireCapableBeanFactory.java:1023)
at
org.springframework.beans.factory.support.AbstractAutowireCa
pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
at
org.springframework.beans.factory.support.AbstractAutowireCa
pableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at
org.springframework.beans.factory.support.AbstractBeanFactor
y$1.getObject(AbstractBeanFactory.java:306)
at
org.springframework.beans.factory.support.DefaultSingletonBe
anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.AbstractBeanFactor
y.doGetBean(AbstractBeanFactory.java:302)
at
org.springframework.beans.factory.support.AbstractBeanFactor
y.getBean(AbstractBeanFactory.java:202)
at
org.springframework.beans.factory.config.DependencyDescripto
r.resolveCandidate(DependencyDescriptor.java:207)
at
org.springframework.beans.factory.support.DefaultListableBea
nFactory.doResolveDependency(DefaultListableBeanFactory.java:1128)
at
org.springframework.beans.factory.support.DefaultListableBea
nFactory.resolveDependency(DefaultListableBeanFactory.java:1056)
at
org.springframework.beans.factory.annotation.AutowiredAnnota
tionBeanPostProcessor$AutowiredFieldElement.inject(A
utowiredAnnotationBeanPostProcessor.java:566)
... 27 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.SimpleInstantiatio
nStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at
org.springframework.beans.factory.support.ConstructorResolve
r.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 39 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.DataSourceProper
ties.determineDriverClassName(DataSourceProperties.java:214)
at
org.springframework.boot.autoconfigure.jdbc.DataSourceProper
ties.initializeDataSourceBuilder(DataSourceProperties.java:174)
at
org.springframework.boot.autoconfigure.jdbc.DataSourceConfig
uration.createDataSource(DataSourceConfiguration.java:42)
at
org.springframework.boot.autoconfigure.jdbc.DataSourceConfig
uration$Tomcat.dataSource(DataSourceConfiguration.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
ssorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.springframework.beans.factory.support.SimpleInstantiatio
nStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 40 more