You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Getter
@Setter
@Entity(value = "roomupgrade",noClassnameStored = true)
public class RoomUpgrade {
@Id
@Property("id")
private String reservationId;
private int hotelId;
private String upgradeStatus;
private long upgradeTime;
private long itineraryId;
private String brand;
public RoomUpgrade() {
super();
}
public RoomUpgrade(String reservationId, int hotelId, String upgradeStatus,long upgradeTime, long itineraryId,
String brand) {
this.reservationId = reservationId;
this.hotelId = hotelId;
this.upgradeStatus = upgradeStatus;
this.upgradeTime = upgradeTime;
this.itineraryId = itineraryId;
this.brand = brand;
}
}
Then when run project, I got this error
java.lang.NullPointerException: Cannot invoke "dev.morphia.mapping.codec.pojo.EntityModel.getType()" because "this.root" is null
at dev.morphia.internal.PathTarget.failValidation(PathTarget.java:137) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.internal.PathTarget.resolve(PathTarget.java:166) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.internal.PathTarget.translatedPath(PathTarget.java:106) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.experimental.filters.Filter.path(Filter.java:156) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.experimental.filters.Filter.encode(Filter.java:60) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.MorphiaQuery.lambda$getQueryDocument$2(MorphiaQuery.java:337) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.aggregation.experimental.codecs.ExpressionHelper.document(ExpressionHelper.java:36) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.MorphiaQuery.getQueryDocument(MorphiaQuery.java:334) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.MorphiaQuery.toDocument(MorphiaQuery.java:242) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.MorphiaQuery.iterable(MorphiaQuery.java:291) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.MorphiaQuery.prepareCursor(MorphiaQuery.java:320) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.MorphiaQuery.iterator(MorphiaQuery.java:200) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.Query.iterator(Query.java:262) ~[morphia-core-2.2.1.jar:?]
By looking into more details, it seems caused by
java.lang.NullPointerException: Cannot invoke "com.mongodb.client.MongoCollection.find(org.bson.conversions.Bson)" because "updated" is null
at dev.morphia.query.MorphiaQuery.iterable(MorphiaQuery.java:308) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.MorphiaQuery.prepareCursor(MorphiaQuery.java:320) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.MorphiaQuery.iterator(MorphiaQuery.java:200) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.Query.iterator(Query.java:262) ~[morphia-core-2.2.1.jar:?]
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, team
I have an Entity
Then when run project, I got this error
java.lang.NullPointerException: Cannot invoke "dev.morphia.mapping.codec.pojo.EntityModel.getType()" because "this.root" is null
at dev.morphia.internal.PathTarget.failValidation(PathTarget.java:137) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.internal.PathTarget.resolve(PathTarget.java:166) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.internal.PathTarget.translatedPath(PathTarget.java:106) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.experimental.filters.Filter.path(Filter.java:156) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.experimental.filters.Filter.encode(Filter.java:60) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.MorphiaQuery.lambda$getQueryDocument$2(MorphiaQuery.java:337) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.aggregation.experimental.codecs.ExpressionHelper.document(ExpressionHelper.java:36) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.MorphiaQuery.getQueryDocument(MorphiaQuery.java:334) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.MorphiaQuery.toDocument(MorphiaQuery.java:242) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.MorphiaQuery.iterable(MorphiaQuery.java:291) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.MorphiaQuery.prepareCursor(MorphiaQuery.java:320) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.MorphiaQuery.iterator(MorphiaQuery.java:200) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.Query.iterator(Query.java:262) ~[morphia-core-2.2.1.jar:?]
By looking into more details, it seems caused by
java.lang.NullPointerException: Cannot invoke "com.mongodb.client.MongoCollection.find(org.bson.conversions.Bson)" because "updated" is null
at dev.morphia.query.MorphiaQuery.iterable(MorphiaQuery.java:308) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.MorphiaQuery.prepareCursor(MorphiaQuery.java:320) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.MorphiaQuery.iterator(MorphiaQuery.java:200) ~[morphia-core-2.2.1.jar:?]
at dev.morphia.query.Query.iterator(Query.java:262) ~[morphia-core-2.2.1.jar:?]
Can I ask some helps?
Beta Was this translation helpful? Give feedback.
All reactions