AE - Can't start Analytic backend with error one of either dataSource or dataSourceClassName must be specified

Document ID : KB000113413
Last Modified Date : 20/09/2018
Show Technical Document Details
Issue:
Analytic backend process terminate itself with the following error message:
2018-09-07 15:17:09.712  INFO 20385 --- [main] o.f.core.internal.util.VersionPrinter    : Flyway 4.0.3 by Boxfuse
2018-09-07 15:17:09.713 ERROR 20385 --- [main] com.zaxxer.hikari.HikariDataSource       : one of either dataSource, dataSourceClassName, or jdbcUrl and driverClassName must be specified
2018-09-07 15:17:09.715  WARN 20385 --- [main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: one of either dataSource or dataSourceClassName must be specified
2018-09-07 15:17:09.717  INFO 20385 --- [main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2018-09-07 15:17:09.763  INFO 20385 --- [main] utoConfigurationReportLoggingInitializer : 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2018-09-07 15:17:09.770 ERROR 20385 --- [main] o.s.boot.SpringApplication               : Application startup failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: one of either dataSource or dataSourceClassName must be specified
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1634)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	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:197)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:297)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1080)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:857)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
	at com.automic.analytics.backend.BackendServer.run(BackendServer.java:29)
	at com.automic.analytics.backend.BackendRunner.run(BackendRunner.java:19)
	at com.automic.analytics.backend.Agent.startBackend(Agent.java:132)
	at com.automic.analytics.backend.Agent.beforeExecutorStarts(Agent.java:106)
	at com.uc4.ex.ExecutorLifecycle.startExecutor(ExecutorLifecycle.java:402)
	at com.uc4.ex.ExecutorLifecycle.execute(ExecutorLifecycle.java:111)
	at com.automic.analytics.backend.Agent.main(Agent.java:68)
	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.boot.loader.MainMethodRunner.run(MainMethodRunner.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:595)
Caused by: java.lang.IllegalArgumentException: one of either dataSource or dataSourceClassName must be specified
	at com.zaxxer.hikari.AbstractHikariConfig.validate(AbstractHikariConfig.java:779)
	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:102)
	at org.flywaydb.core.internal.util.jdbc.JdbcUtils.openConnection(JdbcUtils.java:50)
	at org.flywaydb.core.Flyway.execute(Flyway.java:1326)
	at org.flywaydb.core.Flyway.migrate(Flyway.java:917)
	at org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:66)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1692)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1630)
	... 30 common frames omitted

Datasource setting in backend application.properties
# JDBC connection string pointing at the Analytics datastore
Datasource.analytics.url=jdbc:postgresql://localhost:5432/analytics?tcpKeepAlive=true

# Username used to connect to the Analytics datastore
datasource.analytics.username=abc

# Password for the Analytics datastore user
datasource.analytics.password=***********

 
Cause:
- Data source setting issue:
Caused by: java.lang.IllegalArgumentException: one of either dataSource or dataSourceClassName must be specified

- Mistypo in the Datasource backend setting : Datasource.analytics.url
# JDBC connection string pointing at the Analytics datastore
Datasource.analytics.url=jdbc:postgresql://localhost:5432/analytics?tcpKeepAlive=true

 
Resolution:
- Update the he Datasource backend setting:
from: 
Datasource.analytics.url=jdbc:postgresql://localhost:5432/analytics?tcpKeepAlive=true


to:
datasource.analytics.url=jdbc:postgresql://localhost:5432/analytics?tcpKeepAlive=true

- Restart backend process