java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long

Spring JIRA | Scott Cote | 4 years ago
  1. 0

    org.springframework.data.mongodb.core.mapreduce.MapReduceCounts appears to be typed incorrectly which causes MapReduceResults.parseCounts to fail. MapReduceCounts uses ints to store the output of the M/R result counts however the MongoDB server appears to return a long (see link and CPP code below). {code} Jan 13, 2012 11:14:13 PM org.apache.catalina.core.ApplicationContext log SEVERE: Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract com.extjs.gxt.ui.client.data.PagingLoadResult com.ibbs.bbx.diagnostics.report.client.DocsisCapabilityService.getFilteredSubscriberModems(int,int,com.extjs.gxt.ui.client.data.FilterPagingLoadConfig)' threw an unexpected exception: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:385) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:588) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248) at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:227) at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer at org.springframework.data.mongodb.core.mapreduce.MapReduceResults.parseCounts(MapReduceResults.java:95) at org.springframework.data.mongodb.core.mapreduce.MapReduceResults.<init>(MapReduceResults.java:50) at org.springframework.data.mongodb.core.MongoTemplate.mapReduce(MongoTemplate.java:1026) at com.ibbs.unity.mongodb.services.ModemService.getDocsisCapByCmtsId(ModemService.java:241) at com.ibbs.bbx.diagnostics.report.server.DocsisCapabilityServiceImpl.getDocsisCapabilities(DocsisCapabilityServiceImpl.java:55) at com.ibbs.bbx.diagnostics.report.server.DocsisCapabilityServiceImpl.getFilteredSubscriberModems(DocsisCapabilityServiceImpl.java:136) 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.reflect.Method.invoke(Method.java:597) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569) ... 19 more {code} Log output of the actual values: {code} INFO | jvm 1 | 2012/01/13 23:14:13 | input: 55668 class: java.lang.Long INFO | jvm 1 | 2012/01/13 23:14:13 | emit: 55668 class: java.lang.Long INFO | jvm 1 | 2012/01/13 23:14:13 | output: 52 class: java.lang.Long {code} Total number of documents in the collection being queried: 20,057,139 Relevant MongoDB source: https://github.com/mongodb/mongo/blob/master/src/mongo/db/commands/mr.cpp {code} 1036 long long num = 0; 1037 long long inReduce = 0; 1140 countsBuilder.appendNumber( "input" , num ); 1141 countsBuilder.appendNumber( "emit" , state.numEmits() ); 1162 long long finalCount = state.postProcessCollection(op, pm); state.appendResults( result ); timingBuilder.append( "total" , t.millis() ); result.append( "timeMillis" , t.millis() ); 1167 countsBuilder.appendNumber( "output" , finalCount ); {code}

    Spring JIRA | 5 years ago | Ben Hall
    com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract com.extjs.gxt.ui.client.data.PagingLoadResult com.ibbs.bbx.diagnostics.report.client.DocsisCapabilityService.getFilteredSubscriberModems(int,int,com.extjs.gxt.ui.client.data.FilterPagingLoadConfig)' threw an unexpected exception: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    org.springframework.data.mongodb.core.mapreduce.MapReduceCounts appears to be typed incorrectly which causes MapReduceResults.parseCounts to fail. MapReduceCounts uses ints to store the output of the M/R result counts however the MongoDB server appears to return a long (see link and CPP code below). {code} Jan 13, 2012 11:14:13 PM org.apache.catalina.core.ApplicationContext log SEVERE: Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract com.extjs.gxt.ui.client.data.PagingLoadResult com.ibbs.bbx.diagnostics.report.client.DocsisCapabilityService.getFilteredSubscriberModems(int,int,com.extjs.gxt.ui.client.data.FilterPagingLoadConfig)' threw an unexpected exception: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:385) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:588) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248) at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:227) at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer at org.springframework.data.mongodb.core.mapreduce.MapReduceResults.parseCounts(MapReduceResults.java:95) at org.springframework.data.mongodb.core.mapreduce.MapReduceResults.<init>(MapReduceResults.java:50) at org.springframework.data.mongodb.core.MongoTemplate.mapReduce(MongoTemplate.java:1026) at com.ibbs.unity.mongodb.services.ModemService.getDocsisCapByCmtsId(ModemService.java:241) at com.ibbs.bbx.diagnostics.report.server.DocsisCapabilityServiceImpl.getDocsisCapabilities(DocsisCapabilityServiceImpl.java:55) at com.ibbs.bbx.diagnostics.report.server.DocsisCapabilityServiceImpl.getFilteredSubscriberModems(DocsisCapabilityServiceImpl.java:136) 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.reflect.Method.invoke(Method.java:597) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569) ... 19 more {code} Log output of the actual values: {code} INFO | jvm 1 | 2012/01/13 23:14:13 | input: 55668 class: java.lang.Long INFO | jvm 1 | 2012/01/13 23:14:13 | emit: 55668 class: java.lang.Long INFO | jvm 1 | 2012/01/13 23:14:13 | output: 52 class: java.lang.Long {code} Total number of documents in the collection being queried: 20,057,139 Relevant MongoDB source: https://github.com/mongodb/mongo/blob/master/src/mongo/db/commands/mr.cpp {code} 1036 long long num = 0; 1037 long long inReduce = 0; 1140 countsBuilder.appendNumber( "input" , num ); 1141 countsBuilder.appendNumber( "emit" , state.numEmits() ); 1162 long long finalCount = state.postProcessCollection(op, pm); state.appendResults( result ); timingBuilder.append( "total" , t.millis() ); result.append( "timeMillis" , t.millis() ); 1167 countsBuilder.appendNumber( "output" , finalCount ); {code}

    Spring JIRA | 5 years ago | Ben Hall
    com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract com.extjs.gxt.ui.client.data.PagingLoadResult com.ibbs.bbx.diagnostics.report.client.DocsisCapabilityService.getFilteredSubscriberModems(int,int,com.extjs.gxt.ui.client.data.FilterPagingLoadConfig)' threw an unexpected exception: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
  4. 0

    error writing vector of longs to pail - caused by inconsistent treatment of integer types?

    GitHub | 4 years ago | robinkraft
    cascading.tuple.TupleException: unable to sink into output identifier: /tmp/cascalog_reserved/0b005123-f278-4b53-8e74-a6d5f2d4594a

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      java.lang.Integer cannot be cast to java.lang.Long

      at org.springframework.data.mongodb.core.mapreduce.MapReduceResults.parseTiming()
    2. Spring Data MongoDB - Core
      MongoTemplate.mapReduce
      1. org.springframework.data.mongodb.core.mapreduce.MapReduceResults.parseTiming(MapReduceResults.java:80)
      2. org.springframework.data.mongodb.core.mapreduce.MapReduceResults.<init>(MapReduceResults.java:49)
      3. org.springframework.data.mongodb.core.MongoTemplate.mapReduce(MongoTemplate.java:1026)
      3 frames
    3. com.mumbuku.util
      CategoryBrandDataLoader.run
      1. com.mumbuku.util.CategoryBrandDataLoader.defineAverageBrandCategoryPrice(CategoryBrandDataLoader.java:333)
      2. com.mumbuku.util.CategoryBrandDataLoader.run(CategoryBrandDataLoader.java:258)
      2 frames
    4. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:680)
      1 frame