title: DataSource error with Springboot
body: <p>I have an issue when running a spring boot project of mine:</p>
  
  <p>I am using Vaadin for UI and Maven for dependecies. The Database is a MySQL one and I have followed the instructions from (<a href="https://spring.io/guides/gs/accessing-data-mysql/" rel="nofollow noreferrer">https://spring.io/guides/gs/accessing-data-mysql/</a>) closely.</p>
  
  <blockquote>
    <p>Description:</p>
    
    <p>Parameter 0 of constructor in
    org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
    required a bean of type 'javax.sql.DataSource' that could not be
    found.
      - Bean method 'dataSource' not loaded because @ConditionalOnProperty (spring.datasource.jndi-name) did not find property 'jndi-name'
      - Bean method 'dataSource' not loaded because @ConditionalOnBean (types: org.springframework.boot.jta.XADataSourceWrapper;
    SearchStrategy: all) did not find any beans</p>
    
    <p>Action:</p>
    
    <p>Consider revisiting the conditions above or defining a bean of type
    'javax.sql.DataSource' in your configuration.</p>
  </blockquote>
  
  <p><strong>With --debug:</strong>
  Full auto-configuration report (too long for this post)</p>
  
  <p><a href="https://pastebin.com/DEsAkpLi" rel="nofollow noreferrer">https://pastebin.com/DEsAkpLi</a></p>
  
  <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;ethereum&lt;/groupId&gt;
      &lt;artifactId&gt;TradeSafe&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;name&gt;TradeSafe&lt;/name&gt;
      &lt;description&gt;TradeSafe WebService&lt;/description&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.9.RELEASE&lt;/version&gt;
          &lt;relativePath /&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;/properties&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;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.web3j&lt;/groupId&gt;
              &lt;artifactId&gt;core&lt;/artifactId&gt;
              &lt;version&gt;3.2.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.web3j&lt;/groupId&gt;
              &lt;artifactId&gt;web3j-spring-boot-starter&lt;/artifactId&gt;
              &lt;version&gt;1.5.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
              &lt;artifactId&gt;vaadin-spring-boot-starter&lt;/artifactId&gt;
          &lt;/dependency&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;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
                  &lt;artifactId&gt;vaadin-bom&lt;/artifactId&gt;
                  &lt;version&gt;8.0.0&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&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;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;spring-releases&lt;/id&gt;
              &lt;name&gt;Spring Releases&lt;/name&gt;
              &lt;url&gt;https://repo.spring.io/libs-release&lt;/url&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
              &lt;id&gt;org.jboss.repository.releases&lt;/id&gt;
              &lt;name&gt;JBoss Maven Release Repository&lt;/name&gt;
              &lt;url&gt;https://repository.jboss.org/nexus/content/repositories/releases&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p><strong>TradeLayout.java</strong></p>
  
  <pre><code>package ethereum.tradesafe;
  
  import java.util.List;
  
  import javax.annotation.PostConstruct;
  
  import org.springframework.beans.factory.annotation.Autowired;
  
  import com.vaadin.spring.annotation.SpringComponent;
  import com.vaadin.ui.GridLayout;
  
  
  @SpringComponent
  public class TradeLayout extends GridLayout{
      @Autowired
      private TradeRepo repo;
  
      @PostConstruct
      void init() {
          update();
      }
  
      private void setTrades(List&lt;Trade&gt; trades) {
          removeAllComponents();
  
          trades.forEach(trade-&gt; addComponent(new TradeItemLayout(trade)));
  
      }
  
      public Object add(Trade trade) {
          repo.save(trade);
          update();
          return null;
      }
  
      private void update() {
          setTrades((List&lt;Trade&gt;) repo.findAll());
  
      }
  
  }
  </code></pre>
  
  <p><strong>TradeRepo.java</strong></p>
  
  <pre><code>package ethereum.tradesafe;
  
  import org.springframework.data.repository.CrudRepository;
  
  public interface TradeRepo extends CrudRepository&lt;Trade, Long&gt;{
  
  }
  </code></pre>
  
  <p>application.properties</p>
  
  <pre><code>spring.jpa.hibernate.ddl-auto=none
  spring.datasource.url=jdbc:mysql://nottheproblem/db_tradesafe
  spring.datasource.username=nottheproblem
  spring.datasource.password=nottheproblem
  </code></pre>