cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benson Margulies (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-2057) java.sql.Date with alternative type binding causes ClassCastException
Date Wed, 25 Feb 2009 15:59:02 GMT

    [ https://issues.apache.org/jira/browse/CXF-2057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12676685#action_12676685
] 

Benson Margulies commented on CXF-2057:
---------------------------------------

The suggestion about the root class was based on reading the code, but I didn't try it myself.

In any case, I committed the real fix to the trunk, and I'm deploying a snapshot now.


> java.sql.Date with alternative type binding causes ClassCastException
> ---------------------------------------------------------------------
>
>                 Key: CXF-2057
>                 URL: https://issues.apache.org/jira/browse/CXF-2057
>             Project: CXF
>          Issue Type: Bug
>          Components: Aegis Databinding
>    Affects Versions: 2.1.4
>         Environment: Java 1.5
>            Reporter: Dennis Kieselhorst
>            Assignee: Benson Margulies
>             Fix For: 2.2
>
>
> Put a java.sql.Date from a ResultSet in a DTO as java.util.Date. The value is correctly
serialized as xsd:dateTime.
> After adding the following mapping (found at http://cwiki.apache.org/CXF20DOC/aegis-21.html),
a ClassCastException is thrown:
> <mappings xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> 	<mapping>
> 		<property name="birthday" 
> 			type="org.apache.cxf.aegis.type.basic.DateType" 
> 			typeName="xsd:date"/>
> 	</mapping>
> </mappings>
> java.lang.ClassCastException: java.sql.Date
>         at org.apache.cxf.aegis.type.java5.XMLGregorianCalendarType.writeObject(XMLGregorianCalendarType.java:54)
>         at org.apache.cxf.aegis.type.basic.BeanType.writeElement(BeanType.java:377)
>         at org.apache.cxf.aegis.type.basic.BeanType.writeObjectInternal(BeanType.java:356)
>         at org.apache.cxf.aegis.type.basic.BeanType.writeObject(BeanType.java:293)
>         at org.apache.cxf.aegis.type.basic.BeanType.writeElement(BeanType.java:377)
>         at org.apache.cxf.aegis.type.basic.BeanType.writeObjectInternal(BeanType.java:356)
>         at org.apache.cxf.aegis.type.basic.BeanType.writeObject(BeanType.java:293)
>         at org.apache.cxf.aegis.databinding.XMLStreamDataWriter.write(XMLStreamDataWriter.java:92)
>         at org.apache.cxf.aegis.databinding.XMLStreamDataWriter.write(XMLStreamDataWriter.java:43)
>         at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:113)
>         at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
>         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
>         at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:74)
>         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
>         at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:78)
>         at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:92)
>         at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:285)
>         at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:168)
>         at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:175)
>         at org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:153)
> I can create a testcase, if needed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message