title: cannot use eclipselink with spring boot
body: <p>I have a Spring Boot 1.4 app, which I'm trying to use Eclipselink instead Hibernate.<br>
  For now, this is what I did:<br>
  Removed Hibernate from deps</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
    &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
    &lt;exclusions&gt;
      &lt;exclusion&gt;
        &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
        &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
      &lt;/exclusion&gt;
      &lt;exclusion&gt;
        &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
        &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
      &lt;/exclusion&gt;
    &lt;/exclusions&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Added eclipselink</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
    &lt;artifactId&gt;eclipselink&lt;/artifactId&gt;
    &lt;version&gt;2.6.3&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Configured <code>JpaBaseConfiguration</code></p>
  
  <pre><code>@Configuration
  public class JpaConfiguration extends JpaBaseConfiguration {
  
  protected JpaConfiguration(DataSource dataSource, JpaProperties properties, ObjectProvider&lt;JtaTransactionManager&gt; jtaTransactionManagerProvider) {
      super(dataSource, properties, jtaTransactionManagerProvider);
  }
  
   @Bean
  public LocalContainerEntityManagerFactoryBean entityManagerFactory(final EntityManagerFactoryBuilder builder, @Autowired DataSource dataSource) {
      final LocalContainerEntityManagerFactoryBean ret = builder.dataSource(dataSource)
              .packages("com.inkdrop.app.domain.models")
              .persistenceUnit("chathub-perstence-unit")
              .properties(getVendorProperties())
              .build();
  
      return ret;
  }
  
  @Override
  protected AbstractJpaVendorAdapter createJpaVendorAdapter() {
      return new EclipseLinkJpaVendorAdapter();
  }
  
  @Override
  protected Map&lt;String, Object&gt; getVendorProperties() {
      return Collections.singletonMap("eclipselink.weaving", "false");
  }
  </code></pre>
  
  <p>when I run the app, it creates the tables in database (representing my models), and then, throws this error:</p>
  
  <pre><code>Caused by: java.lang.ClassCastException: org.eclipse.persistence.internal.jpa.metamodel.SingularAttributeImpl cannot be cast to javax.persistence.metamodel.PluralAttribute
          at org.eclipse.persistence.internal.jpa.querydef.FromImpl.join(FromImpl.java:485)
          at org.springframework.data.jpa.repository.query.QueryUtils.getOrCreateJoin(QueryUtils.java:596)
          at org.springframework.data.jpa.repository.query.QueryUtils.toExpressionRecursively(QueryUtils.java:524)
          at org.springframework.data.jpa.repository.query.JpaQueryCreator$PredicateBuilder.getTypedPath(JpaQueryCreator.java:332)
          at org.springframework.data.jpa.repository.query.JpaQueryCreator$PredicateBuilder.build(JpaQueryCreator.java:275)
          at org.springframework.data.jpa.repository.query.JpaQueryCreator.toPredicate(JpaQueryCreator.java:180)
          at org.springframework.data.jpa.repository.query.JpaQueryCreator.create(JpaQueryCreator.java:109)
          at org.springframework.data.jpa.repository.query.JpaQueryCreator.create(JpaQueryCreator.java:49)
          at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:109)
          at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:88)
          at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:73)
          at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$QueryPreparer.&lt;init&gt;(PartTreeJpaQuery.java:118)
          at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$CountQueryPreparer.&lt;init&gt;(PartTreeJpaQuery.java:241)
          at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.&lt;init&gt;(PartTreeJpaQuery.java:68)
          at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:103)
          at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:214)
  </code></pre>
  
  <p>I tried following <a href="https://github.com/dsyer/spring-boot-sample-data-eclipselink/blob/master/pom.xml" rel="nofollow">this</a> and <a href="http://blog.marcnuri.com/spring-data-jpa-eclipselink-configuring-spring-boot-to-use-eclipselink-as-the-jpa-provider/" rel="nofollow">this</a> tutorials, but didn't helped</p>