Announcement Announcement Module
Collapse
No announcement yet.
How to know the class that triggers this exception ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to know the class that triggers this exception ?

    I have countered many exceptions like this one below.

    As i understand it, it has the problem with the constructors when trying to create an object instance out mongo document.
    Sometimes i can assume which class that causes the error by feeling, and then adding empty default constructor or adjust the constructor property-name to fix it.

    But in this case, i dont know what class that causes this exception.
    Is there anyway i can find out which class's constructor is problematic ? I tried log4j.category.org.springframework.data.mongodb=DE BUG, but i still dont see it.

    Is there any way i can find out what class's constructor problem that actually causes this ?

    Code:
    java.lang.NullPointerException
    	at org.springframework.data.mongodb.core.convert.MappedConstructor.<init>(MappedConstructor.java:56)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:212)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:200)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter.getValueInternal(MappingMongoConverter.java:713)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter$1.doWithPersistentProperty(MappingMongoConverter.java:230)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter$1.doWithPersistentProperty(MappingMongoConverter.java:220)
    	at org.springframework.data.mapping.model.BasicPersistentEntity.doWithProperties(BasicPersistentEntity.java:173)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:220)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:200)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter.getValueInternal(MappingMongoConverter.java:713)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter$1.doWithPersistentProperty(MappingMongoConverter.java:230)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter$1.doWithPersistentProperty(MappingMongoConverter.java:220)
    	at org.springframework.data.mapping.model.BasicPersistentEntity.doWithProperties(BasicPersistentEntity.java:173)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:220)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:200)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter.getValueInternal(MappingMongoConverter.java:713)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter$1.doWithPersistentProperty(MappingMongoConverter.java:230)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter$1.doWithPersistentProperty(MappingMongoConverter.java:220)
    	at org.springframework.data.mapping.model.BasicPersistentEntity.doWithProperties(BasicPersistentEntity.java:173)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:220)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:200)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:164)
    	at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:73)
    	at org.springframework.data.mongodb.core.MongoTemplate$ReadDbObjectCallback.doWith(MongoTemplate.java:1693)
    	at org.springframework.data.mongodb.core.MongoTemplate.executeFindMultiInternal(MongoTemplate.java:1444)
    	at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:1259)
    	at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:1248)
    	at org.springframework.data.mongodb.core.MongoTemplate.find(MongoTemplate.java:471)

  • #2
    I solved it by debugging the app. You have a reference there to the class on which the constructor is being searched on. If I remember correctly, the NPE is because no suitable constructor is found.

    Comment

    Working...
    X