You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Ale <al...@gmail.com> on 2008/09/08 16:14:18 UTC

Problem with Calendar using Aegis

Hi, I'm migrating a XFIRE ws application to CXF. Because I need to
keep alive the compatibility with XFIRE I use Aegis as DataBinding.
I've solve a problems but now I cna't solve the problem with the
Calendar datatype, some of my classes uses java.util.Date or
java.util.Calendar. When the binding tried to make the bindings I've
get this error:

javax.xml.ws.WebServiceException: java.lang.ClassCastException:
org.apache.cxf.aegis.type.basic.CalendarType cannot be cast to
org.apache.cxf.aegis.type.basic.BeanType
       at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:267)
.......
Caused by: java.lang.ClassCastException:
org.apache.cxf.aegis.type.basic.CalendarType cannot be cast to
org.apache.cxf.aegis.type.basic.BeanType
       at org.apache.cxf.aegis.type.basic.BeanType.getSuperType(BeanType.java:670)
       at org.apache.cxf.aegis.type.basic.BeanType.writeSchema(BeanType.java:417)
       at org.apache.cxf.aegis.databinding.AegisDatabinding.createSchemas(AegisDatabinding.java:478)
       at org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabinding.java:323)


In XFire I've create a CustomMapping to solve this problem, but in CXF
I don't find any example about that.

Anybody can Help Me?

Regards
Alejandro

Re: Problem with Calendar using Aegis

Posted by Ale <al...@gmail.com>.
Hi, I think that I found the problem.

I've created a method with this signuture: GregorianCalendar
prueba(String mensaje), when I'm trying to deploy the ws with this
method I get the error but if I use Calendar prueba(String mensaje)
works fine.

In Xfire I find that the WSDL define this:
<xsd:element minOccurs="0" name="fechaVigenciaDesde" nillable="true"
type="ns10:GregorianCalendar" />

And then I have the class:
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://util.java">
- <xsd:complexType name="GregorianCalendar">
- <xsd:sequence>
  <xsd:element minOccurs="0" name="firstDayOfWeek" type="xsd:int" />
  <xsd:element minOccurs="0" name="gregorianChange" type="xsd:dateTime" />
  <xsd:element minOccurs="0" name="lenient" type="xsd:boolean" />
  <xsd:element minOccurs="0" name="minimalDaysInFirstWeek" type="xsd:int" />
  <xsd:element minOccurs="0" name="time" type="xsd:dateTime" />
  <xsd:element minOccurs="0" name="timeInMillis" type="xsd:long" />
  <xsd:element minOccurs="0" name="timeZone" nillable="true"
type="ns10:TimeZone" />
  </xsd:sequence>
  </xsd:complexType>
- <xsd:complexType abstract="true" name="TimeZone">
- <xsd:sequence>
  <xsd:element minOccurs="0" name="DSTSavings" type="xsd:int" />
  <xsd:element minOccurs="0" name="ID" nillable="true" type="xsd:string" />
  <xsd:element minOccurs="0" name="displayName" nillable="true"
type="xsd:string" />
  <xsd:element minOccurs="0" name="rawOffset" type="xsd:int" />
  </xsd:sequence>
  </xsd:complexType>
  </xsd:schema>

I need to do the same in CXF, any ideas about that.

Regards
Alejandro

2008/9/8 Ian Roberts <i....@dcs.shef.ac.uk>:
> Ale wrote:
>> I don't know how to post to JIRA, if you explain me I could post it.
>
> https://issues.apache.org/jira/browse/CXF, you need to sign up for an
> account, log in and then select "create new issue".
>
> Ian
>
> --
> Ian Roberts               | Department of Computer Science
> i.roberts@dcs.shef.ac.uk  | University of Sheffield, UK
>

Re: Problem with Calendar using Aegis

Posted by Ian Roberts <i....@dcs.shef.ac.uk>.
Ale wrote:
> I don't know how to post to JIRA, if you explain me I could post it.

https://issues.apache.org/jira/browse/CXF, you need to sign up for an
account, log in and then select "create new issue".

Ian

-- 
Ian Roberts               | Department of Computer Science
i.roberts@dcs.shef.ac.uk  | University of Sheffield, UK

Re: Problem with Calendar using Aegis

Posted by Ale <al...@gmail.com>.
I don't know how to post to JIRA, if you explain me I could post it.

Regards

2008/9/8 Benson Margulies <bi...@gmail.com>:
> Could you also make a JIRA? This failure mode doesn't make sense to
> me, so there's a defect no matter how you look at it.
>
> On Mon, Sep 8, 2008 at 10:25 AM, Benson Margulies <bi...@gmail.com> wrote:
>> There are hints about custom mappings in the Confluence documentation.
>> You could contribute an example. I can send you more specific hints in
>> the next few days.
>>
>> On Mon, Sep 8, 2008 at 10:14 AM, Ale <al...@gmail.com> wrote:
>>> Hi, I'm migrating a XFIRE ws application to CXF. Because I need to
>>> keep alive the compatibility with XFIRE I use Aegis as DataBinding.
>>> I've solve a problems but now I cna't solve the problem with the
>>> Calendar datatype, some of my classes uses java.util.Date or
>>> java.util.Calendar. When the binding tried to make the bindings I've
>>> get this error:
>>>
>>> javax.xml.ws.WebServiceException: java.lang.ClassCastException:
>>> org.apache.cxf.aegis.type.basic.CalendarType cannot be cast to
>>> org.apache.cxf.aegis.type.basic.BeanType
>>>       at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:267)
>>> .......
>>> Caused by: java.lang.ClassCastException:
>>> org.apache.cxf.aegis.type.basic.CalendarType cannot be cast to
>>> org.apache.cxf.aegis.type.basic.BeanType
>>>       at org.apache.cxf.aegis.type.basic.BeanType.getSuperType(BeanType.java:670)
>>>       at org.apache.cxf.aegis.type.basic.BeanType.writeSchema(BeanType.java:417)
>>>       at org.apache.cxf.aegis.databinding.AegisDatabinding.createSchemas(AegisDatabinding.java:478)
>>>       at org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabinding.java:323)
>>>
>>>
>>> In XFire I've create a CustomMapping to solve this problem, but in CXF
>>> I don't find any example about that.
>>>
>>> Anybody can Help Me?
>>>
>>> Regards
>>> Alejandro
>>>
>>
>

Re: Problem with Calendar using Aegis

Posted by Benson Margulies <bi...@gmail.com>.
Could you also make a JIRA? This failure mode doesn't make sense to
me, so there's a defect no matter how you look at it.

On Mon, Sep 8, 2008 at 10:25 AM, Benson Margulies <bi...@gmail.com> wrote:
> There are hints about custom mappings in the Confluence documentation.
> You could contribute an example. I can send you more specific hints in
> the next few days.
>
> On Mon, Sep 8, 2008 at 10:14 AM, Ale <al...@gmail.com> wrote:
>> Hi, I'm migrating a XFIRE ws application to CXF. Because I need to
>> keep alive the compatibility with XFIRE I use Aegis as DataBinding.
>> I've solve a problems but now I cna't solve the problem with the
>> Calendar datatype, some of my classes uses java.util.Date or
>> java.util.Calendar. When the binding tried to make the bindings I've
>> get this error:
>>
>> javax.xml.ws.WebServiceException: java.lang.ClassCastException:
>> org.apache.cxf.aegis.type.basic.CalendarType cannot be cast to
>> org.apache.cxf.aegis.type.basic.BeanType
>>       at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:267)
>> .......
>> Caused by: java.lang.ClassCastException:
>> org.apache.cxf.aegis.type.basic.CalendarType cannot be cast to
>> org.apache.cxf.aegis.type.basic.BeanType
>>       at org.apache.cxf.aegis.type.basic.BeanType.getSuperType(BeanType.java:670)
>>       at org.apache.cxf.aegis.type.basic.BeanType.writeSchema(BeanType.java:417)
>>       at org.apache.cxf.aegis.databinding.AegisDatabinding.createSchemas(AegisDatabinding.java:478)
>>       at org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabinding.java:323)
>>
>>
>> In XFire I've create a CustomMapping to solve this problem, but in CXF
>> I don't find any example about that.
>>
>> Anybody can Help Me?
>>
>> Regards
>> Alejandro
>>
>

Re: Problem with Calendar using Aegis

Posted by Benson Margulies <bi...@gmail.com>.
There are hints about custom mappings in the Confluence documentation.
You could contribute an example. I can send you more specific hints in
the next few days.

On Mon, Sep 8, 2008 at 10:14 AM, Ale <al...@gmail.com> wrote:
> Hi, I'm migrating a XFIRE ws application to CXF. Because I need to
> keep alive the compatibility with XFIRE I use Aegis as DataBinding.
> I've solve a problems but now I cna't solve the problem with the
> Calendar datatype, some of my classes uses java.util.Date or
> java.util.Calendar. When the binding tried to make the bindings I've
> get this error:
>
> javax.xml.ws.WebServiceException: java.lang.ClassCastException:
> org.apache.cxf.aegis.type.basic.CalendarType cannot be cast to
> org.apache.cxf.aegis.type.basic.BeanType
>       at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:267)
> .......
> Caused by: java.lang.ClassCastException:
> org.apache.cxf.aegis.type.basic.CalendarType cannot be cast to
> org.apache.cxf.aegis.type.basic.BeanType
>       at org.apache.cxf.aegis.type.basic.BeanType.getSuperType(BeanType.java:670)
>       at org.apache.cxf.aegis.type.basic.BeanType.writeSchema(BeanType.java:417)
>       at org.apache.cxf.aegis.databinding.AegisDatabinding.createSchemas(AegisDatabinding.java:478)
>       at org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabinding.java:323)
>
>
> In XFire I've create a CustomMapping to solve this problem, but in CXF
> I don't find any example about that.
>
> Anybody can Help Me?
>
> Regards
> Alejandro
>