I have a Vaadin application and I'm trying to incorporate Spring Data Neo4j 4 into it. In my Vaadin app, I use JPAContainer to access some MySQL database, and JPAContainer depends on the javax.persistence jar in order to access it. When I incorporate SDN 4, I've been able to successfully persist Node and relationship entities into my remote Neo4j server, but my JPAContainer fails. This is the error I receive:
[EL Info]: 2015-08-12 08:57:44.44--ServerSession(1000914620)--EclipseLink, version: Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd
[EL Info]: connection: 2015-08-12 08:57:46.984--ServerSession(1000914620)--file:/Users/jlam/Downloads/johnson-master/Sprint02d/target/Sprint02d-1.0-SNAPSHOT/WEB-INF/classes/_Basil_v1_PersistenceUnit login successful
Aug 12, 2015 8:58:01 AM com.vaadin.server.DefaultErrorHandler doDefault
SEVERE: java.lang.NoSuchMethodError: javax.persistence.EntityManager.getCriteriaBuilder()Ljavax/persistence/criteria/CriteriaBuilder; at com.vaadin.addon.jpacontainer.provider.LocalEntityProvider.createFilteredQuery(LocalEntityProvider.java:379) at com.vaadin.addon.jpacontainer.provider.CachingSupport.getIds(CachingSupport.java:477) at com.vaadin.addon.jpacontainer.provider.CachingSupport$FilterCacheEntry.getAllIds(CachingSupport.java:408) at com.vaadin.addon.jpacontainer.provider.CachingSupport.getAllEntityIdentifiers(CachingSupport.java:750) at com.vaadin.addon.jpacontainer.provider.CachingMutableLocalEntityProvider.getAllEntityIdentifiers(CachingMutableLocalEntityProvider.java:106)
It says I successfully connected to MySQL database. I've checked by getting the size of my JPAContainers and it matches the size of my database. I believe the issue is that SDN 4 also comes with some other version of the javax.persistence dependency and in this version, the CriteriaBuilder method does not exist. JPAContainer is getting confused and is using the SDN 4 javax.persistence dependency rather than the one that is listed javax.persistence-2.1.0.jar in my dependencies folder.
When I remove the my SDN 4 dependency, everything works fine. Any ideas on if my theory is correct or how to overcome this issue? Thanks!