[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openejb-development
Subject:    Re: Jaxb2 rocks!
From:       Dain Sundstrom <dain () iq80 ! com>
Date:       2007-06-27 15:35:21
Message-ID: 88E0B67F-9479-4158-990E-15DD6CDCE4C2 () iq80 ! com
[Download RAW message or body]

Nope.  I think there were some bugs in the early version of JaxB that  
did that.  I'm using:

$ java -jar jaxb-xjc.jar -version
xjc version "2.0.5-b02-fcs"
JavaTM Architecture for XML Binding(JAXB) Reference Implementation,  
(build 2.0.5-b02-fcs)

David also mentioned that inheritance didn't used to work, but it  
worked perfectly for me.  I guess it was another bug they fixed.

-dain

On Jun 26, 2007, at 6:26 PM, Aaron Mulder wrote:

> Did you run into anything that became the type JAXBElement<String>?
> That was my big issue with JAXB2.  OK, this is at best loosely
> related, but...  I used XFire on a WSDL and some of the String
> properties that I would have expected to see as setFoo(String) became
> setFoo(JAXBElement<String>) which was really annoying to work with.
> Dan said there was at least a workaround for JAXB 2.1 I think.
>
> Thanks,
>      Aaron
>
> On 6/26/07, Dain Sundstrom <dain@iq80.com> wrote:
>> I just committed the last changes to convert our old Castor tree to
>> Jaxb2, and the resulting code is wonderful.  Take a look if you have
>> some time org.apache.openejb.config.sys.  Here are some notes on the
>> conversion:
>>
>> * I started with a generated codebase using the following command:
>>
>>    $ ls
>>    activation.jar      jaxb-api.jar        jaxb-impl.jar       jaxb-
>> xjc.jar        jsr173_1.0_api.jar
>>
>>    $ java -jar jaxb-xjc.jar openejb.xsd
>>
>> * The generated classes are very clean and easy to modify by hand as
>> they don't have any generated marshaling logic.  This does mean that
>> the startup is a bit slower due to the need to generate this at
>> runtime, but our schemas are tiny.
>>
>> * Most of the elements in the OpenEJB tree implement the Service
>> interface, and actually have the same implementation code.  I was
>> able to create (extract) an AbstractService that each of services
>> extend.  Inheritance just worked... no magic.
>>
>> * I was able to convert the String "content" property in our services
>> directly to a Properties object at marshall time with the
>> PropertiesAdapter I wrote.  Jaxb has a very clean properties adapter
>> system that lets you convert any type the XML system understands to a
>> non-annotated java type.
>>
>> BTW, hats off to the Castor team!  Castor carried us for a long time,
>> and Jaxb2 was vastly influenced by the Castor team (it is effectly
>> Castor 2.0).
>>
>> -dain
>>
>>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic