question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Example fails to start with HikariDataSource related error

See original GitHub issue

Hi!

First of all, thank you very much for all the work youā€™re putting in the examples and docs: It really makes the difference when learning new topics! šŸ„‡

When running the example in the ./complete/ directory, with the only changed being done on my side is the update of the username/pass for the database iā€™m getting the following error: Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource

See the complete start log below:

2018-04-16 09:15:00.638  INFO 33768 --- [           main] hello.Application                        : Starting Application on MW7IF7J13IEI10 with PID 33768 (C:\Users\sergio.f.gonzalez\git\spring-examples-repo\complete\target\classes started by sergio.f.gonzalez in C:\Users\sergio.f.gonzalez\git\spring-examples-repo\complete)
2018-04-16 09:15:00.641  INFO 33768 --- [           main] hello.Application                        : No active profile set, falling back to default profiles: default
2018-04-16 09:15:00.678  INFO 33768 --- [           main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@222114ba: startup date [Mon Apr 16 09:15:00 CEST 2018]; root of context hierarchy
2018-04-16 09:15:01.451  INFO 33768 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$e0ae4b3f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-04-16 09:15:01.675  INFO 33768 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2018-04-16 09:15:01.699  INFO 33768 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2018-04-16 09:15:01.700  INFO 33768 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.29
2018-04-16 09:15:01.703  INFO 33768 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener   : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\dev-sw\jdk1.8.0_162\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_162/bin/server;C:/Program Files/Java/jre1.8.0_162/bin;C:/Program Files/Java/jre1.8.0_162/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\dev-sw\apache-maven-3.5.3\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\dev-sw\Heroku\bin;C:\Program Files (x86)\git\cmd;C:\dev-sw\Vagrant\bin;C:\Users\sergio.f.gonzalez\Downloads\~delete.me~\ec2-api-tools\ec2-api-tools-1.7.5.1\bin;C:\Program Files\OpenVPN\bin;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\GNU\GnuPG\pub;C:\Program Files\Amazon\AWSCLI\;C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\;C:\Users\sergio.f.gonzalez\AppData\Local\Microsoft\WindowsApps;C:\dev-sw\Git\cmd;;C:\dev-sw\spring-tool-suite\spring-tool-suite-3.9.2.RELEASE-e4.7.2-win32-x86_64\sts-bundle\sts-3.9.2.RELEASE;;.]
2018-04-16 09:15:01.797  INFO 33768 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2018-04-16 09:15:01.797  INFO 33768 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1120 ms
2018-04-16 09:15:01.907  INFO 33768 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Servlet dispatcherServlet mapped to [/]
2018-04-16 09:15:01.911  INFO 33768 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-04-16 09:15:01.912  INFO 33768 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-04-16 09:15:01.912  INFO 33768 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-04-16 09:15:01.912  INFO 33768 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2018-04-16 09:15:01.967 ERROR 33768 --- [           main] com.zaxxer.hikari.HikariConfig           : Failed to load driver class com.mysql.jdbc.Driver from HikariConfig class classloader sun.misc.Launcher$AppClassLoader@764c12b6
2018-04-16 09:15:01.970  WARN 33768 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0; 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$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource
2018-04-16 09:15:01.972  INFO 33768 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2018-04-16 09:15:01.985  INFO 33768 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-04-16 09:15:01.989 ERROR 33768 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource:

    Property: driverclassname
    Value: com.mysql.jdbc.Driver
    Origin: "driverClassName" from property source "source"
    Reason: Unable to set value for property driver-class-name

Action:

Update your application's configuration

If i downgrade the version of the spring-boot-starter-parent to 2.0.0.RELEASE the application works without problems.

Thank you very much!

Sergio

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:19

github_iconTop GitHub Comments

9reactions
toannh0104commented, May 24, 2018

The problem is MySQL binary is not in classpath yet. You can add a MySQL connection string into the application.properties file without add MySQL driver dependency to reproduce the issue. Iā€™m using initial but I donā€™t have that problem anymore

4reactions
Parth94commented, Nov 17, 2019

remove .driverClassName from data source builder instead add dependency of driver in pom also no need of spring-boot-starter-data-jdbc HikariDataSource will pick from there

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Spring Boot 2 Upgrade with JPA Failed to instantiate ...
I am able to use springboot with hikari. I do not see following class. Can you add and check? @Configuration @ConfigurationProperties(prefixĀ ...
Read more >
Resolving Failed to Configure a DataSource Error - Baeldung
In this short tutorial, we'll discuss what causes and what resolves the ā€œFailed to configure a DataSourceā€ error on a Spring Boot project....
Read more >
Bamboo doesn't start up with PostgreSQL errors: remaining ...
Bamboo fails to start up and the following errors appear inside the <Bamboo ... superuser connections at org.hibernate.hikaricp.internal.
Read more >
Spring Boot Reference Documentation
If you are getting started with Spring Boot or 'Spring' in general, start with the following topics: From scratch: Overview | Requirements |...
Read more >
HikariDataSource.getConnection is slow under load
For example, if a request against your database could execute in 10ms, then a single ... query response time will start to increase...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found