浏览 4060 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2014-08-05
最后修改:2014-08-05
[b异常信息 exception[/b] Struts Problem Report Struts has detected an unhandled exception: Messages: com.fanbaobao.presentation.action.system.RoleAction cannot be cast to com.fanbaobao.presentation.action.system.MenuAction Stacktraces java.lang.ClassCastException: com.fanbaobao.presentation.action.system.RoleAction cannot be cast to com.fanbaobao.presentation.action.system.MenuAction com.fanbaobao.presentation.action.system.MenuAction$$FastClassByCGLIB$$57d8df08.invoke() org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631) com.fanbaobao.presentation.action.system.MenuAction$$EnhancerByCGLIB$$2903043f.queryMenuList() sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 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:450) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252) com.fanbaobao.presentation.interceptor.AuthInterceptor.intercept(AuthInterceptor.java:32) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) 代码 code: <action name="addRoleMenu" class="xxx.action.system.RoleAction" method="addRoleMenu"> <param name="operation">-1</param> <result name="init" type="chain"> <param name="namespace">/system</param> <param name="actionName">queryMenuList</param> </result> </action> <action name="queryMenuList" class="xxx.action.system.MenuAction" method="queryMenuList"> <result name="success">/system/menu_list.jsp</result> <result name="operation">/system/role_menu_add.jsp</result> </action> 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2014-08-06
这个问题没有人遇到过?没有 大侠,高手吗?太失望了?
|
|
返回顶楼 | |
发表时间:2014-08-07
RoleAction不能强转为MenuAction类,很明显的错误
|
|
返回顶楼 | |
发表时间:2014-08-09
鲲背浮雪 写道 RoleAction不能强转为MenuAction类,很明显的错误 <result name="init" type="chain"> <param name="namespace">/system</param> <param name="actionName">queryMenuList</param> </result> 这个 /system/queryMenuList.do 不是 RoleAction 中方法,是MenuAction中的方法,下面有配置 什么时候需要强行转换了? 而且我用 chain 怎么涉及到强制转换了. 我怀疑,是spring AOP 代理Action 后,如果用chain 只能在同一个Action中chian不能夸 Action |
|
返回顶楼 | |
发表时间:2014-08-11
我觉得可以从设计上优化一下,避免action跳action,在service层引入,或者作为当前类中的函数,避免这些费时的事情
|
|
返回顶楼 | |