Werner,
sorry, I need to come back to this issue once again. Is it really a bug,
if I specify my own custom field handler, but my type ist f.ex.
java.util.Date? I think probably it was my mistake and one needs to set
the type to String if one uses custom field handlers...
Am I right or would you like me to file the issue?
Cheers
Harald
Werner Guttmann schrieb:
Thanks, Harald, for the feedback. Can you please create a new Jira issue
and report those findings there as well.
Thanks
Werner
Harald Weyhing wrote:
Hello Werner,
I could resolve my problem with debugging castor. I found that if you
set the real type of your Data in the mapping.xml (f.ex. java.util.Date)
while also providing a custom field handler, castor chooses the wrong
handler.
The error is that toPrimitiveObject(final Class type, String value) in
UnmarshalHandler gets called and creates a new Date() instead of using
the custom field handler.
For me I changed
<field name="datum" type="java.util.Date"
handler="de.weyhing.rechnung.daten.castor.DateFieldHandler">
to
<field name="datum" type="java.lang.String"
handler="de.weyhing.rechnung.daten.castor.DateFieldHandler">
and everything works perfectly.
Cheers
Harald
Harald Weyhing schrieb:
Hello Werner,
this was quick! Thanks for your answer, I will check with Jira and
keep a look on it. Probably - if I do have some time wich is quite
unlikely right now - I will try to debug and if I find anything
relevant I will post it here.
Cheers
Harald
Werner Guttmann schrieb:
Harald,
there's already a Jira issue related exactly to this problem. In other
words, no need to create a new Jira issue anymore. As far as I know, all
relevant files have been attached to replay the problem.
I have been looking in to this already a few days ago, but my biggest
limitation currently is time (as one of my commercial projects is about
to be launched).
Feel free to debug the problem as far as possible. If I were to look at
this right now, I'd try to answer the question why FieldHandlers for
Dates/BigDecimals are different during unmarshalling.
Regards
Werner
Harald Weyhing wrote:
Helle everybody,
I have a problem with my mapping.xml. Marshalling works excatly as I
expect, but unmarshalling does not, it seems that castor does not find
my custom field handlers for BigDecimal and Date and raises a
NumberFormatException even though those handlers are used during
marshalling. Same results for 1.2, 1.3 and the latest trunk.
I can provide an eclipse project that contains a testcase that shows
the
problem and additional information about what I intend to do.
What's the best way to provide this information? I don't want to attach
a 2MB file to a mail going to a mailing list, but I could provide a
download link.
Any help is greatly appreciated.
Thanks in advance
Harald
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email