Hi there,--I am trying to follow this post: http://www.informit.com/guides/content.aspx?g=java&seqNum=639And when I run the Main application it shows:Exception in thread "main" java.lang.NoSuchMethodError: com.mongodb.DBRef.<init>(Lcom/mongodb/DB;Ljava/lang/String;Ljava/lang/Object;)Vat com.google.code.morphia.mapping.Mapper.keyToRef(Mapper.java:559)at com.google.code.morphia.mapping.ReferenceMapper.writeSingle(ReferenceMapper.java:51)at com.google.code.morphia.mapping.ReferenceMapper.toDBObject(ReferenceMapper.java:45)at com.google.code.morphia.mapping.Mapper.writeMappedField(Mapper.java:529)at com.google.code.morphia.mapping.Mapper.toDBObject(Mapper.java:442)at com.google.code.morphia.mapping.Mapper.toDBObject(Mapper.java:426)at com.google.code.morphia.DatastoreImpl.entityToDBObj(DatastoreImpl.java:674)at com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:722)at com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:793)at com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:787)at gpms.gui.MorphiaReferenceExample.main(MorphiaReferenceExample.java:81)What can be the reason for this issue and how to solve it.
You received this message because you are subscribed to the Google Groups "Morphia" group.
To unsubscribe from this group and stop receiving emails from it, send an email to morphia+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
HI Justin,I am using mongo-java-driver-3.0.0.jar.
yeah I update the Maven dependency to Morphia 1.0.0 Still can't say why this mapping issue is occurring? I could not save the Family collection but the User collection is saving correctly.The Family class is :@Entitypublic class Family {@Idprivate ObjectId id;private String surname;@Referenceprivate User dad;@Referenceprivate User mom;@Referenceprivate List<User> children = new ArrayList<User>();
The problem may be due to cleaning up the Maven Repo. Yes, Justin I did clean up and Project >> clean and Maven Update so it is working fine now.Thanks for the help.