title: Issues with Spring Boot + Oracle Database
body: <p>I'm new to Spring boot and trying to implement an example of Spring boot with Oracle DB for my learning purpose.Kindly guide me. I don't know what am I missing. Below is the error and I'm not able to resolve it.</p>
  
  <pre><code>***************************
  APPLICATION FAILED TO START
  ***************************
  
  Description:
  
  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
  
  
  Action:
  
  Consider revisiting the conditions above or defining a bean of type 'javax.sql.DataSource' in your configuration.
  </code></pre>
  
  <p>I have added the below dependencies in <strong>POM.xml</strong></p>
  
  <pre><code>&lt;dependencies&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;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-jdbc&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-jersey&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-validation&lt;/artifactId&gt;
      &lt;/dependency&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-web-services&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
          &lt;scope&gt;provided&lt;/scope&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.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.oracle&lt;/groupId&gt;
          &lt;artifactId&gt;ojdbc14&lt;/artifactId&gt;
          &lt;version&gt;10.2.0.4.0&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>Below is the <strong>application.properties</strong></p>
  
  <pre><code>#Tomcat Server Properties
  server.port = 8099
  
  #Oracle Database Properties
  oracle.username=xxxxx
  oracle.password=xxxxx
  oracle.url=jdbc:oracle:thin:@localhost:1521:XE
  spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
  
  #Hibernate Properties
  spring.jpa.database-platform=org.hibernate.dialect.OracleDialect
  </code></pre>
  
  <p>This is my <strong>SpringBootLearningApplication.java</strong></p>
  
  <pre><code>package com.learning.springboot.main;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
  import org.springframework.context.annotation.ComponentScan;
  
  @SpringBootApplication
  @ComponentScan(basePackages = "com.learning.springboot")
  @EnableAutoConfiguration(exclude=DataSourceAutoConfiguration.class)
  public class SpringBootLearningApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(SpringBootLearningApplication.class, args);
      }
  }
  </code></pre>
  
  <p><strong>UserRepository.java</strong></p>
  
  <pre><code>package com.learning.springboot.dao;
  
  import org.springframework.data.repository.CrudRepository;
  import org.springframework.stereotype.Repository;
  
  import com.learning.springboot.entity.User;
  
  @Repository
  public interface UserRepository extends CrudRepository&lt;User, String&gt; {
  
  }
  </code></pre>
  
  <p>And my controller class <strong>TestController.java</strong> </p>
  
  <pre><code>package com.learning.springboot.controller;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.web.bind.annotation.GetMapping;
  import org.springframework.web.bind.annotation.RestController;
  
  import com.learning.springboot.dao.UserRepository;
  import com.learning.springboot.entity.User;
  
      @RestController
      public class TestController {
  
          @Autowired
          UserRepository userRepository;
  
          @GetMapping("/welcome")
          public List&lt;User&gt; displayWelcomeMessage() {
  
              List&lt;User&gt; list = new ArrayList&lt;&gt;();
              userRepository.findAll().forEach(list::add);
              return list;
          }
  
      }
  </code></pre>
  
  <p>I think I am missing some configurations. Kindly guide.</p>