This is how the schema is defined in our case:
<xsd:element name="calendar_campaign_identifier">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="calendar_campaign_id" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Workaround suggested by Thomas before to simplify the binding fixed the
problem.
I would try the binding generated by codegen against latest jibx.
I think codegen generates bindings too verbose. There should be a way to
generate binding simply as:
<structure test-method="ifCalendarCampaignIdentifier"
usage="optional" name="calendar_campaign_identifier">
<value style="element" name="calendar_campaign_id"
field="calendarCampaignId"/>
</structure>
instead of (generated by codegen):
<structure test-method="ifCalendarCampaignIdentifier"
usage="optional">
<structure get-method="getCalendarCampaignId"
set-method="setCalendarCampaignId" name="calendar_campaign_identifier">
<value style="element" name="calendar_campaign_id" type="int"/>
</structure>
</structure>
My be we need more ways to configure codegen.
Thanks
Sachin
DSosnoski wrote:
>
> Hi Sachin,
>
> There's no reason for you to add a <format> definition for int, since
> JiBX gives you the handling for this automatically (see
> http://jibx.sourceforge.net/binding/conversions.html for the full list
> of default conversions).
>
> It looks like the binding is an error in the code generation from
> schema, though. I'll send you (off-list) a link to a current build so
> you can see if the problem has been corrected yet. How are
> calendar_campaign_identifier and calendar_campaign_id defined in your
> schema?
>
> - Dennis
>
> Dennis M. Sosnoski
> SOA and Web Services in Java
> Training and Consulting
> http://www.sosnoski.com - http://www.sosnoski.co.nz
> Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
>
>
>
> Sachin Mittal wrote:
>> Hi,
>> I am getting this above error.
>> My mapping is as followed:
>> <structure get-method="getCalendarCampaignId"
>> set-method="setCalendarCampaignId" name="calendar_campaign_identifier">
>> <value style="element" name="calendar_campaign_id"
>> type="int"/>
>> </structure>
>>
>> Also as per docs I have added a serializer and deserializer methods for
>> type
>> int:
>> <format type="int" serializer="java.lang.String.valueOf"
>> deserializer="java.lang.Integer.parseInt"/>
>>
>> So even after all this its not working and I am getting this error when
>> binding is compiled:
>> Error: Need no-argument constructor or factory method for class int;
>>
>> Please help.
>>
>> Thanks
>> Sachin
>>
>>
>> -----
>> http://www.assembla.com/wiki/show/sachin_mittal about me:
>>
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity professionals.
> Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, &
> iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
> Group, R/GA, & Big Spaceship. http://www.creativitycat.com
> _______________________________________________
> jibx-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>
-----
http://www.assembla.com/wiki/show/sachin_mittal about me:
--
View this message in context:
http://www.nabble.com/Need-no-argument-constructor-or-factory-method-for-class-int-tp23557952p23664283.html
Sent from the jibx-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users