java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Integer
来源:互联网 发布:nginx 二级域名 编辑:程序博客网 时间:2024/04/28 19:14
- 此异常为类型转换错误:BigInteger–>Integer
错误场景:Hibernate查询数据条数count(*),查询出的数据类型为BigInteger,强转类型为Integer。
修改方法:**.intValue(),通过此方法将获取的BIgInteger转换为int。
异常详细内容:
java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Integer at com.cmdi.basicPlatform.dao.LogDao.selectLogCount(LogDao.java:56) at com.cmdi.basicPlatform.impl.LogServiceImpl.logList(LogServiceImpl.java:98) 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.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy47.logList(Unknown Source) at com.cmdi.basicPlatform.test.TestAccount.testSaveAccount(TestAccount.java:44) 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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.springframework.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.runChild(SpringJUnit4ClassRunner.java:231) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) 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:309) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
0 0
- java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Integer
- java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Integer
- java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Integer
- java.math.BigInteger cannot be cast to java.lang.Integer
- java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Integerjava.lang.Clas
- 十三、java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
- java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Integer解决
- java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Integer
- java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Integer
- java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Integer
- java.math.BigInteger cannot be cast to java.lang.Long
- java.math.BigInteger cannot be cast to java.lang.Long
- java.math.BigInteger cannot be cast to java.lang.Long
- Could not write JSON: java.lang.Integer cannot be cast to java.math.BigInteger
- 关于java.math.BigInteger cannot be cast to java.lang.Integer小方法
- java.math.BigDecimal cannot be cast to java.lang.Integer
- java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
- java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
- 《android开发必知的50个诀窍》笔记Hack-1
- android中使用百度地图绘制弹出框的覆盖物
- note1
- 回调函数的例子
- spring中@param和mybatis中@param使用区别
- java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Integer
- Android 网络通信框架Volley简介(Google IO 2013)
- Android性能优化(二)--小小工程狮的成长之路
- 如何在AWS 中实现动态CDN
- 【读书】【中文版】《控制论》(ISBN:978-7-301-09565-2 / K·0415)
- python的HTMLParser
- Internet概念与TCP/ IP分层模型
- 青少年有压力如何缓解呢?
- Android开发动画之补间动画详情