Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » EclipseLink not working with Latest MongoDB
icon5.gif  EclipseLink not working with Latest MongoDB [message #1710830] Fri, 09 October 2015 15:16 Go to next message
John Roberts is currently offline John RobertsFriend
Messages: 4
Registered: October 2013
Junior Member
I'm using EclipseLink 2.6.1RC and Mongo 3.1.0. I've also tried with EclipseLink 2.5.2 and get the same issue.

I get a NoSuchMethodError when trying to create an EntityManager.

Any idea what I'm doing wrong?

Thank you!



Exception in thread "main" javax.persistence.PersistenceException: java.lang.NoSuchMethodError: com.mongodb.Mongo.getVersion()Ljava/lang/String;
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:815)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:205)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:305)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:337)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:303)

<dependency org="org.mongodb" name="mongodb-driver" rev="latest.integration"/>
<dependency org="org.mongodb" name="mongodb-driver-core" rev="latest.integration"/>
<dependency org="org.mongodb" name="mongodb-driver-async" rev="latest.integration"/>
<dependency org="org.mongodb" name="mongo-java-driver" rev="latest.integration"/>
<dependency org="org.eclipse.persistence" name="org.eclipse.persistence.jpa" rev="latest.integration" />
<dependency org="org.eclipse.persistence" name="org.eclipse.persistence.nosql" rev="latest.integration" />
Re: EclipseLink not working with Latest MongoDB [message #1710843 is a reply to message #1710830] Fri, 09 October 2015 16:12 Go to previous messageGo to next message
Jeff Yemin is currently offline Jeff YeminFriend
Messages: 1
Registered: October 2015
Junior Member
Eclipse Link's MongoDB support depends on a quite old version of the MongoDB Java driver: 2.7.3 to be exact. The 3.0 driver, which you are trying to use, made several changes that broke binary compatibility, hence the major release bump. Until Eclipse Link is updated to support the 3.0 driver, please stick with a 2.x release of the Java driver. The latest is currently 2.13.3, which is binary compatible with 2.7.3.

The dependency is:

<dependency org="org.mongodb" name="mongo-java-driver" rev="2.13.3"/>


Regards,
Jeff Yemin
MongoDB Java Driver Lead
Re: EclipseLink not working with Latest MongoDB [message #1710865 is a reply to message #1710843] Fri, 09 October 2015 21:29 Go to previous messageGo to next message
John Roberts is currently offline John RobertsFriend
Messages: 4
Registered: October 2013
Junior Member
Hi Jeff,

Thanks so much for taking the time to respond. I appreciate it. This helps knowing that I'm not doing something wrong.

This presents a problem for me as the larger application that I'm part of is using the latest Mongo driver so it's hard for me to build my part with the older driver.

Have you heard that the EclipseLink folks are working on this?

Thanks,
John
Re: EclipseLink not working with Latest MongoDB [message #1710867 is a reply to message #1710843] Fri, 09 October 2015 21:44 Go to previous message
John Roberts is currently offline John RobertsFriend
Messages: 4
Registered: October 2013
Junior Member
Are you aware of a different JPA package that works with the latest MongoDB driver? I really like EclipseLink, but I need to make my code work with the latest driver.
Previous Topic:Cant get NamedEntityGraph to work....
Next Topic:nullable unidirectionnal mapping not inserted
Goto Forum:
  


Current Time: Fri Mar 05 16:54:17 GMT 2021

Powered by FUDForum. Page generated in 0.01310 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top