In ViewModel class I am not able to fetch the field values; the field has multiple keywords as its value (say keyword1 and keyword2). Below is the snapshot of the
In ViewModel class I tried to use variable type as KeywordField as suggested in http://blog.trivident.com/viewmodel-functionality-in-dd4t-2-0-for-java-part-ii-creating-viewmodels/ but it gives below Exception:
java.lang.IllegalArgumentException: Can not set org.dd4t.contentmodel.impl.KeywordField field com.web.cms.model.PackageBundle.bonusItem to org.dd4t.contentmodel.impl.KeywordImpl
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
at java.lang.reflect.Field.set(Field.java:764)
at org.dd4t.databind.builder.AbstractModelConverter.setFieldValueOnField(AbstractModelConverter.java:94)
at org.dd4t.databind.builder.AbstractModelConverter.setFieldValue(AbstractModelConverter.java:72)
at org.dd4t.databind.builder.json.JsonModelConverter.deserializeGeneric(JsonModelConverter.java:296)
at org.dd4t.databind.builder.json.JsonModelConverter.buildField(JsonModelConverter.java:208)
at org.dd4t.databind.builder.json.JsonModelConverter.buildModelProperties(JsonModelConverter.java:116)
at org.dd4t.databind.builder.json.JsonModelConverter.convertSource(JsonModelConverter.java:95)
at org.dd4t.databind.builder.json.JsonDataBinder.buildModel(JsonDataBinder.java:175)