SSH,action中也获取值了,但是一调取添加方就报错,添加方法检查了好多遍,没错啊,郁闷,求高手给看看,小弟都快愁死了

问题描述

java.lang.ClassCastException:com.lwl.luzheng.action.ZhiFaRenYuanAction$$EnhancerByCGLIB$$56f8cf04org.hibernate.type.EntityType.toLoggableString(EntityType.java:463)org.hibernate.type.CollectionType.renderLoggableString(CollectionType.java:163)org.hibernate.type.CollectionType.toLoggableString(CollectionType.java:148)org.hibernate.pretty.Printer.toString(Printer.java:53)org.hibernate.pretty.Printer.toString(Printer.java:90)org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:97)org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655)org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)com.lwl.luzheng.action.ZhiFaJiGuanAction$$EnhancerByCGLIB$$765ad518.addZhiFajiGuans(<generated>)sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)java.lang.reflect.Method.invoke(Method.java:597)com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

解决方案

解决方案二:
ClassCastException这个可能类型转换有问题

时间: 2024-09-11 21:15:21

SSH,action中也获取值了,但是一调取添加方就报错,添加方法检查了好多遍,没错啊,郁闷,求高手给看看,小弟都快愁死了的相关文章

struts2的action中为什么获取不到 request.getParamter()中的值

问题描述 方法执行没有问题,只是request.getParamter或者request.getAttribute都取不到值,在后台输出了一下,发现为null.说明前台的request根本没有传递到后台去,我百度了很多,说可能要用上拦截器,弄了好久都不成功,没有办法,只能求助广大网友了!先贴一下局部的代码吧struts.xml<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEstrutsPUBLIC"

mvc的action中如何获取ajax post过来的数据?Request Payload

问题描述 mvc的action中如何获取ajax post过来的数据?Request Payload 我网上下载的demo,在action中可以获取到前端post过来的数据 但是,怎么在我的mvc2程序中获取不到啊? 解决方案 你用Request.Form[""take""]看能不能获取

利用javascript 如何拿到struts2的action中变量的值

问题描述 利用javascript 如何拿到struts2的action中变量的值,或者利用javasc如何得到java类中方法的返回值 问题补充:7454103 写道 解决方案 首先 struts2 提供的 s 标签 就可以取到action里面的属性! 或者 方法的返回值其次! 如果只能js 的话 就用 ajax 去后台 跑一趟 也是很方便的!解决方案二:struts json组合使用解决方案三:Ajax可以操作java方法

maven-Maven构建SSH项目添加依赖支持报错

问题描述 Maven构建SSH项目添加依赖支持报错 我在使用Maven搭建SS2H项目的时候,使用了 org.springframeworkspring-web4.1.3.RELEASE 之后web.xml的 org.springframework.web.context.ContextLoaderListener 就会报错,是找不到,去掉了就可以但是在项目启动的时候就会报错,加了之后会有报错说Error:java: java.lang.ArrayIndexOutOfBoundsExceptio

java定时器 run方法怎么返回值 我要返回result 代码里一直报错 晚生跪求解决

问题描述 java定时器 run方法怎么返回值 我要返回result 代码里一直报错 晚生跪求解决 public VirementResultInfo queryTransaction( final String bank, final TransactionInfo transactionInfo) { // final VirementResultInfo result = null; TimerTask task = new TimerTask() { @Override public v

plsql-PLSQL中定义显式游标时用了INTO子句没有报错,请教这个INTO子句的作用是什么?

问题描述 PLSQL中定义显式游标时用了INTO子句没有报错,请教这个INTO子句的作用是什么? 如题,在定义显式游标时用了INTO子句,能编译正常且执行也没错,请问这里的into有啥作用? 代码如下: DECLARE pi_org_cd VARCHAR2(15); -- org cd CURSOR cur_test_data IS SELECT 'MYTEST' org_cd INTO pi_org_cd FROM DUAL ; BEGIN OPEN cur_test_data; FETCH

c#调用c++-c#调用C++dll 返回值为结构体,其中包含string, 报错

问题描述 c#调用C++dll 返回值为结构体,其中包含string, 报错 c++ struct ClientInfo { char adress[4]; }; extern "C" __declspec(dllexport) ClientInfo Test() { ClientInfo c; strcpy_s(c.adress, "1234"); return c; } c# [DllImport("ManagerAPI.dll")] pub

httpwebrequest-C# WPF求高手指点这段怎么解决假死?求具体代码

问题描述 C# WPF求高手指点这段怎么解决假死?求具体代码 public WebResponse Web(url) { WebResponse re; HttpWebRequest resq = (HttpWebRequest)WebRequest.Create(url); re = resq.GetResponse(); return re; } 解决方案 其实可以建个线程来执行这一步,或者你自己设定个超时报异常,毕竟假死本来就是性能问题 解决方案二: 这种假死的情况可能的原因是:网速原因,

maven compile报错-eclipse中指定父pom的compile插件版本后子工程报错

问题描述 eclipse中指定父pom的compile插件版本后子工程报错 开发环境:eclipse mars,m2eclipse,maven3.3(external) parent pom中,Management配置compile插件,但是不指定版本, son pom中不配置compile-Plugin, 此时执行编译:发现使用的是compile plugin version = 3.1 问题开始: 此时修改 Management配置compile插件version= other,比如3.3