users@jaxb.java.net

Re: How to specify base type for a complexType

From: Farrukh Najmi <farrukh_at_wellfleetsoftware.com>
Date: Wed, 10 Dec 2008 14:30:17 -0500

Thanks Kohsuke,

I filed a new issue for tracking this:

<https://jaxb.dev.java.net/issues/show_bug.cgi?id=577>


Kohsuke Kawaguchi wrote:
>
> Unfortunately using an exception as the base class for binding isn't
> supported, according to the current rule of binding. This is because
> at runtime the JAXB implementation will try to bind Exception to its
> own complex type, which fails because it's not bindable.
>
> I forgot the exact details but this was discussed between JAXB and
> JAX-WS, because JAX-WS often need to bind exceptions.
>
> It's probably worthwhile to file this as an issue, then record the
> details, as this is obviously an useful feature --- we need a
> collective memory of why this wasn't feasible.
>
>
> Farrukh Najmi wrote:
>> I have a compledxType hierarchy in my xsd that I would like to map to
>> an Exception type hierachy in the generated bindings.
>>
>> Here is a sample of the xsd type hierarchy:
>>
>> <complexType name="RegistryExceptionType">
>> </complexType>
>>
>> <complexType name="AuthenticationExceptionType">
>> <complexContent>
>> <extension base="tns:RegistryExceptionType">
>> <sequence/>
>> </extension>
>> </complexContent>
>> </complexType>
>>
>>
>> I tried specifying the following customization:
>>
>> <jaxb:bindings node="xs:complexType[@name='RegistryExceptionType']">
>> <jaxb:property>
>> <jaxb:baseType name="java.lang.Exception"/>
>> </jaxb:property>
>> </jaxb:bindings>
>>
>> However, the generated class for RegistryExceptionType still did not
>> extend java.lang.Exception as expected.
>>
>> What am I doing wrong?
>>
>> Thanks.
>>
>> --
>> Farrukh
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>>
>
>


-- 
Regards,
Farrukh Najmi
Web: http://www.wellfleetsoftware.com