0

Recently I migrated from Jongo 0.4 to Jongo 1.0, and suddenly I started to receive this exception:

! java.lang.IllegalArgumentException: Unable to set objectid on class: class *Myclass*
! at org.jongo.ReflectiveObjectIdUpdater.updateField(ReflectiveObjectIdUpdater.java:72) ~[jongo-1.0.jar:na]
! at org.jongo.ReflectiveObjectIdUpdater.setObjectId(ReflectiveObjectIdUpdater.java:60) ~[jongo-1.0.jar:na]
! at org.jongo.Insert.preparePojo(Insert.java:71) ~[jongo-1.0.jar:na]
! at org.jongo.Insert.insert(Insert.java:56) ~[jongo-1.0.jar:na]
! at org.jongo.MongoCollection.insert(MongoCollection.java:140) ~[jongo-1.0.jar:na]
! at org.jongo.MongoCollection.insert(MongoCollection.java:132) ~[jongo-1.0.jar:na]
...

That means that Jongo now has problems setting a private field, which in 0.4 wasn't a problem.

Is there some reason for this limitation?

demongolem
  • 9,474
  • 36
  • 90
  • 105
Juraj
  • 161
  • 1
  • 2
  • 11

1 Answers1

0

Jongo stills 'support' private properties in v1.0

Nevertheless due to a regression it was unable to handle private id field.

This has been fixed in v1.1 : https://github.com/bguerout/jongo/issues/198

If you have a Maven pom.xml, just update it with :

<dependencies>
  <dependency>
   <groupId>org.jongo</groupId>
   <artifactId>jongo</artifactId>
   <version>1.1</version>
  </dependency>
 ...
</dependencies>
Benoît Guérout
  • 1,977
  • 3
  • 21
  • 30