title: Error creating bean with name 'dataSource' + Spring Boot + Hibernate
body: <p>I have a few problems starting up the spring guide on how to access mysql data (see this link: <a href="https://spring.io/guides/gs/accessing-data-mysql/" rel="nofollow noreferrer">https://spring.io/guides/gs/accessing-data-mysql/</a>). I adjusted the classes slightly, so I have this code:</p>
  
  <ol>
  <li><p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0      http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;gs-mysql-data&lt;/artifactId&gt;
      &lt;version&gt;0.1.0&lt;/version&gt;
  
      &lt;parent&gt;
  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
  &lt;version&gt;1.5.6.RELEASE&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;dependencies&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
  &lt;/dependency&gt;
  
  &lt;!-- JPA Data (We are going to use Repositories, Entities, Hibernate, etc...) --&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
  &lt;/dependency&gt;
  
  &lt;!-- Use MySQL Connector-J --&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;mysql&lt;/groupId&gt;
      &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-jdbc&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;properties&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
  &lt;/properties&gt;
  
  &lt;build&gt;
  &lt;plugins&gt;
      &lt;plugin&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
      &lt;/plugin&gt;
  &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p> </p></li>
  </ol>
  
  <p>I am using this mainController:
  <strong>MainController.java</strong></p>
  
  <pre><code>import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.*;
  
  import com.resource.iPbackend.UserRepository;
  import com.resource.iPbackend.User;
  
  @Controller
  @RequestMapping(path = "/main")
  public class MainController {
  
      @Autowired
      private UserRepository userRepository;
  
      @RequestMapping(path = "/reg", method = RequestMethod.POST)
      public @ResponseBody String regNewUser (@RequestParam String firstName,      @RequestParam String lastName, @RequestParam String email, @RequestParam String password, @RequestParam String username) {
          User n = new User();
          n.setFirstName(firstName);
          n.setLastName(lastName);
          n.setEmail(email);
          n.setPassword(password);
          n.setUsername(username);
          userRepository.save(n);
          return "User is stored in database: " + n;
      }
  
      @GetMapping(path = "/all")
      public @ResponseBody Iterable&lt;User&gt; getAllUsers() {
          return userRepository.findAll();
      }
  }
  </code></pre>
  
  <p>Together with this repository:
  <strong>UserRepository.java</strong></p>
  
  <pre><code>import org.springframework.data.repository.CrudRepository;
  import org.springframework.stereotype.Repository;
  import com.resource.iPbackend.User;
  
  
  @Repository
  public interface UserRepository extends CrudRepository&lt;User, Long&gt; {
  
  }
  </code></pre>
  
  <p>And this Entity:
  <strong>User.java</strong></p>
  
  <pre><code>import org.springframework.data.annotation.Id;
  
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  @Entity
  public class User {
  
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      private Integer id;
      private String firstName;
      private String lastName;
      private String email;
      private String password;
      private String username;
  
      public Integer getId() {
          return id;
      }
  
      public void setId(Integer id) {
          this.id = id;
      }
  
      public String getFirstName() {
          return firstName;
      }
  
      public void setFirstName(String firstName) {
          this.firstName = firstName;
      }
  
      public String getLastName() {
          return lastName;
      }
  
      public void setLastName(String lastName) {
          this.lastName = lastName;
      }
  
      public String getEmail() {
          return email;
      }
  
      public void setEmail(String email) {
          this.email = email;
      }
  
      public String getPassword() {
          return password;
      }
  
      public void setPassword(String password) {
          this.password = password;
      }
  
      public String getUsername() {
          return username;
      }
  
      public void setUsername(String username) {
          this.username = username;
      }
  }
  </code></pre>
  
  <p>And finally I have this Application.class:</p>
  
  <pre><code>@EnableAutoConfiguration
  @SpringBootApplication
  public class IPbackendApplication {
  
  public static void main(String[] args) {
  
      SpringApplication.run(IPbackendApplication.class, args);
  }
  }
  </code></pre>
  
  <p>I am getting this error:</p>
  
  <p>org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': 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$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.IllegalArgumentException: URL must start with 'jdbc'
      at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
      at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]</p>
  
  <p>Thanks for your help!</p>