java.lang.ClassCastException: java.lang.String cannot be cast to common.User [问题点数:40分,结帖人jiaojiao_huihui]

Bbs1
本版专家分:13
结帖率 96.08%
Bbs5
本版专家分:3144
Bbs5
本版专家分:3144
Bbs6
本版专家分:9049
Bbs7
本版专家分:16246
Blank
红花 2011年12月 Java大版内专家分月排行榜第一
2011年11月 Java大版内专家分月排行榜第一
Bbs3
本版专家分:521
Bbs4
本版专家分:1596
Bbs1
本版专家分:13
Bbs5
本版专家分:3144
Bbs1
本版专家分:71
Bbs1
本版专家分:13
Bbs1
本版专家分:0
Bbs1
本版专家分:71
java获取本地IP和服务器IP
java获取IP地址 获取本地IP地址 //这种方法能不能在Linux服务器上直接获取IP有待验证 String address = InetAddress.getLocalHost().getHostAddress().toString(); 获取服务器IP地址(针对nginx) package com.utils; import javax.servlet.http.Ht...
解决方案:Java+selenium定位元素后,sendKeys()输入的内容显示不完整
一、执行环境:Java + selenium + chrome 二、问题描述: 使用XPath定位到元素后,使用sendKeys()输入内容,在输入框显示出来的内容不完整,也就是与所输入内容不一致。比如sendKeys()输入的是18611372039,输入后,只显示部分数字,18611。 再比如,输入的内容为:"good",显示为:god; 输入的内容为:goood,显示为:good; ...
java将int整型数据转成string数据
int a=1234; String b=Integer.toString(a); System.out.println(b+"这是string类型的数据了");
Android开发错误总结
【错误提示】 【解决办法】 这里少了域名,如:htts://www.baidu.com/ 之类的,主要是检查API是否有问题,这里的问题是少了域名
spark中处理dataframe往往遇到”...cannot be cast to ...”这种数据不匹配的问题
    spark处理dataframe数据时,往往遇到&quot;...<em>cannot</em> be <em>cast</em> to ...&quot;这种数据不匹配的问题,主要是因为我们代码中spark指定的数据类型和数据源类型不一致。这里以MySQL为数据源为例。一、读取数据格式匹配MySQL表的创建语句指定的数据类型有decimal、varchar、datetime等。CREATE TABLE `customfieldvalue` (...
springboot之继承JpaRepository后自定义数据库操作后出现java.lang.ClassCastException的错误
java.lang.ClassCastException: * <em>cannot</em> be <em>cast</em> to *;这是数据类型强制转化失败的问题。在继承的Jpa的接口中,使用如下的查询方式:在Jpa的自带的方法中,删除操作的方法只有这几种:但是如果我要根据FileName来进行删除操作,一般是如上面的操作,添加方法deleteByFileName(String fileName);使用该方法,你会发现会报C...
elasticsearch 后集群状态下 聚合时 类型转换错误 原因及分析
先来看下错误前端错误 两层聚类时,外面一层返回的key是乱码,这个乱码并不是编码问题,而是根本没有对第二层的聚类分类。第一层里面的数据全部都是一样的。 直接报错,500或者503,类型转换错误或者解析异常。 后台错误:[2015-11-30 11:06:56,105][DEBUG][action.search.type ] [local] failed to reduce search
weblogic.jdbc.wrapper.Clob_oracle_sql_CLOB 类型转换解决办法
weblogic下转换oracle 的clob类型经常报转型错误,本例子通过反射解决weblogic.jdbc.wrapper.Clob_oracle_sql_CLOB转型成oracle.sql.CLOB问题
java.lang.ClassCastException 两个一样的类不能强转
spring boot 项目引入了 spring的devtools 经常会产生这个问题  ,当把这个引入取消就不会出现了  &amp;lt;dependency&amp;gt;            &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;            &amp;lt;artifactId&amp;gt;spring-boot-devtools&amp;lt...
springboot 出现两个相同的类强转类型报错 java.lang.ClassCastException
springboot 出现两个相同的类强转类型报错 java.lang.ClassCastException今天出现了一个令我感到惊奇的问题是时候打破常规了 今天出现了一个令我感到惊奇的问题 Java 强转类型,相信大家并不陌生,通常来说,强转类型都是我们知道这个类可以转换成另一个类,可能是他的父类或者是他的同类,这样转换一般来说千百年都不会出错。例如下面的 //Father 是 son 的父类...
Fastjson 解析多级泛型时而失败的解决方案
fastjson 解析多级泛型时而失败:class PeiqiResponse { Boolean success; Integer errCode; String errDes; T result; }声明:PeiqiResponse>调试分析经过多次调试,问题出现在这里 DefaultFieldDeserializer#pa
在父类转换到子类时发生java.lang.ClassCastException
在父类转换到子类时会发生ClassCastException异常,稍微了解Java的人都知道,但是我为什么要写出来,只是抛出一个问题用来提出解决办法,当你面对一个工程时成千上百的类时,是不太容易发现类之间的关系的,所以即使知道该原则,有时候还是避免不了
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integ
at org.hibernate.type.IntegerType.set(IntegerType.java:64)rn at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:154)rn at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:136)rn at org.hibernate.param.PositionalParameterSpecification.bind(PositionalParameterSpecification.java:62)rn at org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:514)rn at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1589)rn at org.hibernate.loader.Loader.doQuery(Loader.java:696)rn at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)rn at org.hibernate.loader.Loader.doList(Loader.java:2228)rn at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)rn at org.hibernate.loader.Loader.list(Loader.java:2120)rn at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)rn at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)rn at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)rn at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)rn at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)rn at com.scu.service.impl.BaseServiceImpl.getResult(BaseServiceImpl.java:55)rn at com.scu.service.impl.StudentServiceImpl.check(StudentServiceImpl.java:16)rn at com.scu.struts.action.UserLoginAction.userLogin(UserLoginAction.java:77)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)rn at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)rn at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)rn at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)rn at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)rn at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)rn at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)rn at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)rn at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)rn at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:619)rn
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
for(int i=0;i
net.sf.json转化json字符串报错处理
1.json字符串 { &quot;total&quot;: 2, &quot;status&quot;: true, &quot;data&quot;: { &quot;SpUsercouponVO&quot;: [ { &quot;parkLimit&quot;: 0, &quot;createTime&quot;: null,
Netty Buffer 通用byte 缓冲区使用
在java语言中直接操纵byte[]数组和通过ByteBuffer 接口来操纵都非常的繁琐和复杂。在此,netty 提供了ByteBuf来替代和增强ByteBuffer类的功能。
java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.lang.Obj
java.lang.ClassCastException: java.lang.String <em>cannot</em> be <em>cast</em> to [Ljava.lang.Object;rnat com.six.biz.impl.ReportBizImpl.createPdf(ReportBizImpl.java:153)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)rn at $Proxy1.createPdf(Unknown Source)rn at com.six.action.ReportAction.createPdf(ReportAction.java:71)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)rn at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at com.six.filter.EncodeFilter.doFilter(EncodeFilter.java:40)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:619)rn
java.lang.ClassCastException: java.lang.String cannot be cast to eshop.User
public User get(String username) //用用户名取得该用户的所有属性rn Session session=HibernateUtil.currentSession();rn tx=session.beginTransaction();rn String sql="select username from User where username='"+username+"'";rn List list=session.createQuery(sql).list();rn [color=#FF0000]User user=(User)list.iterator().next();[/color]rn tx.commit();rn HibernateUtil.closeSession();rn return user;rnrn---------------------------------------rnrn [color=#FF0000]user2=userdao2.get(username);[/color]rnrn出现错误java.lang.ClassCastException: java.lang.String <em>cannot</em> be <em>cast</em> to eshop.Userrnrneshop.UserDAO.get(UserDAO.java:76)rn eshop.action.admin.AdminLogin.execute(AdminLogin.java:54)rnrnrn红色为报错部分 貌似是强制转换错误 不知道怎么解决 希望大家来帮帮忙 先谢谢大家了
redis存储数据异常:如果用对象类型存储,那么会提示错误 can't cast to String!!!
  最近做一个小需求,通过redis的key模糊查询key下面的所有数据。第一反应用StringRedisTemplate.keys(&quot;*&quot;+key)。前期准备一切OK,在进入添加测试阶段碰到一个新问题:java.lang.ClassCastException: com.xxx.pojo.xxxDto <em>cannot</em> be <em>cast</em> to java.lang.String at org.sprin...
TintContextWrapper强转Activity失败原因深度探索
公司Android app遇到这个bug,遂开始一番探寻。 问题 先来看下错误日志: 2018-02-25 17:38:38 java.lang.ClassCastException: android.support.v7.widget.TintContextWrapper <em>cannot</em> be <em>cast</em> to com.xx.mobile.basecore.activity.BaseA...
netty那些bytebuf踩过的坑
程序超过256个字节以后用抓包工具抓包显示消息已经发送给服务端并且服务端也回发了ack表示已经收到了,但是在read方法里并没有收到消息。 几经辗转发现问题出现在编解码器上,自己定义的解码器是这样的: ByteBuf heapBuffer = ctx.alloc().heapBuffer(); in.readBytes(heapBuffer, in.resetReaderInd...
ClassCastException异常的出现原因和解决方法
ClassCastException是JVM在检测到两个类型间转换不兼容时引发的运行时异常。此类错误通常会终止用户请求。在执行任何子系统的应用程序代码时都有可能发生ClassCastException异常。通过转换,可以指示Java编译器将给定类型的变量作为另一种变量来处理。对基础类型和用户定义类型都可以转换。Java语言规范定义了允许的转换,其中大多数可在编译时进行验证。不过,某些转换还需要运行...
定时任务 quartz中出现相同类型的对象无法转换问题(java.lang.ClassCastException)
环境:springboot 排查问题过程: 1:确认不是serialVersionUID版本问题 2:确认不是序列化工具(Jackson)问题 3:写了一个测试方法:将对象put到JobDataMap中,再取出来强转,并无问题 解决方法:去掉spring-boot-devtools即可。。。。。...
hibernate命名查询时总是报类型转换异常:java.lang.ClassCastException
异常描述如下; 1、在user.hbm.xml中配置如下 2、测试代码如下: public static void getByNamedQuery(String queryName){ //queryName = "com.summer.entity.User.mySQLquery"; Session session = HibernateUt
关于java中父类和子类转型的问题java.lang.ClassCastException
我们都知道,java是面向对象的语言,继承是其一个很重要的特性,看下面这段代码:package my.java.test; class FatherClass { int fatherField; void fatherMethod() { System.out.println(&quot;这是父类的方法&quot;); } } package my.java.test; ...
关于一个奇怪的ClassCastException
关于一个奇怪的ClassCastException:android.widget.RelativeLayout$LayoutParams <em>cannot</em> be <em>cast</em> to android.support.v4.widget.DrawerLayout$LayoutParams 今天在写自定义相机的时候发现一个莫名其妙的异常情况:android.widget.RelativeLayout$Layo...
关于springboot打war包部署在weblogic上,运行时报java.lang.ClassCastException异常的解决办法
一、 java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer <em>cannot</em> be <em>cast</em> to org.glassfish.tyrus.server.TyrusServerContainer     at weblogic.websocket.tyrus.TyrusServletFil...
tomcat 8.0.35上传好像没成功
tomcat8.0.35刚好像没上传成功 java.lang.ClassCastException: org.slf4j.impl.Log4jLoggerFactory <em>cannot</em> be <em>cast</em> to ch.qos.logback.classic.LoggerContext
求助java.lang.ClassCastException: entity.User cannot be cast to java.lang.String
java.lang.ClassCastException: entity.User <em>cannot</em> be <em>cast</em> to java.lang.Stringrn org.hibernate.type.StringType.toString(StringType.java:67)rn org.hibernate.type.NullableType.nullSafeToString(NullableType.java:117)rn org.hibernate.type.NullableType.nullSafeSet(NullableType.java:158)rn org.hibernate.type.NullableType.nullSafeSet(NullableType.java:136)rn org.hibernate.param.PositionalParameterSpecification.bind(PositionalParameterSpecification.java:68)rn org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:514)rn org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1593)rn org.hibernate.loader.Loader.doQuery(Loader.java:696)rn org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)rn org.hibernate.loader.Loader.doList(Loader.java:2232)rn org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)rn org.hibernate.loader.Loader.list(Loader.java:2124)rn org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)rn org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)rn org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)rn org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)rn org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)rn org.springframework.orm.hibernate3.HibernateTemplate$30.doInHibernate(HibernateTemplate.java:921)rn org.springframework.orm.hibernate3.HibernateTemplate$30.doInHibernate(HibernateTemplate.java:1)rn org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)rn org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)rn org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:912)rn org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:908)rn dao.Impl.UserDAOImpl.findByProperty(UserDAOImpl.java:122)rn dao.Impl.UserDAOImpl.findByUsername(UserDAOImpl.java:133)rn service.Impl.UserServiceImpl.findByUsername(UserServiceImpl.java:71)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn java.lang.reflect.Method.invoke(Method.java:597)rn org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)rn org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)rn org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:108)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)rn $Proxy9.findByUsername(Unknown Source)rn web.UserAction.select(UserAction.java:93)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn java.lang.reflect.Method.invoke(Method.java:597)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)rn com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.13 logs.rn
eclipse neon版本打开某些javascript文件异常问题
eclipse neon版本的javascript编辑器无法处理某些异常信息,比如本人在用require js和vue js的时候碰过这种异常 java.lang.NoSuchMethodError:jdk.nashorn.internal.runtime.ECMAException.getEcmaError()Ljava/lang/Object; 然后js文件直接就打不开了,最终在stac
java.lang.ClassCastException 两个一样的类不能强转
spring boot 项目引入了 spring的devtools 经常会产生这个问题  ,当把这个引入取消就不会出现了      &amp;lt;dependency&amp;gt;             &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;             &amp;lt;artifactId&amp;gt;spring-boot-devt...
SpringBoot报错(四)通用Mapper插件的配置即使用报错
今天来配置mybatis的通用mapper,使用了Mapper插件 &lt;!--通用Mapper插件--&gt; &lt;dependency&gt; &lt;groupId&gt;tk.mybatis&lt;/groupId&gt; &lt;artifactId&gt;mapper-spring-boot-starter&lt;/artifactId&gt; ...
关于java泛型擦除与ClassCastException的问题
今天在复习java泛型时遇到一个疑问:即然java泛型的原理是编译时定,运行时擦除,那为什么还会在运行时抛出ClassCastException异常呢? 问题代码如下:ArrayList list = new ArrayList();//泛型类型为String Method method = list.getClass().getMethod("ad
使用Hibernate返回自定义类型时报错的问题
数据库为oracle,在使用Hibernate查询时想要返回自定义的pojo类型,遇到类型转换的异常。如下面的命名查询希望返回数据行为typeClass类型 Query localQuery = session.getNamedQuery("findPersonInfo"); localQuery.setResultTransformer(Transformers.aliasToBean(typ
android应用错误分析
1.NoSuchMethodError: android.support.v4.view.ViewCompat.getDisplay(Landroid/view/View;)一般是复制过来的文件报的错误,缺少支持库,添加support-v4支持库即可2.java.lang.IllegalArgumentException: No view found for id 总是提示找不到fragment,...
kafka版本不匹配问题
最近开发spark+kafka项目但是却遇到了很多的坑,比如Exception in thread "main" java.lang.ClassCastException: kafka.cluster.BrokerEndPoint <em>cannot</em> be <em>cast</em> to kafka.cluster.Broker这个问题比较坑,突然间一看还真的以为自己不小心写了一个类型转化的错误呢,但是实际上不是。本人开
起动Jboss6.1.0final版本报错,直接启动和myeclipse中启动都一样
报错:<em>cannot</em> be <em>cast</em> to org.jboss.wsf.spi.metadata.jms.JMSDescriptorProcessor 09:37:22,662 WARN  [AbstractKernelController] Broken callback: ClassSingleCallbackItem@1721a9c{name=interface org.jboss.
java.lang.ClassCastException 在用泛型创建数组抛出异常
在平常自己写代码中会用到用泛型创建数组,一般都是直接使用如下方式进行创建,如果说创建的泛型类型不进行比较还好,一旦涉及到需要比较,比如你需要实现一个map,k一定会进行比较,这个时候泛型就要继承Ccompara&amp;lt;E&amp;gt; 在项目启动过程中你会发现直接就抛出异常了 public class HeapMap&amp;lt;T extends Comparable&amp;lt;T&amp;gt;&amp;gt; { ...
Netty学习12-缓冲区【2】ByteBuf
1 概述 《Netty学习11-缓冲区之JDK ByteBuffer》一文中介绍了JDK的缓冲区ByteBuffer的用法和不足。为了弥补这些不足,Netty提供了自己的缓冲区实现ByteBuf(netty3.X是ChannelBuffer)。 2 实现策略 JDK的ByteBuffer已经提供了基础的能力,Netty的ByteBuf的实现可以有两种策略。 [1] 参考JDK By
《React-Native系列》45、踩坑记录
记录几个最近在项目中遇到的坑,RN版本使用0.29.2。1、在Android平台上Text标签的 lineHeight 需要设置成int ,否则会crash;在iOS平台上没有问题。如下图:com.facebook.react.bridge.UnexpectedNativeTypeException: TypeError: expected dynamic type `int64', but ha
ActiveMq消息对象进行序列化时报错
先贴出生产者的主代码:JianRen jianRen = new JianRen(&quot;名字&quot;,&quot;描述&quot;); ActiveMQObjectMessage mes=(ActiveMQObjectMessage)session.createObjectMessage(jianRen); mes.setObject(jianRen); producer.sen...
开发中复杂Json解析(LinkedTreeMap)
开发中遇到的复杂JSON,用TypeToken来进行处理:(当然还有第二种解析方式,请查看http://blog.csdn.net/jason_996/article/details/78039799) 处理方法: 1,先将接口返回的JSON,用gson.tojson(map)方法,将LinkedTreeMap对象转成String。 2,再通过gson.fromjson(string,type)方法,将String转成LinkedTreeMap。用到了Type type=new TypeToken(){}.getType; 3,再将LinkedTreeMapf进行遍历
flex请求java端,类型转换错误
本人初学flex不久,之前使用flex还是没有什么问题,但是最近被remoteobjcet弄晕了,折腾了好几天,现在把这个问题记录下来,希望能对将来遇到类似的人点提示:   java.lang.ClassCastException: flex.messaging.io.amf.ASObject <em>cannot</em> be <em>cast</em> to com.laoweng.action.vo.LineVo  这...
java错误的向下转型
错误使用java向下转型 对于java的向下转型,强制向下转型,编译不会报错。但是在运行时,如果对象本身并非是该类型,强制转型, 在运行时会报java.lang.ClassCastException。因此只有把子类型赋给父类的引用,然后把该引用向下转型的情况,才不会报错。 父类不能强制向下转型!向上转型则是安全的。 代码 // 父类 public class People { } //子...
在使用PageHelper分页时的ParseException异常原因
在使用PageHelper分页时的ParseException异常原因 异常信息如下 net.sf.jsqlparser.JSQLParserException ...(省略)...... Caused by: net.sf.jsqlparser.parser.ParseException: Encountered " "LIKE" "LIKE "" at line 65, column 28...
redis踩坑指南
Redis踩坑1:value序列化 现象:<em>cannot</em> be <em>cast</em> to java.lang.String 一个简单方法,list添加操作,key,value转字节数组 下列方法序列化value 可以看到serialize方法多个实现方法 然后我们在xml中配置的是StringRedisSerializer 我们value传入的是一个自定义对象,而...
java.lang.String cannot be cast to [Ljava.lang.Object;
谁能告诉我什么原因啊 求大虾·rnjava.lang.ClassCastException: java.lang.String <em>cannot</em> be <em>cast</em> to [Ljava.lang.Object;rn at org.hibernate.cache.StandardQueryCache.put(StandardQueryCache.java:104)rn at org.hibernate.loader.Loader.putResultInQueryCache(Loader.java:2208)rn at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2159)rn at org.hibernate.loader.Loader.list(Loader.java:2117)rn at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)rn at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1722)rn at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)rn at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)rn at com.gold.dao.impl.EnterpriseInfoDao.showLonName(EnterpriseInfoDao.java:114)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)rn at $Proxy27.showLonName(Unknown Source)rn at com.gold.service.impl.EnterpriseService.showLonName(EnterpriseService.java:68)rn at com.gold.action.EnterpriseInfoAction.showAll(EnterpriseInfoAction.java:479)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)rn at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rn at com.gold.filter.MyStrutsPrepareAndExecuteFilter.doFilter(MyStrutsPrepareAndExecuteFilter.java:23)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at com.gold.filter.EncodingFilter.doFilter(EncodingFilter.java:26)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:619)
java.util.ArrayList cannot be cast to java.lang.String
小弟初学struts2,很多地方都不明白,遇到了很多问题,麻烦帅哥,美女,解决下!谢谢!rn从数据库里获得list (包括ID(自增),姓名,年龄)rn在strut2写的JSP里用iterator将list遍历输出rnrn下面是Actionrn[code=Java]rnpublic class UserAction extends ActionSupport rn private String name;//姓名rn private int age;//年龄rn private UserDao userdao;rn List list=new ArrayList();//获得数据库里所有的用户集合rn //下面是getter setter 方法rn public UserDao getUserdao() rn return userdao;rn rnrn public void setUserdao(UserDao userdao) rn this.userdao = userdao;rn rnrn public List getList() rn return list;rn rnrn public void setList(List list) rn this.list = list;rn rnrn public String getName() rn return name;rn rnrn public void setName(String name) rn this.name = name;rn rnrn public int getAge() rn return age;rn rnrn public void setAge(int age) rn this.age = age;rn rnrn //JSP页面里调用的action方法,从数据库中获得用户列表(ID(自增),姓名,年龄)rn public List listUser()rn list= userdao.list();rn return getList();rn rnrnrnrn[/code]rnrn这个是JSP页面rn[code=Java]rnrnrn rn rn rn rn rn rnrnrn[/code]rnrnrn运行时,就报错了。下面是错误信息rn[code=Java]rnrnjava.lang.ClassCastException: java.util.ArrayList <em>cannot</em> be <em>cast</em> to java.lang.Stringrn com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)rn com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)rnrnrn[/code]rnrnrn请教大虾们,帮帮忙,谢谢!
java.lang.String cannot be cast to com.yxq.value.NameSingle
NameSingle tempuser=(NameSingle)temp.elementAt(i);报错rnjava.lang.String <em>cannot</em> be <em>cast</em> to com.yxq.value.NameSinglernrn[color=#FF0000]NameSingle.java[/color]package com.yxq.value;rnrnpublic class NameSingle rnpublic String name;rnrnrn
druid读取clob字段问题
异常信息Exception in thread "main" java.lang.ClassCastException: com.alibaba.druid.pool.DruidPooledResultSet <em>cannot</em> be <em>cast</em> to oracle.jdbc.OracleResultSet类型转换异常解决方法 public class QueryDataService { priv
SSH:使用hibernate框架查询出来的数据不能转换成实体类,ClassCastException
Hibernate框架的使用直接上代码! 直接上代码! -Exception occurred during processing request: [Ljava.lang.Object; <em>cannot</em> be <em>cast</em> to com.property.operation.domain.TUserEmail java.lang.ClassCastException: 类转换异常 无图言D,这是我的异...
java.lang.String cannot be cast to
type Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: Exception in JSP: /bookshowcart.jsp:58rnrn55: rn60: rn61: rnrnrnStacktrace:rnorg.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)rnorg.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)rnorg.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rnorg.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rnjavax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnroot cause rnrnjava.lang.ClassCastException: java.lang.String <em>cannot</em> be <em>cast</em> to shop.BookDetailsrnorg.apache.jsp.bookshowcart_jsp._jspService(org.apache.jsp.bookshowcart_jsp:159)rnorg.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rnjavax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnorg.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)rnorg.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rnorg.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rnjavax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrn这句真的有错吗?rnBookDetails book=(BookDetails)item.getItem();rn
java.lang.String cannot be cast to java.lang.Long
java.lang.ClassCastException: java.lang.String <em>cannot</em> be <em>cast</em> to java.lang.Longrnrn[code=java]rnQuery query = getSession().createQuery("select e.provinceid from Province e where e.sid=?");rn query.setParameter(0, pid);rn String father =(String)query.uniqueResult();rn System.out.println(father);rn [/code]rn这是model的属性rn private String provinceid; //这个是string类型啊rn
部署web项目到weblogic上启动错误
  启动weblogic报错:java.lang.ClassCastException: com.sun.faces.application.WebappLifecycleListener <em>cannot</em> be <em>cast</em> to java.util.EventListener 网上搜索com.sun.faces.application.WebappLifecycleListener   找到...
两个关于View.SavedState 的异常分析
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.*****/com.******.RootActivity}: java.lang.ClassCastException: android.view.AbsSavedState$1 <em>cannot</em> be <em>cast</em> to android.widget.Scrol
java.lang.ClassCastException: sun.jdbc.odbc.JdbcOdbcResultSet cannot be cast to
java.lang.ClassCastException: sun.jdbc.odbc.JdbcOdbcResultSet <em>cannot</em> be <em>cast</em> to java.lang.Stringrn org.apache.jsp.updateSpecial_005fnew_jsp._jspService(updateSpecial_005fnew_jsp.java:93)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrn问题代码:rn[code=Java]rnrnrnrnrn[/code]rn我其实不是想用循环取出来,因为这样只有一个变量,我的目的是获取INDEX,然后再用符号传到一个INPUT里去,不过有好方法也可以告诉我哦!!谢谢各位!@!!
Exception处理:服务端返回对象与客户端类型不一致XXX cannot be cast to XXX
描述:       服务端向客户端返回数据时,发生类型转换异常!       服务端定义的model:Student与wsdl中定义的Student类型不一致。         服务端通过本地编写好的wsdl文件(契约优先),使用jaxws-maven-plugin在compile阶段自动将wsdl文件转换为java文件。其存放到了/target/jaxws/wsimport/java...
Java for Web学习笔记(七六):国际化i18n(4)其他
在js中动态给出 在某种情况下,例如在websocket子中,我们根据js收到的websocket状态变化等向用户进行本地化显示,也就是说本地化不是在一开始render的时候进行的,而是在js中动态给出。小例子中infoMessage是在某个Area中增加信息。var infoMessage = function(m) { chatLog.append($('').addClass(
Java 数组的最大长度 位图集合的最大长度
Java 数组的最大长度 Integer.MAX_VALUE 位图集合的最大长度 Integer.MAX_VALUE /* 在大数据行业,有的数据量可以达到几百个亿,这个时候数组小标会溢出。可以考虑分表分库的原理,申请多个数组,然后做路由。 */ public static void order(){ String[] bytes = new String[21
CAS-使用Shiro+buji pac4j集成CAS客户端的配置
由于工作上的要求所以一直在寻找一些符合要求的集成方法,虽然不是自己发现的,但是有些问题经过研究更正。 1、配置web.xml 由于CAS的一个子系统Logout以后其他子系统并没有同步退出,所以这里面加入了,cas官方的集成监听器和过滤器 &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app xmlns:xsi="http://www...
Windows在Hadoop集群远程运行Avro文件格式的MapReduce任务踩坑经历
  初学Avro,用Avro文件作为MapReduce任务的输入输出,踩坑无数,我用的是Centos6.10+Hadoop3.0.3服务器集群,在Windows环境下开发MapReduce 1 Avro类找不到 最初我开开心心写好了MapReduce运行的时候,在cmd里面运行我的jar包,报错java.lang.ClassNotFoundException: org.apache.avro...
利用java反射机制绕开java的泛型
在java中,当代码进行编译时会进行去泛型化,所以如果我们可以绕过泛型,在编译和运行时将对某个泛型化的对象进行修改就不会报错。下面举个例子说明, 如何利用java的反射机制来绕过java的泛型化。 package javaReflect; import java.lang.reflect.Method; import java.util.ArrayList; public class gene
阿里Druid连接池的坑。。
Druid的坑 当查询数据库的Clob转换为Oracle Clob类型的时候。 java.lang.ClassCastException: com.alibaba.druid.proxy.jdbc.ClobProxyImpl <em>cannot</em> be <em>cast</em> to oracle.sql.CLOB 问题原因 ClobProxyImpl不能转换为Oracle的Clob字段,这也是醉了。
从JMSBytesMessage读取数据
最近做一个项目,需要从QPID消息中获取信息。 注册QPID消息 QueuelistenerManager queuelistenerManager = new QueuelistenerManager(true);               QueueListener queueListener = new QueueListener();            
ArrayList源码分析之 add 方法
在Java编程中,常常需要集中存放多个数据,从传统意义上讲,数组是我们的一个很好的选择,前提是我们事先已经明确知道我们将要保存的对象的数量。一旦在数组初始化时指定了这个数组长度,这个数组长度就是不可变的,如果我们需要保存一个可以动态增长的数据(在编译时无法确定具体的数量), List 这个集合类是便为我们提供了相当于动态数组的功能。这个类中add方法尤为重要。  1 目标 本次源码分析的目标...
遇到:无法解析类型 java.lang.CharSequence怎么办?
在网上下载了一个源码,导入Myeclipse后显示了如下错误: 无法解析类型 java.lang.CharSequence。从必需的 .class 文件间接引用了它 可我明明记得所有包都导好了,库文件也搞定了。 Myeclipse 提示我重新构建路径。 于是我去瞄了一下 这路径配置的完美啊,为什么还有问题?? 最后各种尝试,得出结论: 用的JDK版本过高,UUID
使用PageHelper插件抛错
因为项目中用到了PageHelper插件,但是在启动运行时,抛错: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [D:\workspace\taotao-manager\taotao-ma...
基于 Binder 的跨进程通信以及 Service(二):Java 层
同进程使用Service(一) 比如,你做了一个音乐播放 app,里面有一个 MusicService 负责后台播放音乐,对外提供 play(),pause() 的接口 你在一个 Activity 里想调用这个 Service 的 play(),怎么搞? 必须在这个 Activity 里拿到刚才启动的 MusicService 的实例,但这是不可能的。Service 实例是由安卓OS维护的,你拿不到
记录在使用java操作mongodb时的错误
1.报错信息为:org.bson.codecs.configuration.CodecConfigurationException: Can’t find a codec for class [Ljava.lang.String; 原因是mongodb中的insertMany()方法必须对应BSON数据,因此在Document类现在暂时只支持添加List,不支持java数组 将 Docu
集合遍历过程中删除集合元素问题
集合遍历过程中删除集合元素问题
redis 存取报错
redis  存非string报java.lang.ClassCastException使得存不进去 修改配置文件添加 支持序列化代码package com.lenovo.pcsd.bp.businesspartner.config; import org.springframework.beans.factory.annotation.Autowired; import org.springf...
java.lang.String cannot be cast to java.lang.Integer错误
jTextField1.setText(((Integer)jTable.getValueAt(row, 1)).toString());rnrnrn程序一执行到这里就出错了,不知道为什么rnjTextField1接收的是数据库里面的一个字段,类型为numericrn请问一下高手,应该怎么改才不会出错啊,我是初学者
急救:java.lang.String cannot be cast to [Ljava.lang.Obj
使用hibernate3.1,strut1.2,数据库用mssqlserver2000rn 在执行 String hql=" FROM Oauser as a " ;rn Vector myList1=new Vector();rn ArrayList result1 = new ArrayList();rn rn Transaction t = null; rn t = this.session.beginTransaction(); rn Query q = this.session.createQuery(hql); rn result1 = (ArrayList) q.list(); rn t.commit(); rn rn Iterator myIterator1= result1.iterator(); rn Oauser oauser=new Oauser();rn while (myIterator1.hasNext()) rn rn [color=#FF0000]Object[] o = (Object[]) myIterator1.next(); [/color]rn oauser=(Oauser) o[0];rn System.out.println(oauser.getPoliceid());rn rn 后,报错:rnrn[color=#FF0000]java.lang.ClassCastException: java.lang.String <em>cannot</em> be <em>cast</em> to [Ljava.lang.Objrnect;[/color]rn at common.db.dboperation.DbOperation.sendMessages(DbOperation.java:494)rn at org.apache.jsp.oa.oapad.send_jsp._jspService(send_jsp.java:228)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapperrn.java:384)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3rn20)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplrnicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFrnilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVrnalve.java:228)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVrnalve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jrnava:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jrnava:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValrnve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.javrna:216)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.javarn:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.procernss(Http11Protocol.java:634)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44rn5)rn at java.lang.Thread.run(Thread.java:619)rnrnrn 困扰我几天了。。。 但是前面有个查询,可以照常使用,没有提示字符类型不匹配问题。rn 急救!!rn
java.lang.ClassCastException: java.lang.Float cannot be cast to java.lang.Inte
package card.struts;rnrnimport global.hibernate.MyBeanFactory;rnimport history.hibernate.History;rnrnimport java.util.List;rnimport java.util.Map;rnrnimport org.apache.struts2.interceptor.SessionAware;rnrnimport allDao.CardDao;rnimport allDao.HistoryDao;rnimport card.hibernate.Card;rnrnimport com.opensymphony.xwork2.ActionSupport;rnrnpublic class ChoiseCardAction extends ActionSupport implements SessionAwarern /**rn * rn */rn private static final long serialVersionUID = 1L;rn private int cardId;rn private CardDao cardDao;rn private HistoryDao historyDao;rn @SuppressWarnings("rawtypes")rn private Map session;rnrn @SuppressWarnings("rawtypes")rn public Map getSession() rn return session;rn rnrn public void setSession(@SuppressWarnings("rawtypes") Map session) rn this.session = session;rn rn public int getCardId() rn return cardId;rn rnrn public void setCardId(int cardId) rn this.cardId = cardId;rn rnrn @SuppressWarnings("unchecked")rn public String execute()rn rn System.out.println("正在执行choiseCard请求!"); rn if(this.cardDao==null)rn rn this.cardDao=(CardDao)MyBeanFactory.MyGetBean("cardDao");rn rn if(this.historyDao==null)rn rn this.historyDao=(HistoryDao)MyBeanFactory.MyGetBean("historyDao");rn rn Card card=this.cardDao.queryById(this.cardId);rn System.out.println("选择的卡号为:"+cardId);rn System.out.println("卡里还有的钱:"+card.getBalance()); rn this.session.put("card",card);rn List listOfHistory=this.historyDao.queryByCard(this.cardId);//问题就在这里rn System.out.println("此卡共有消费记录条数:"+listOfHistory.size());rn this.session.put("listOfHistory", listOfHistory);rn return "success";rn rnrnrn下面是控制台的输出:rn正在执行choiseCard请求!rn选择的卡号为:7951rn卡里还有的钱:100.0rnrn问题是listOfHistory=this.historyDao.queryByCard(this.cardId);中如果我把this.cardId改成7951就能运行通过,但是用this.cardId就会报错:rnrnjava.lang.ClassCastException: java.lang.Float <em>cannot</em> be <em>cast</em> to java.lang.Integerrn org.hibernate.type.descriptor.java.IntegerTypeDescriptor.unwrap(IntegerTypeDescriptor.java:36)rn org.hibernate.type.descriptor.sql.IntegerTypeDescriptor$1.doBind(IntegerTypeDescriptor.java:57)rn org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:92)rn org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:305)rn org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:300)rn org.hibernate.type.AbstractSingleColumnStandardBasicType.nullSafeSet(AbstractSingleColumnStandardBasicType.java:57)rn org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2602)rn org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2983)rn org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2918)rn org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3247)rn org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:140)rn org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:362)rn org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:354)rn org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:276)rn org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:326)rn org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52)rn org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1214)rn org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:403)rn org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)rn org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175)rn org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:480)rn org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)rn org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)rn org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393)rn org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)rn allDao.HistoryDao$$EnhancerByCGLIB$$ca6aaefe.queryByCard()rn card.struts.ChoiseCardAction.execute(ChoiseCardAction.java:60)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn java.lang.reflect.Method.invoke(Method.java:601)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)rn com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rnrnrn个人感觉好像是bug,求大侠看一下,哪里有问题?
SpringMvc文件上传报类型转换异常?
今天在测试文件上传工具类时服务器不停地报此异常 org.apache.catalina.connector.RequestFacade <em>cannot</em> be <em>cast</em> to org.springframework.web.multipart.MultipartHttpServletRequest 更换了各种上传方式都无效,最后发现是服务器spring配置有问题。 解决方案: 服务器s
java.lang.ClassCastException: $Proxy71 cannot be cast to com.nfschina.dao.NewsDao
我被这个问题折腾了好半天了,还没找到合适的答案,下面是我jsp代码[code="java"]rnrnrn [code="java"][/code]rnrnrnrn rn rn My JSP 'index.jsp' starting pagern rn rn rn rn rn rn rn rn rn rn newss=newsdao.getList();rn for(News news:newss)rn out.println(" rn rn idrn titlern contentrn typern picrn createtimernrnrnrnrn rn rnrn[/code]
java.lang.ClassCastException: testjpa.book.WebBookstoreBooks cannot be cast to testjpa.book.WebBooks
List list = bw1.findAll(); rnWebBookstoreBooks bk = new WebBookstoreBooks();rnIterator myIterator1= list.iterator(); rnwhile (myIterator1.hasNext())rn Object o = myIterator1.next(); rn bk = (WebBookstoreBooks)o;rnrn rn实在不知道是怎么改了,请教各位大侠,很急,谢谢
java.lang.ClassCastException: java.lang.StringBuffer cannot be cast to java.lang
判断验证码的时候出现这个错误提示 是什么意思?
java.lang.ClassCastException: java.util.ArrayList cannot be cast错误
Messages: rnjava.util.ArrayList <em>cannot</em> be <em>cast</em> to org.ygh.vo.SysUserrnFile: org/ygh/dao/impl/SysUserDAOImpl.javarnLine number: 19rnStacktracesrnjava.lang.ClassCastException: java.util.ArrayList <em>cannot</em> be <em>cast</em> to org.ygh.vo.SysUserrnrn org.ygh.dao.impl.SysUserDAOImpl.checkLogin(SysUserDAOImpl.java:19)rn org.ygh.service.impl.SysUserServiceImpl.checkLogin(SysUserServiceImpl.java:29)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn java.lang.reflect.Method.invoke(Method.java:606)rn org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)rn org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)rn org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)rn org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)rn org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)rn com.sun.proxy.$Proxy12.checkLogin(Unknown Source)rn org.ygh.action.SysUserAction.checkLogin(SysUserAction.java:39)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn java.lang.reflect.Method.invoke(Method.java:606)rn ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:891)rn ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1293)rn ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68)rn com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:117)rn com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:108)rn ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1369)rn ognl.ASTMethod.getValueBody(ASTMethod.java:90)rn ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)rn ognl.SimpleNode.getValue(SimpleNode.java:258)rn ognl.Ognl.getValue(Ognl.java:494)rn ognl.Ognl.getValue(Ognl.java:458)rn com.opensymphony.xwork2.ognl.OgnlUtil$2.execute(OgnlUtil.java:309)rnrn[code=java]public SysUser checkLogin(SysUser sysUser) rn String strHQL="From SysUser u Where u.userName=? And u.userPassword=? And u.userFlag=1";rn Object [] values=sysUser.getUserName(),sysUser.getUserPassword();rn sysUser=(SysUser)this.getHibernateTemplate().find(strHQL, values);rn return sysUser;[/code]rnrnrnobject 就是报错那一行。rn rnrn
java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.I
各位大哥,小弟初次使用hibernate抛出了如上异常不知道该如何处理,主要代码如下:rn Session session = null;rn tryrn session = HibernateUtil.getSessionFactory().openSession();rn List l = session.createSQLQuery("select count(*) from person").list();rn int t = l.get(0).intValue();rnrn System.out.println(t);rn catch(Exception e)rn e.printStackTrace();rn finallyrn session.close(); rn rn我想执行上面的语句来得到数据库中数据的条数,但是不知道有什么好的方法,所以就想用上面的代码试试,结果出现了这个异常,不知道各位有什么好的方法可以告诉小弟一声,谢谢!
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lorg.omg.CO
[img=https://img-bbs.csdn.net/upload/201509/17/1442472397_105023.png][/img]rnrn在SQLHelper中执行查询的时候已经把结果保存到ArrayList中,但是取回的时候报上面的错误 求解
java.lang.ClassCastException: java.lang.Integer cannot be cast to com.alibaba.fa
java.lang.ClassCastException: java.lang.Integer <em>cannot</em> be <em>cast</em> to com.alibaba.fastjson.JSONObjectrn[code=java]dataJson = JSON.parseObject(str);[/code]rnrn为什么会报这样错误,怎么解决好点rn
String转Json,数据格式没问题,始终报String cannot be converted to JSONObject的解决办法
服务器端返回的数据如下: {"status":1,"msg":"","data":{"companyname":"","resCount":4,"res":[{"id":"120","sp":"\u56db\u5ddd\u7701","sc":"\u6210\u90fd\u5e02","ep":"\u5c71\u897f\u7701","ec":"\u592a\u539f\u5e02","pro
SpringBoot热部署导致同一个类型转换出现类型转换异常ClassCastException
在springboot开发中,遇到一个离奇的问题,同一个类型在转换的时候,竟然出现了类型转换异常。这种问题怎么能忍。最后发现是spring-boot-devtools热部署依赖导致的。 如下代码是获取session中保存的user信息,并返回。 但是就在类型转换的时候,出现了莫名其妙的类型转换异常:   通过调试,可以很明确的知道,session中取出来的对象就是User,但是在转换的...
android常见问题汇总大全
1、Exception raised during rendering: com.android.layoutlib.bridge.MockView <em>cannot</em> be <em>cast</em> to android.view.ViewGroup Exception details are logged in Window > Show View > Error Log The following classes
从String类型的int java.lang.CharSequence.length()错误学习了Java条件判断的先后顺序
定义了String类型的变量,在用String.length()==0这个方法进行判断时,经常会报错。提示引用了一个空指针。 Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object refe...
HighChartsDemo下载
近来常用highcharts开发报表,现在与大家分享一份用java编写的将highcharts生成的图表导成png、jpeg、svg格式的源码,在源码中还提供了一些基本的highcharts示例,希望对有兴趣使用highcharts的同仁有所帮助。 相关下载链接:[url=//download.csdn.net/download/dengsilinming/4139099?utm_source=bbsseo]//download.csdn.net/download/dengsilinming/4139099?utm_source=bbsseo[/url]
毕业生图像采集下载
毕业生图像采集事项和时间以及个省市地址和联系方式 图像采集需要注意等方面事宜! 相关下载链接:[url=//download.csdn.net/download/luopingx/3665485?utm_source=bbsseo]//download.csdn.net/download/luopingx/3665485?utm_source=bbsseo[/url]
珍珠灯控,场景模拟器下载
学习用的软件,能用的着的朋友下。 相关下载链接:[url=//download.csdn.net/download/oquzhongrensan123456/4616130?utm_source=bbsseo]//download.csdn.net/download/oquzhongrensan123456/4616130?utm_source=bbsseo[/url]
我们是很有底线的