Closed sergiofgonzalez closed 6 years ago
Same
Same problem
The OP looks like a class path issue (bad jar file maybe). Did you clear the maven cache?
I've cleaned my repository and download again via gradle & maven but the problem still happened
The problem comes from the binary classpath so check again pom and gradle setting. It works fined, thank you @dsyer
Is the database actually running? I don't see the same error as the OP if the database is unavailable, but the app won't start then either. Are we even talking about the same problem?
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
MySQL is on the classpath via mysql:mysql-connector-java
in the "complete" project. What do you mean? Is there actually an issue here? I guess not.
I solved this issue by deleting the m2 folder of MVN and re-caching all dependencies.
MySQL is on the classpath via
mysql:mysql-connector-java
in the "complete" project. What do you mean? Is there actually an issue here? I guess not.
Adding
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jdbc</artifactId>
</dependency>
gives the error stated above if the version of spring-boot-starter-parent is 2.1.2.RELEASE but works fine when it is 2.0.0.RELEASE.
Doesn't it looks like an issue?
Why would you add the JDBC starter? Anyway, it works for me, so no it doesn't look like an issue. Maybe you have a bad jar?
Why would you add the JDBC starter? Anyway, it works for me, so no it doesn't look like an issue. Maybe you have a bad jar?
I am just running on IDE. Because I need HikariDataSource class, I need to add jdbc thing.
HikariDataSource
is already included in the sample app (it is the default data source in Spring Boot 2). I would look at your Maven cache if I were you, to see if you can find the bad jar.
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
seems it may be version dependent. Have had this issue for a little while. Decided to try a version bump and the issue has gone away. Now using:
implementation('com.zaxxer:HikariCP:3.4.3') implementation('org.springframework.data:spring-data-jdbc:1.1.2.RELEASE') implementation('mysql:mysql-connector-java:8.0.17')
Was previously using: implementation('com.zaxxer:HikariCP:3.3.1')
EDIT:
This may be a problem with a dirty cache in intelliJ. I've since had a similar error and rebuilding the project within intelliJ resolved the issue: Build
-> Rebuild Project
If you use the code from the guide it comes with Hikari 3.4.1, Spring Data JDBC 2.2.3 and Mysql 8.0.18 (currently). So that should work too. You shouldn't need the explicit versions of any of those things (just Spring Boot).
I solved this problem by adding mysql connector dependency to my pom.xml file. lmao I forgot about connector.
use
this issue for me was caused by the version of mysql. all i had to do is add the version of mysql in pom.xml dependencies (in my case the verion is 8.0.25)
`
<artifactId>mysql-connector-java</artifactId>
<version>8.0.25</version>
`
make sure to reload the maven dependecies before your run
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:
If i downgrade the version of the
spring-boot-starter-parent
to2.0.0.RELEASE
the application works without problems.Thank you very much!
Sergio