This post originated from an RSS feed registered with Java Buzz
by Adam Sherman.
Original Post: Tighter Integration of JAXB & JAX-RPC
Feed Title: Adam Sherman's Musings
Feed URL: http://www.contegix.com/blog/dev/?flavor=rss2
Feed Description: Adam Sherman on Java, XML and Other
Working with the XML specifications for Java has always been a pleasure for me. Yes, some criticise them fiercely, however I feel they are mostly adequate for the task.
I recently encountered a problem with JAXB: the specification requires two behaviours which I find to cause integration hassles:
Both issues crop up when using JAXB with a container such as PicoContainer, Spring or anything else that expects to be able to instantiate empty beans without special knowledge.
The second issue becomes a difficulty when using JAXB beans with "dot notation". For example, you cannot simply create an empty bean and then try and set a property like car.engine.timing since the reference to engine is null until you create an Engine object and assign it. Would it be more appropriate to recursively populate the bean?
George Datuashvili mentioned on the JAXB mailing list:
"In future JAX-RPC 2.0 will be based on JAXB 2.0, and since JAX-RPC already requires EJB bindings, your issue will have to be resolved by JAXB or JAX-RPC working groups."
That thread also talks about using java.lang.Proxy, which I find very interesting.