users@jaxb.java.net

Re: Unexpected end of element

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 20 Jun 2003 07:58:06 -0700

> i unmarshall an invalid xml document and i got a
> javax.xml.bind.UnmarshalException: Unexpected end of element
> exception.
>
> I think this exception is thrown because the adequate element is
> required and it is not in the xml file.

Yes. For example, if a content model is (A,B,C) and you only have A,B,
then this error will be raised.

> Is there a possiblity to throw the error to my event handler an not
> throw an exception, because if the exception is thrown the unmarshalling
> process is aborted?

Sounds like a bug. All the problems need to be reported to your event
handler before it gets thrown.

Could you send me the stack trace of the exception you caught? It helps
us find out where we need to modify.


--
Kohsuke Kawaguchi <kohsuke.kawaguchi_at_sun.com>