|
|
Hello,
I am trying to create a person with a birth date but the creation fails. The date is of type java.util.Date instead of java.sql.Date. I am not sure what I need to do to convert it to the correct type. I can see the birth date value is not the same format as the other date fields.
What is wrong?
In the form, the field is configured as
<field name="birthDate" title="Birth Date"><date-time type="date"/></field>
I also put the following in the services.xml file. Thinking it would do the conversion.
<attribute name="birthDate" mode="IN" type="java.sql.Date"/>
Here is the error:
2012-12-07 20:56:58,747 (http-0.0.0.0-8443-5) [ CallSimpleMethod.java:109:WARN ] Got error [error] calling inline simple-method named [createPersonRoleAndContactMechs] in resource [component://party/script/org/ofbiz/party/party/PartySimpleMethods.xml], message is ERROR: Could not complete the Creates a person, role and contactMechs [file:/Users/jtkirk/jtkirk/apps/apache-ofbiz-11.04.01/applications/party/script/org/ofbiz/party/party/PartySimpleMethods.xml#createPersonRoleAndContactMechs] process [problem invoking the [createPerson] service with the map named [personContext] containing [{firstName=stu07, middleName=null, lastName=stu07 last, personalTitle=null, suffix=null, nickname=null, gender=null,
birthDate=Mon Dec 03 00:00:00 CST 2012,
deceasedDate=null, height=null, weight=null, mothersMaidenName=null, maritalStatus=null, socialSecurityNumber=null, passportNumber=null, passportExpireDate=null, totalYearsWorkExperience=null, comments=null, userLogin=[GenericEntity:UserLogin]
[createdStamp,2012-11-24 20:58:56.071(java.sql.Timestamp)]
[createdTxStamp,2012-11-24 20:58:55.917(java.sql.Timestamp)][currentPassword,{SHA}47ca69ebb4bdc9ae0adec130880165d2cc05db1a(java.lang.String)][disabledDateTime,null()][enabled,Y(java.lang.String)][externalAuthId,null()][hasLoggedOut,null()][isSystem,null()][lastCurrencyUom,null()][lastLocale,null()][lastTimeZone,null()][lastUpdatedStamp,2012-11-25 08:05:55.595(java.sql.Timestamp)][lastUpdatedTxStamp,2012-11-25 08:05:55.594(java.sql.Timestamp)][partyId,admin(java.lang.String)][passwordHint,null()][requirePasswordChange,null()][successiveFailedLogins,0(java.lang.Long)][userLdapDn,null()][userLoginId,admin(java.lang.String)], locale=en_US}]:
Type check failed for field [createPerson.birthDate]; expected type is [java.sql.Date]; actual type is [java.util.Date]], and the error message list is: null
thanks,
-john
|