Uploaded image for project: 'Spring Data MongoDB'
  1. Spring Data MongoDB
  2. DATAMONGO-830

NPE during cache warmup in CustomConversions

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.3 (Babbage SR2)
    • Component/s: Core
    • Labels:
      None

      Description

      The cache seems not to be able to handle heavy load during its warmup phase.
      We use 42 threads in parallel in performance test scenario (a lot of database operations in each thread) and got the NPE in one of five runs.

      Using a ConcurrentHashMap solves the problem.

      java.lang.NullPointerException
           at org.springframework.data.mongodb.core.convert.CustomConversions.getCustomReadTarget(CustomConversions.java:329)
           at org.springframework.data.mongodb.core.convert.CustomConversions.hasCustomReadTarget(CustomConversions.java:283)
           at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:200)
           at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:187)
           at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:183)
           at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:77)
           at org.springframework.data.mongodb.core.MongoTemplate$ReadDbObjectCallback.doWith(MongoTemplate.java:1975)
           at org.springframework.data.mongodb.core.MongoTemplate.executeFindOneInternal(MongoTemplate.java:1626)
           at org.springframework.data.mongodb.core.MongoTemplate.doFindOne(MongoTemplate.java:1446)
           at org.springframework.data.mongodb.core.MongoTemplate.findById(MongoTemplate.java:539)
           at org.springframework.data.mongodb.repository.support.SimpleMongoRepository.findOne(SimpleMongoRepository.java:100)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:606)
           at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:358)
           at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:343)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
           at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
           at com.sun.proxy.$Proxy26.findOne(Unknown Source)
           at de.is24.offer.mongodb.evaluation.ReadYourOwnDataRightTask.countNumberOfInvalidResults(ReadYourOwnDataRightTask.java:34)
           at de.is24.offer.mongodb.evaluation.ReadYourOwnDataRightTask$$FastClassByCGLIB$$2b453a69.invoke(<generated>)
           at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
           at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
           at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:95)
           at java.util.concurrent.FutureTask.run(FutureTask.java:262)
           at java.lang.Thread.run(Thread.java:744)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                thomasd Thomas Darimont
                Reporter:
                bjoern.voss Björn Voß
                Last updater:
                Thomas Darimont
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: