Thanks Martin,
I've tried your suggestion, but it does not work. I get back the error
saying that i miss the XmlRootElement..
With or without annotations, my junit test works well. I'm wondering if
it's a problem with the shaded JAR? some missing dependency? Any idea?
Emmanuel
Le 23/07/2014 00:34, Martin Desruisseaux a écrit :
Hello Emmanuel
Le 22/07/14 15:54, Adam Estrada a écrit :
What i have is a class that extends the DefaultMetadata. (...snip...)
The first error i get deals with the missing annotation @XmlRootElement(name =
"MD_Metadata") for my subclass
(...snip...)
Caused by: javax.xml.bind.MarshalException
com.sun.istack.internal.SAXException2: unable to marshal type
"org.fao.fi.gems.GemsMetadata" as an element because it is missing an
@XmlRootElement annotation
(...snip...)
After adding the missing annotation, everything still works (tests, main app in
Eclipse)
If i try to run the app with the shaded jar, i get the following error:
(...snip...)
Caused by: javax.xml.bind.MarshalException
com.sun.istack.internal.SAXException2: unable to marshal type
"org.fao.fi.gems.GemsMetadata" as an
element because it is not known to this context.
I would suggest to not put @XmlRootElement annotation in GemsMetadata,
and instead put a @XmlTransient annotation. I'm not sure however why it
worked before - I would have expected both the old Geotk and the new
Apache SIS objects to behave the same way in this regards. Maybe the
change in behaviour is related to the change in JDK version used, since
they come with different JAXB versions.
Regards,
Martin