title: Spring Boot 2.0.0.M4 & Hibernate 5.2.11.Final could not find bean of type EntityManagerFactoryBuilder
body: <p>I have clearly what seems to be some configuration issue, but I've been unable to resolve this myself. I have hope you guys could help me?</p>
  
  <p>None of the examples I find indicate having to create a bean for EntityManagerFactoryBuilder so what's the issue.</p>
  
  <p>I am attempting to configure completely separate datasources, including different entity managers etc.. </p>
  
  <p>My Error:</p>
  
  <hr>
  
  <p>APPLICATION FAILED TO START</p>
  
  <hr>
  
  <p>Description:</p>
  
  <p>Parameter 0 of method entityManagerFactory required a bean of type 'org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder' that could not be found.</p>
  
  <p>Action:</p>
  
  <p>Consider defining a bean of type 'org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder' in your configuration.</p>
  
  <p>My DataSourceConfiguration</p>
  
  <pre><code>package ...;
  
  import org.springframework.beans.factory.annotation.Qualifier;
  import org.springframework.boot.context.properties.ConfigurationProperties;
  import org.springframework.boot.jdbc.DataSourceBuilder;
  import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.context.annotation.Primary;
  import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
  import org.springframework.transaction.annotation.EnableTransactionManagement;
  
  import javax.sql.DataSource;
  
  @Configuration
  @EnableTransactionManagement
  public class DataSourceConfiguration {
  
  
      @Primary
      @Bean()
      @ConfigurationProperties(prefix="spring.my.datasource")
      public DataSource myDataSource() {
          return DataSourceBuilder.create().build();
      }
  
  
  
      @Primary
      @Bean(name = "myEntityManager")
      public LocalContainerEntityManagerFactoryBean entityManagerFactory(EntityManagerFactoryBuilder factoryBuilder,
                                                                         @Qualifier("myEntityManager") DataSource bds) {
          ...
      }
  }
  </code></pre>
  
  <p>My Application</p>
  
  <pre><code>@SpringBootApplication(exclude = {
          DataSourceAutoConfiguration.class,
          HibernateJpaAutoConfiguration.class,
          JpaRepositoriesAutoConfiguration.class,
          DataSourceTransactionManagerAutoConfiguration.class
  })
  </code></pre>
  
  <p>My Pom</p>