File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes JaxbElement creating namespace in xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "JaxbElement creating namespace in xml" Watch "JaxbElement creating namespace in xml" New topic

JaxbElement creating namespace in xml

Suben Naidoo

Joined: Jan 27, 2011
Posts: 1

How do i get JAxbelement NOT to create a namespace in XML. I need to create JaxbElement because when i marshall i get an error no @XMLRootElement found.
I do not want to change the XSD to fix this issue as the XSD is a local standard.
I added the root element using JAXBElement but it creates a namespace which causes problems when unMarshalling the xml.

I get the following error when unMarshalling the XML:
Error [1,189]: cvc-complex-type.2.4.a: Invalid content was found starting with element 'CorruptBatchContinueOnError'. One of '{"":CorruptBatchContinueOnError}' is expected.

Here is the XML created when using the above code to create the root element:

I agree. Here's the link:
subject: JaxbElement creating namespace in xml
jQuery in Action, 3rd edition