Skip to content
Advertisement

Spring Boot – Error creating bean with name ‘dataSource’ defined in class path resource

I have Spring Boot web application. It’s centered around RESTful approach. All configuration seems in place but for some reason MainController fails to handle request. It results in 404 error. How to fix it?

JavaScript

Application

JavaScript

ParserController

JavaScript

UPDATE

Seems like MySQL cannot be initialized by Spring….

JavaScript

UPDATE2

application.properties

JavaScript

UPDATE4

Seems lite controllers not responding eventhough @RequestMapping are set. Why might it be?

PS. It occurs when I run Maven’s lifecycle test. When running in degub mode in IntelliJ there is no error outputted.

UPDATE5

Also I use this DAO as explained in tutorial….

JavaScript

http://blog.netgloo.com/2014/10/27/using-mysql-in-spring-boot-via-spring-data-jpa-and-hibernate/

UPDATE6

I did changed my application properties. And tried every single combination but it refuses to work. ;(

Maven output:

JavaScript

Advertisement

Answer

Looks like the initial problem is with the auto-config.

If you don’t need the datasource, simply remove it from the auto-config process:

JavaScript

Edit: If using @SpringBootApplication in your main class:

JavaScript
Advertisement