users@jaxb.java.net

Re: Parse error on unmarshal - upgrading from jaxb 2.0 to jaxb 2.1

From: ginsohn <adinkale_at_gmail.com>
Date: Sun, 11 Jul 2010 00:59:24 -0700 (PDT)

Hey,
I found the problem, it was a bug in my application. Actually, the handling
of the delimiter character was embedded in a proprietary inputStream that
was part of the application. Found it and fixed it. It has no relation
what-so-ever to jaxb or Java version.

Thanks,


Glen Mazza wrote:
>
> Some thoughts:
>
> 1.) What I'm not clear from your question is whether or not JAXB 2.1 is
> incorrectly rejecting the ^@ at the end of the last XML tag during
> unmarshalling, or whether JAXB 2.0 was incorrectly accepting it and you
> would like to see similar laxity with JAXB 2.1.
>
> 2.) Have you tried, via the endorsed standard overrides mechanism,
> swapping JAXB 2.2 into your JDK--what happens then?
>
> 3.) You said the C module returns this XML with the ^@ ending, and then
> you feed it through the JAXB unmarshaller (where you get the error).
> Just prior to feeding it, but just after you get the response from the C
> module, can you manually strip out those ending characters and then
> unmarshall it?
>
> 4.) How high on the difficult-o-meter would it be to toss out that C
> module and do straight Java?
>
> Glen
>
> ginsohn wrote:
>> Hi,
>> I have a problem with unmarshaling. I'll describe what I'm trying to do:
>>
>> My application ran until now with Java 1.5 and jaxb 2.0, and in this a
>> particular class I interact with a C process via stdin and stdout,
>> marshaling the request (to stdin) from a JAXB object, and unmarshaling
>> the
>> response (from stdout) into an object from the same schema. The C process
>> adds "std::ends" (^@, represents end of stream, caret+NULL char) to the
>> end
>> of the XML response.
>>
>> I am now upgrading to Java 1.6. I'm doing it for now only at runtime, so
>> I
>> re-built the schema with jaxb 2.1 with Java 1.5 compiler, but now the
>> call
>> to "unmarshal" fails with the error:
>> "javax.xml.stream.XMLStreamException: ParseError at [row,col]:[7,14]
>> Message: Content is not allowed in trailing section."
>>
>> It seems that it somehow fails to parse the closing NULL, while before
>> all
>> was good. I checked the XML input and output, they look the same as they
>> did
>> before. My XSD has not changed either, I only re-built the Java classes
>> with
>> jaxb 2.1 libraries.
>>
>> What am I missing? Please advise, thanks
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
>

-- 
View this message in context: http://old.nabble.com/Parse-error-on-unmarshal---upgrading-from-jaxb-2.0-to-jaxb-2.1-tp29124524p29130116.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.