Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in GeoIntersectsQueriesWithPointTest #1104

Closed
evanchooly opened this issue Dec 9, 2016 · 5 comments
Closed

NPE in GeoIntersectsQueriesWithPointTest #1104

evanchooly opened this issue Dec 9, 2016 · 5 comments
Labels
Milestone

Comments

@evanchooly
Copy link
Member

java.lang.NullPointerException
at org.mongodb.morphia.mapping.Mapper.toMongoObject(Mapper.java:634)
at org.mongodb.morphia.query.FieldCriteria.(FieldCriteria.java:64)
at org.mongodb.morphia.query.FieldCriteria.(FieldCriteria.java:31)
at org.mongodb.morphia.query.StandardGeoFieldCriteria.(StandardGeoFieldCriteria.java:30)
at org.mongodb.morphia.query.FieldEndImpl.intersects(FieldEndImpl.java:161)
at org.mongodb.morphia.query.FieldEndImpl.intersects(FieldEndImpl.java:26)
at org.mongodb.morphia.query.GeoIntersectsQueriesWithPointTest.shouldFindAPointThatExactlyMatchesTheQueryPoint(GeoIntersectsQueriesWithPointTest.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

@evanchooly evanchooly added the bug label Dec 9, 2016
@evanchooly evanchooly added this to the 1.4.0 milestone Dec 9, 2016
@evanchooly evanchooly changed the title NPE in GeoIntersectsQueriesWithPointTest.shouldFindAPointThatExactlyMatchesTheQueryPoint() NPE in GeoIntersectsQueriesWithPointTest Dec 9, 2016
@crzo
Copy link

crzo commented Dec 17, 2016

Hey there,

the following could also be related to the problem (stated above):

Error converting value(Point{coordinates=[-5.05058008432389, 28.7679330743513]}) to reference. java.lang.NullPointerException at org.mongodb.morphia.mapping.Mapper.toMongoObject(Mapper.java:634) at org.mongodb.morphia.query.FieldCriteria.<init>(FieldCriteria.java:64) at org.mongodb.morphia.query.FieldCriteria.<init>(FieldCriteria.java:31) at org.mongodb.morphia.query.StandardGeoFieldCriteria.<init>(StandardGeoFieldCriteria.java:30) at org.mongodb.morphia.query.FieldEndImpl.near(FieldEndImpl.java:211) at org.mongodb.morphia.query.FieldEndImpl.near(FieldEndImpl.java:25)

seems there is also a problem with "$near"

@ibyxz
Copy link

ibyxz commented Feb 10, 2017

i have the same problem

@ManuelHaag
Copy link

Same issue here. The Mapper looks for an ID field of Point, but getMappedIdField returns null of course.
On a side note, the Point.class has both an @Embedded and an @Entity(noClassnameStored = true) annotation, don't know if that's intended.

@anthonyjchriste
Copy link

I have the same problem trying to create queries using GeoJson.point() along with the $near query.

@EvanKnowles
Copy link

I get this NPE, but the queries still succeed as afterwards the object is parsed using toMongoObject(value, false);

It definitely looks like it goes into that branch because of the @entity annotation.

@evanchooly evanchooly modified the milestones: 1.4.0, 1.5.0 Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants