Search the FirstSpirit Knowledge Base
Good morning,
I am trying to debug a very strange TypeValidation error in my contentstore, where FirstSpirit tries to convert a text field to an FS_ID integer field. The error is thrown on page generation, and when trying to edit the Content2 elements in ContentCreator web edit.
The stack trace includes:
05.07.2014 10:34:56 ERROR 05.07.2014 10:34:56.303 {pID=82694,g-sec=133809,g-node=133805} (de.espirit.firstspirit.store.access.contentstore.ContentUtil): FormFields.fs_id: wrong type, expected class java.lang.Integer, provided class java.lang.String
FSVersion=5.1.106.61855#3710;JDK=1.7.0_45 64bit Oracle Corporation;OS=Linux 2.6.32-358.23.2.el6.x86_64 amd64;Date=05.07.2014 10:34:56
de.espirit.or.TypeViolation: FormFields.fs_id: wrong type, expected class java.lang.Integer, provided class java.lang.String
at de.espirit.or.impl.schema.Conversion$1.run(Conversion.java:413)
at java.security.AccessController.doPrivileged(Native Method)
at de.espirit.or.impl.schema.Conversion.convert(Conversion.java:407)
at de.espirit.or.impl.schema.Conversion.convert(Conversion.java:523)
at de.espirit.firstspirit.store.access.contentstore.ContentUtil.decodeKey(ContentUtil.java:558)
at de.espirit.firstspirit.store.access.contentstore.ContentUtil.decodeKey(ContentUtil.java:504)
at de.espirit.firstspirit.client.access.editor.AbstractOptionsEditorValue.addKeyValueBasedReference(AbstractOptionsEditorValue.java:338)
...
and ends with:
at de.espirit.or.impl.schema.Conversion$1.run(Conversion.java:411)
... 104 more
Caused by: java.lang.NumberFormatException: For input string: "Email Address"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:492)
at java.lang.Integer.<init>(Integer.java:677)
... 109 more
The schema definition is a simple one-to-many relationship.
The text "Email Address" is the value of a record in FormFields.FieldName.
I can't work out why FirstSpirit is trying to convert "Email Address" to FormFields.fs_id.
My only thought is that it's something to do with the section template form, which contains several <CMS_INPUT_COMBOBOX> elements which let the user select from the table join:
<CMS_INPUT_COMBOBOX name="st_formfields_name" sortOrder="ascending" useLanguages="no">
<CMS_INCLUDE_OPTIONS type="database">
<LABELS>
<LABEL lang="*">#item.FieldName</LABEL>
</LABELS>
<KEY>FieldName</KEY>
<QUERY name="properties.select_form_fields"/>
<TABLE>properties.formfields</TABLE>
</CMS_INCLUDE_OPTIONS>
<LANGINFOS>
<LANGINFO lang="*" label="Item name"/>
</LANGINFOS>
</CMS_INPUT_COMBOBOX>
The query "properties.select_form_fields" is a simple one:
<QUERY entityType="FormFields">
<FILTERPARAM parameter="formname" datatype="java.lang.String" value=""/>
<EQ attribute="forms.FormName" parameter="formname"/>
</QUERY>
Can anyone see any obvious errors in the above code?
Many thanks,
Liam
Hi Liam,
looks like you try to write an String value into an Integer field.
Im guessing there is something wrong in your field mappings. I had a similar error with exact that cause.
Regards,
Kai
Hi Liam,
pleas have a look on your definition of CMS_INCLUDE_OPTIONS.
You added the optional tag <key>. The configured field is used to store the value. If you omit this tag, the id will be used to store the value.
Thanks Jan Tilo,
We will investigate this further. I suspect that you are right with the <KEY>.
Liam