Hello,
I'm trying to call a custom class which acts like a validator as explained in the Validator docs.
But I get this error.
Log:Server-side validation failed: java.lang.String cannot be cast to java.util.Map
Is this Map for the argument "Map record" that I need in my condition's method according to the specs?
Here's the field of my datasource:
Not much in my Validator class, as I can't get it triggered yet:
The RPC data:
Response:
Stacktrace:
SmartGWT EE 2.3
SmartClient Version: SC_SNAPSHOT-2010-08-03/EVAL Deployment (expires 2010.10.02_09.35.33)
I'm trying to call a custom class which acts like a validator as explained in the Validator docs.
But I get this error.
Log:Server-side validation failed: java.lang.String cannot be cast to java.util.Map
Is this Map for the argument "Map record" that I need in my condition's method according to the specs?
Here's the field of my datasource:
Code:
<field zzzId="1216" name="amount" title="amount" type="zzzMCurrency" javaClass="zzz.parameter.zzzMCurrency" crud="15" required="true" > <validators> <validator type="serverCustom" serverOnly="true" serverObject="zzz.server.custom.zzzValidator" methodName="condition"/> </validators> </field>
Not much in my Validator class, as I can't get it triggered yet:
Code:
public class zzzValidator { public void condition(Object value, Validator validator, String fieldName, Map record, DataSource datasource, HttpServletRequest request, HttpServletResponse response, ServletContext context, HttpSession session, RequestContext requestContext, RPCManager rpc) { Log.debug("condition started"); } }
The RPC data:
Code:
=== 2010-09-07 12:18:39,625 [l0-0] DEBUG RPCManager - Request #1 (DSRequest) payload: { values:{ __gwt_ObjectId:2057, amount:{ refAmount:40 }, description:{ text:null, id:null } }, operationConfig:{ dataSource:"238", operationType:"validate" }, validationMode:"full", appID:"builtinApplication", operation:"238_validate", oldValues:{ __gwt_ObjectId:2057, amount:{ refAmount:40 }, description:{ text:null, id:null } }, criteria:{ } }
Code:
[ { isDSResponse:true, invalidateCache:false, status:-1, data:"java.lang.String cannot be cast to java.util.Map" } ]
Stacktrace:
Code:
=== 2010-09-07 12:18:39,843 [l0-0] DEBUG DataSource - Creating instance of DataSource '238' === 2010-09-07 12:18:39,843 [l0-0] DEBUG AppBase - [builtinApplication.238_validate] No userTypes defined, allowing anyone access to all operations for this application === 2010-09-07 12:18:39,843 [l0-0] DEBUG AppBase - [builtinApplication.238_validate] No public zero-argument method named '_238_validate' found, performing generic datasource operation === 2010-09-07 12:18:39,843 [l0-0] DEBUG BasicDataSource - [builtinApplication.238_validate] Validating 1 '238's at path '' === 2010-09-07 12:18:39,843 [l0-0] DEBUG BasicDataSource - [builtinApplication.238_validate] Validating a '238' at path '' === 2010-09-07 12:18:39,843 [l0-0] WARN RequestContext - dsRequest.execute() failed: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map at com.isomorphic.util.DefaultValidators$serverCustom.validate(DefaultValidators.java:1067) at com.isomorphic.util.DefaultValidators.processValidator(DefaultValidators.java:263) at com.isomorphic.util.DefaultValidators.validateField(DefaultValidators.java:229) at com.isomorphic.datasource.SimpleType.validateValue(SimpleType.java:89) at com.isomorphic.datasource.SimpleType.create(SimpleType.java:65) at com.isomorphic.datasource.BasicDataSource.validateFieldValue(BasicDataSource.java:935) at com.isomorphic.datasource.BasicDataSource.validateFieldValue(BasicDataSource.java:882) at com.isomorphic.datasource.BasicDataSource.toRecord(BasicDataSource.java:560) at com.isomorphic.datasource.BasicDataSource.toRecords(BasicDataSource.java:498) at com.isomorphic.datasource.BasicDataSource.toRecords(BasicDataSource.java:461) at com.isomorphic.datasource.DataSource.validateDSRequest(DataSource.java:1454) at com.isomorphic.datasource.DataSource.validateDSRequest(DataSource.java:1404) at com.isomorphic.datasource.DataSource.execute(DataSource.java:775) at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:721) at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658) at com.isomorphic.application.AppBase.execute(AppBase.java:491) at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1382) at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:155) at zzz.server.custom.zzzIDACall.handleDSRequest(zzzIDACall.java:113) at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:106) at zzz.server.custom.zzzIDACall.processRequest(zzzIDACall.java:97) at com.isomorphic.servlet.IDACall.doPost(IDACall.java:54) at zzz.server.custom.zzzIDACall.doPost(zzzIDACall.java:86)
SmartClient Version: SC_SNAPSHOT-2010-08-03/EVAL Deployment (expires 2010.10.02_09.35.33)
Comment