Skip to main content

@XmlJavaTypeAdapter Problems..

1 reply [Last post]
Joined: 2006-04-28

While running schemagen I got the error
error: java.util.Currency does not have a no-arg default constructor
this problem is related to the following location:
at java.util.Currency
at (Unknown Source)
at (Unknown Source)

While searching forums I found that there is soln to use XmlAdapter as mentioned on

If I add the @XmlJavaTypeAdapter(CurrencyAdapter.class) to the culprit class it works..However I have too many classes having this description.

I am intrested in adding this annotation to the

this annotaion gives compile errors

"The annotation @XmlJavaTypeAdapter is disallowed for this location"

I am using the latest jar of JAXB implementation

Any Suggestions...


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-09

You must be using an old JAXB RI. The latest XmlJavaTypeAdapter source code says:
public @interface XmlJavaTypeAdapter {
so it's clearly allowed on a package. Can you download the nightly of the JAXB RI and try it again?

Alternatively, wrap that into XmlJavaTypeAdapter[b]s[/b] annotation.