title: How to solve error message when try to start jpa on spring-boot?
body: <p>I have spring+jpa+rest application on spring-boot(try to implement)</p>
  
  <p>Application for spring-boot:</p>
  
  <pre><code>import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.boot.autoconfigure.domain.EntityScan;
  import org.springframework.context.annotation.ComponentScan;
  import org.springframework.context.annotation.ImportResource;
  import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
  
  import javax.persistence.PersistenceContext;
  
  @SpringBootApplication
  @ComponentScan("package")
  @EnableJpaRepositories(basePackages = "package.dao", entityManagerFactoryRef = "emf")
  @ImportResource("applicationContext.xml")
  public class Application {
      public static void main(String[] args) {
          SpringApplication.run(Application.class, args);
      }
  }
  </code></pre>
  
  <p>I have rest - controller</p>
  
  <pre><code>import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.web.bind.annotation.*;
  import package.myService;
  
  @RestController
  public class TestController {
      @Autowired
      private MyService myService;
  
      @PostMapping("create")
      public void test1(){
      }
  
      @PostMapping("{id}")
      public void test2(@RequestBody Object object){
      }
  
      @GetMapping("{id}")
      public void test3(@PathVariable Long id){
      }
  }
  </code></pre>
  
  <p>Entity:</p>
  
  <pre><code>import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.Id;
  import java.math.BigDecimal;
  
  @Entity
  public class MyEntity {
      @Id
      @GeneratedValue
      private Long id;
      private String name;
  
      public MyEntity() {
      }
  
      public MyEntity(Long id, String name) {
          this.id = id;
          this.name = name;
      }
  
      public Long getId() {
          return id;
      }
  
      public void setId(Long id) {
          this.id = id;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  }
  </code></pre>
  
  <p>Repository is:</p>
  
  <p>MyEntityRepository:</p>
  
  <pre><code>import org.springframework.data.jpa.repository.JpaRepository;
  import org.springframework.data.jpa.repository.Query;
  import org.springframework.data.repository.query.Param;
  import org.springframework.stereotype.Repository;
  
  @Repository
  public interface MyEntityRepositoryextends JpaRepository&lt;myEntity, Long&gt;{
      public void findNameById(@Param("id") Long id);
  }
  </code></pre>
  
  <p>application context in resouces:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:task="http://www.springframework.org/schema/task"
         xmlns:util="http://www.springframework.org/schema/util"
         xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
         xsi:schemaLocation="http://www.springframework.org/schema/beans 
         http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
         http://www.springframework.org/schema/task 
         http://www.springframework.org/schema/task/spring-task-4.3.xsd
         http://www.springframework.org/schema/context 
         http://www.springframework.org/schema/context/spring-context.xsd
         http://www.springframework.org/schema/util
         http://www.springframework.org/schema/util/spring-util-4.3.xsd
         http://www.springframework.org/schema/security http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"&gt;
  
      &lt;context:annotation-config /&gt;
      &lt;bean id="riskMetricService" class="ru.sbrf.risks.services.data.service.RiskMetricServiceImpl"/&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>If needs, I can add pom.xml</p>
  
  <blockquote>
    <p>I have error message when try to strat: APPLICATION FAILED TO START</p>
    
    <hr>
    
    <p>Description:</p>
    
    <p>Parameter 0 of constructor in
    org.springframework.data.rest.webmvc.RepositorySearchController
    required a bean named 'emf' that could not be found.</p>
    
    <p>Action:</p>
  </blockquote>
  
  <p>Where need to locate file with dbconnection configs?
  How to solve this error message?</p>