Home » Support » Forum » Tutorial issue

Tutorial issue

#1

Ok, so I'm stuck on the Eclipse tutorial. I have a number of other projects running in Eclipse right now, so I created the new project as specified in Step 1

The only thing I did differently was in steps two and three I used the source folder "Tutorial/src" which is what I used to create the project in Step 1;

Here's the output;

Exception in thread "main" [ObjectDB 2.5.4_04] javax.persistence.PersistenceException
Ambiguous entity name - Point (used by [point.Point,tutorial.Point]) (error 307)
  at com.objectdb.jpa.JpaQuery.getSingleResult(JpaQuery.java:754)
  at tutorial.Main.main(Main.java:29)
Caused by: com.objectdb.o.UserException: Ambiguous entity name - Point (used by [point.Point,tutorial.Point])
  at com.objectdb.o.MSG.d(MSG.java:61)
  at com.objectdb.o.TYM.ar(TYM.java:845)
  at com.objectdb.o.TYM.ay(TYM.java:998)
  at com.objectdb.o.TRS.g(TRS.java:177)
  at com.objectdb.o.SYR.q(SYR.java:259)
  at com.objectdb.o.SYR.n(SYR.java:188)
  at com.objectdb.o.QRC.<init>(QRC.java:152)
  at com.objectdb.o.QRM.Vb(QRM.java:270)
  at com.objectdb.o.MST.Vb(MST.java:949)
  at com.objectdb.o.WRA.Vb(WRA.java:311)
  at com.objectdb.o.WSM.Vb(WSM.java:115)
  at com.objectdb.o.QRR.g(QRR.java:244)
  at com.objectdb.o.QRR.f(QRR.java:153)
  at com.objectdb.jpa.JpaQuery.getSingleResult(JpaQuery.java:747)
  ... 1 more

 

#2

As the error message indicates you have two different entity classes with the same name:

  • point.Point
  • tutorial.Point

Remove one of them from your project and start with a new empty database.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#3

Looking through the code, there is no other 'point' declared. I deleted the db and reran, success this time. Strange

#4

There was probably another Point class previously and the database had a memory of it.

By starting with a new database that memory was erased.

Anyway, good that it works now, and unless you move the Point class, this error should not return.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login