title: Spring Tool Suite(3.6.3.SR1) starter project cannot connect to mongoldb
body: <p>I have a very strange problem with my spring starter project:
  I am using STS, the version of it is 3.6.3.SR1. I also install mongodb, the version of it is 2.6.7.
  I want to use STS to connect to mongodb. So, I tried the project from the tutorial:
  File -> new -> Import Spring Getting Started Content. Then I choose "Accessing Data Mongodb". Then I run the gs-accessing-data-mongodb-complete, it worked perfectly. The tutorial is here [enter link description here][1]
  However, when I created a spring starter project, the Dependencies I choose MongoDB, Rest Repositories. I copy exactly the same code from above but it doesn't work. </p>
  
  <p>Can anyone help me?</p>
  
  <p>Pom.xml
  
  http://maven.apache.org/xsd/maven-4.0.0.xsd">
      4.0.0</p>
  
  <pre><code>&lt;groupId&gt;org.test&lt;/groupId&gt;
  &lt;artifactId&gt;demo&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  
  &lt;name&gt;demo&lt;/name&gt;
  &lt;description&gt;Demo project for Spring Boot&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.2.1.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;start-class&gt;demo.DemoApplication&lt;/start-class&gt;
      &lt;java.version&gt;1.7&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-data-mongodb&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-rest&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;/dependencies&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>
  
  <p>package demo;</p>
  
  <p>import org.springframework.data.annotation.Id;</p>
  
  <p>public class Customer {</p>
  
  <pre><code>@Id
  private String id;
  
  private String firstName;
  private String lastName;
  
  public Customer() {}
  
  public Customer(String firstName, String lastName) {
      this.firstName = firstName;
      this.lastName = lastName;
  }
  
  @Override
  public String toString() {
      return String.format(
              "Customer[id=%s, firstName='%s', lastName='%s']",
              id, firstName, lastName);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>import java.util.List;</p>
  
  <p>import org.springframework.data.mongodb.repository.MongoRepository;</p>
  
  <p>public interface CustomerRepository extends MongoRepository {</p>
  
  <pre><code>public Customer findByFirstName(String firstName);
  public List&lt;Customer&gt; findByLastName(String lastName);
  </code></pre>
  
  <p>}</p>
  
  <p>public class DemoApplication implements CommandLineRunner {</p>
  
  <pre><code>@Autowired
  private CustomerRepository repository;
  
  public static void main(String[] args) {
      SpringApplication.run(DemoApplication.class, args);
  }
  
  
  @Override
  public void run(String... args) throws Exception {
  
      repository.deleteAll();
  
      // save a couple of customers
      repository.save(new Customer("Alice", "Smith"));
      repository.save(new Customer("Bob", "Smith"));
  
      // fetch all customers
      System.out.println("Customers found with findAll():");
      System.out.println("-------------------------------");
      for (Customer customer : repository.findAll()) {
          System.out.println(customer);
      }
      System.out.println();
  
      // fetch an individual customer
      System.out.println("Customer found with findByFirstName('Alice'):");
      System.out.println("--------------------------------");
      System.out.println(repository.findByFirstName("Alice"));
  
      System.out.println("Customers found with findByLastName('Smith'):");
      System.out.println("--------------------------------");
      for (Customer customer : repository.findByLastName("Smith")) {
          System.out.println(customer);
      }
  
  }
  </code></pre>
  
  <p>}</p>