Java. lang. classCastException: java. lang. integer cannot be cast to java. lang. longat org. springframework. data. mongodb. core. mapreduce. mapReduceResults. parseTiming (MapReduceResults. java: 80) at org. springframework. data. mongodb. core. mapreduce. mapReduceResults. <init> (MapReduceResults. java: 49) at org. springframework. data. mongodb. core. invalid template. mapReduce (elastic template. java: 1026) at org. springframework. data. Mongodb. core. invalid template. mapReduce (elastic template. java: 981) at com. jd. console. service. log. testLogServiceImpl. mrGroupWfNamesTest (TestLogServiceImpl. java: 95) at sun. reflect. nativeMethodAccessorImpl. invoke0 (Native Method) at sun. reflect. nativeMethodAccessorImpl. invoke (NativeMethodAccessorImpl. java: 39) at sun. reflect. delegatingMethodAccessorImpl. invoke (DelegatingMethodAccessorImpl. java: 25) at java. lang. r Eflect. method. invoke (Method. java: 597) at org. junit. runners. model. frameworkMethod $1. runReflectiveCall (FrameworkMethod. java: 44) at org. junit. internal. runners. model. reflectiveCallable. run (ReflectiveCallable. java: 15) at org. junit. runners. model. frameworkMethod. invokeExplosively (FrameworkMethod. java: 41) at org. junit. internal. runners. statements. invokeMethod. evaluate (InvokeMethod. java: 20) at org. springframewor K. test. context. junit4.statements. runBeforeTestMethodCallbacks. evaluate (RunBeforeTestMethodCallbacks. java: 74) at org. springframework. test. context. junit4.statements. runAfterTestMethodCallbacks. evaluate (RunAfterTestMethodCallbacks. java: 83) at org. springframework. test. context. junit4.statements. springRepeat. evaluate (SpringRepeat. java: 72) at org. springframework. test. context. junit4.SpringJUnit4ClassRunner. r UnChild (SpringJUnit4ClassRunner. java: 231) at org. junit. runners. blockJUnit4ClassRunner. runChild (BlockJUnit4ClassRunner. java: 49) at org. junit. runners. parentRunner $ 3.run( ParentRunner. java: 193) at org. junit. runners. parentRunner $1. schedule (ParentRunner. java: 52) at org. junit. runners. parentRunner. runChildren (ParentRunner. java: 191) at org. junit. runners. parentRunner. access $000 (ParentRunner. java: 42) at org. junit. Runners. parentRunner $2. evaluate (ParentRunner. java: 184) at org. springframework. test. context. junit4.statements. runBeforeTestClassCallbacks. evaluate (RunBeforeTestClassCallbacks. java: 61) at org. springframework. test. context. junit4.statements. runAfterTestClassCallbacks. evaluate (RunAfterTestClassCallbacks. java: 71) at org. junit. runners. parentRunner. run (ParentRunner. java: 236) at org. springframework. test. contex T. junit4.SpringJUnit4ClassRunner. run (SpringJUnit4ClassRunner. java: 174) at org. eclipse. jdt. internal. junit4.runner. JUnit4TestReference. run (JUnit4TestReference. java: 49) at org. eclipse. jdt. internal. junit. runner. testExecution. run (TestExecution. java: 38) at org. eclipse. jdt. internal. junit. runner. remoteTestRunner. runTests (RemoteTestRunner. java: 467) at org. eclipse. jdt. internal. junit. runner. remoteTestRunner. runT Ests (RemoteTestRunner. java: 683) at org. eclipse. jdt. internal. junit. runner. remoteTestRunner. run (RemoteTestRunner. java: 390) at org. eclipse. jdt. internal. junit. runner. remoteTestRunner. main (RemoteTestRunner. java: 197) 1.0.1.RELEASE <dependency> <artifactId> spring-data-mongodb </artifactId> <groupId> org. springframework. data </groupId> <version> 1.0.1.RELEASE </version> </dependency> in the source code org. springframework. d Ata. mongodb. core. mapreduce. in MapReduceResults, create an object constructor. When new, call parseTimepublic MapReduceResults (List <T> mappedResults, DBObject rawResults) {Assert. notNull (mappedResults); Assert. notNull (rawResults); this. mappedResults = mappedResults; this. rawResults = rawResults; parseTiming (rawResults); parseCounts (rawResults); if (rawResults. get ("result ")! = Null) {this. outputCollection = (String) rawResults. get ("result") ;}} the following data rawResults during parseTime conversion: {"serverUsed": "192.168.232.62: 27017", "results ": [// too much data is omitted], "timeMillis": 39780, "timing": {"mapTime": 28962, "emitLoop": 39780, "reduceTime": 2861, "mode": "mixed", "total": 39780 }," counts ": {" input ": 1922720," emit ": 1922720," reduce ": 19236, "output": 9}, "OK ": 1.0} when this line of code (Long) timing. get ("mapTime") is strongly converted, an error is returned. If (timing! = Null) {if (timing. get ("mapTime ")! = Null & timing. get ("emitLoop ")! = Null & timing. get ("total ")! = Null) {mapReduceTiming = new MapReduceTiming (Long) timing. get ("mapTime"), (Integer) timing. get ("emitLoop"), (Integer) timing. get ("total") ;}} else {mapReduceTiming = new MapReduceTiming (-1,-1,-1);} the individual changed to 1.0.3 and there was no such problem. <Dependency> <artifactId> spring-data-mongodb </artifactId> <groupId> org. springframework. data </groupId> <version> 1.0.3.RELEASE </version> </dependency> runs successfully.