users@jaxb.java.net

RE: Re: Problems with JAXB 1.0 -- Please help

From: Patel, Ritesh \(GMI - Debt Markets Technology\) <"Patel,>
Date: Mon, 18 Sep 2006 11:17:08 -0400

I have created a JIRA incident on 14th.
https://jaxb.dev.java.net/issues/show_bug.cgi?id=247

I need to have a gauge of when this issue will be resolved. What is the
normal response time?

Thanks,


Ritesh Patel

-----Original Message-----
From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
Sent: Thursday, September 14, 2006 2:27 PM
To: users_at_jaxb.dev.java.net
Subject: Re: Problems with JAXB 1.0 -- Please help


Patel, Ritesh (GMI - Debt Markets Technology) wrote:
> Kohsuke,
> Firstly thanks for your response. Can you please provide details on
> "Issue tracker"?

Please request an observer role on the project (you should get it
granted instanteneously), then head for http://jaxb.dev.java.net/issues/

You'll then see a link to enter an issue.

> I have checked the xml documents and confirmed they are valid. I have
> checked with:
> 1. An XML IDE (XML Spy in particular)
> 2. Xerces sax.Counter (with the flags -n -np -v -s -f -dv -m -t).

I'm with Kirill on XMLSpy, but if Xerces say so, then it might indeed be

a bug of the JAXB RI. Please file an issue.

>
> Thanks,
>
>
> Ritesh Patel
>
> -----Original Message-----
> From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
> Sent: Wednesday, September 13, 2006 6:58 PM
> To: users_at_jaxb.dev.java.net
> Subject: Re: Problems with JAXB 1.0 -- Please help
>
>
>
> I appreciate you giving us all the details to reproduce the problem, I

> think for this kind of things would be better posted as a zip file to
> the issue tracker, where large files are not a problem.
>
> As for your particular problem, I first suggest you to validate your
> input document with the schema, just to make sure that it is indeed
> valid. After all, that's what the RI is complaining --- it sees a
header
>
> element where it's not expecting it.
>
> So check with other tools to see if the document is really valid.
>
>
> Patel, Ritesh (GMI - Debt Markets Technology) wrote:
>> I'm having some problems using JAXB 1.0. This is my first attempt to
>> use it, and I may be doing something VERY wrong.
>>
>> This is a complete scenario, so if I can simplify it, please let me
>> know.
>>
>> Lets start with my code:
>> JAXBContext
>>
jContext=JAXBContext.newInstance("ml:fpml:org.w3._2000._09.xmldsig_");
>> Unmarshaller unmarshaller = jContext.createUnmarshaller() ;
>> unmarshaller.setValidating(false);
>> DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
>> dbf.setNamespaceAware(true);
>>
>> DocumentBuilder db = dbf.newDocumentBuilder();
>> Document doc = db.parse(new FileInputStream( xmls[i]));
>>
>> System.out.println(unmarshaller.unmarshal(doc));
>>
>>
>> My unmarshalling has a problem. I get the following expection:
>> DefaultValidationEventHandler: [ERROR]: Unexpected element
>> {http://www.fpml.org/2005/FpML-4-2}:header
>> Location:
>> javax.xml.bind.UnmarshalException: Unexpected element
>> {http://www.fpml.org/2005/FpML-4-2}:header
>> at
>>
>
fpml.impl.runtime.SAXUnmarshallerHandlerImpl.handleEvent(SAXUnmarshaller
>> HandlerImpl.java:551)
>> at
>>
>
fpml.impl.runtime.AbstractUnmarshallingEventHandlerImpl.reportError(Abst
>> ractUnmarshallingEventHandlerImpl.java:148)
>> at
>>
>
fpml.impl.runtime.AbstractUnmarshallingEventHandlerImpl.reportError(Abst
>> ractUnmarshallingEventHandlerImpl.java:145)
>> at
>>
>
fpml.impl.runtime.AbstractUnmarshallingEventHandlerImpl.unexpectedEnterE
>> lement(AbstractUnmarshallingEventHandlerImpl.java:156)
>> at
>>
>
fpml.impl.runtime.AbstractUnmarshallingEventHandlerImpl.enterElement(Abs
>> tractUnmarshallingEventHandlerImpl.java:69)
>> at
>>
>
fpml.impl.FpMLElementImpl$Unmarshaller.enterElement(FpMLElementImpl.java
>> :163)
>> at
>>
>
fpml.impl.runtime.AbstractUnmarshallingEventHandlerImpl.revertToParentFr
>> omEnterElement(AbstractUnmarshallingEventHandlerImpl.java:338)
>> at
>>
>
fpml.impl.DocumentImpl$Unmarshaller.enterElement(DocumentImpl.java:133)
>> at
>>
>
fpml.impl.FpMLElementImpl$Unmarshaller.enterElement(FpMLElementImpl.java
>> :158)
>> at
>>
>
fpml.impl.runtime.SAXUnmarshallerHandlerImpl.startElement(SAXUnmarshalle
>> rHandlerImpl.java:134)
>> at
>> com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:177)
>> at
>> com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:210)
>> at
>> com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:183)
>> at
>> com.sun.xml.bind.unmarshaller.DOMScanner.parse(DOMScanner.java:72)
>> at
>>
>
fpml.impl.runtime.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:169)
>> at MarchalExample.main(MarchalExample.java:54)
>>
>> I have a TON of xsd that are all linked together via ml-main-1-0.xsd.
> I
>> have attached all the xsds to this email.
>>
>> When generating the classes, I did:
>> java -Xmx800m -jar %JAXB_HOME%\lib\jaxb-xjc.jar ml-main-1-0.xsd
>> -extension -d jschema -b binding.xjb
>>
>> Here in the content of my binding.xjb
>> <jxb:bindings version="1.0"
>> xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>> <jxb:bindings schemaLocation="fpml-main-4-2.xsd" node="/xs:schema">
>> <jxb:schemaBindings>
>> <jxb:package name="fpml"/>
>> <jxb:nameXmlTransform>
>> <jxb:elementName suffix="Element"/>
>> </jxb:nameXmlTransform>
>> </jxb:schemaBindings>
>> </jxb:bindings>
>> <jxb:bindings schemaLocation="ml-main-1-0.xsd" node="/xs:schema">
>> <jxb:schemaBindings>
>> <jxb:package name="ml"/>
>> <jxb:nameXmlTransform>
>> <jxb:elementName suffix="Element"/>
>> </jxb:nameXmlTransform>
>> </jxb:schemaBindings>
>> </jxb:bindings>
>> </jxb:bindings>
>>
>> I have also attached the xml file I'm trying to unmarchal.
>>
>> ANY HELP WOULD be appreciated.
>>
>> Thanks in advance,
>>
>>
>> Ritesh Patel
>> --------------------------------------------------------
>>
>> If you are not an intended recipient of this e-mail, please notify
the
> sender, delete it and do not read, act upon, print, disclose, copy,
> retain or redistribute it. Click here for important additional terms
> relating to this e-mail. http://www.ml.com/email_terms/
>> --------------------------------------------------------
>>
>>
>>
>>
>
------------------------------------------------------------------------
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
--------------------------------------------------------
If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important additional terms relating to this e-mail.     http://www.ml.com/email_terms/
--------------------------------------------------------