users@jaxb.java.net

Re: JAXB-INTEREST Digest - 15 Jan 2003 to 16 Jan 2003 (#2003-14)

From: Niall Smart <niall.smart_at_hibernian.ie>
Date: Fri, 17 Jan 2003 10:49:49 +0000

Hi not sure if i've sent these questions to the right place, but i have the
following 2 problems with JAXB.

1 - validation. I have followed the jaxb user's guide, from which i believe
to turn of validation the following lines should be sufficent:

unmarshaller = getJAXBContext().createUnmarshaller();
unmarshaller.setValidating(false);

I have done this and tried getting my application to process an invalid xml
file, but i get the following error:

DefaultValidationEventHandler: [ERROR]: Unexpected element {}:reuqest
Exception in thread "main" javax.xml.bind.UnmarshalException: Unexpected
element {}:reuqest
        at
com.sun.xml.bind.unmarshaller.UnreportedException.createUnmarshalException(U
nreportedException.java:59)
        at
com.sun.xml.bind.unmarshaller.SAXUnmarshallerHandlerImpl.reportAndThrow(SAXU
nmarshallerHandlerImpl.java:406)
        at
com.sun.xml.bind.unmarshaller.SAXUnmarshallerHandlerImpl.startElement(SAXUnm
arshallerHandlerImpl.java:96)
        at
org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.j
ava:459)
        at
org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(XMLNamespaceBin
der.java:877)
        at
org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinder.ja
va:569)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDo
cumentFragmentScannerImpl.java:75
9)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(XMLDocumentFragmentS
cannerImpl.java:1477)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocume
ntFragmentScannerImpl.java:329)
        at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:525)
        at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:581)
        at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
        at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:117
5)
        at
com.sun.xml.bind.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.ja
va:139)
        at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshall
erImpl.java:129)
        at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshall
erImpl.java:166)
        at
com.hibernian.eclaims.la.util.JAXBUtil.unmarshal(JAXBUtil.java:59)
        at com.hibernian.eclaims.la.debug.DebugTool.main(DebugTool.java:25)

Second question is the generation of a java enum class. I have the following
part in my xsd file:

<xs:simpleType name="DeliveryStatusType">
        <xs:annotation>
                <xs:appinfo>
                        <jb:typesafeEnumClass name="DeliveryStatusType"/>
                </xs:appinfo>
        </xs:annotation>
        <xs:restriction base="xs:NMTOKEN">
                <!-- Has been created but not sent. -->
                <xs:enumeration value="Initiated"/>

                <!-- Has been sent but no reply has been received. -->
                <xs:enumeration value="Delivered"/>

                <!-- An attempt to send it failed. -->
                <xs:enumeration value="Failed"/>

                <!-- Has been sent and a reply received. -->
                <xs:enumeration value="Closed"/>
        </xs:restriction>
</xs:simpleType>

But if i declare an element of this type further in the xsd, then the code
in the generated class is:

public class DeliveryStatusType {

    public final static com.hibernian.eclaims.la.model.DeliveryStatusType
INITIATED = new
com.hibernian.eclaims.la.model.DeliveryStatusType("Initiated");
    private final static Object $$$_INITIATED =
com.sun.xml.bind.WhiteSpaceProcessor.collapse("Initiated");
    public final static com.hibernian.eclaims.la.model.DeliveryStatusType
DELIVERED = new
com.hibernian.eclaims.la.model.DeliveryStatusType("Delivered");
    private final static Object $$$_DELIVERED =
com.sun.xml.bind.WhiteSpaceProcessor.collapse("Delivered");
    public final static com.hibernian.eclaims.la.model.DeliveryStatusType
FAILED = new com.hibernian.eclaims.la.model.DeliveryStatusType("Failed");
    private final static Object $$$_FAILED =
com.sun.xml.bind.WhiteSpaceProcessor.collapse("Failed");
    public final static com.hibernian.eclaims.la.model.DeliveryStatusType
CLOSED = new com.hibernian.eclaims.la.model.DeliveryStatusType("Closed");
    private final static Object $$$_CLOSED =
com.sun.xml.bind.WhiteSpaceProcessor.collapse("Closed");
    private final String value;
    public final static com.hibernian.eclaims.la.model.DeliveryStatusType
INITIATED = new
com.hibernian.eclaims.la.model.DeliveryStatusType("Initiated");
    private final static Object $$$_INITIATED =
com.sun.xml.bind.WhiteSpaceProcessor.collapse("Initiated");
    public final static com.hibernian.eclaims.la.model.DeliveryStatusType
DELIVERED = new
com.hibernian.eclaims.la.model.DeliveryStatusType("Delivered");
    private final static Object $$$_DELIVERED =
com.sun.xml.bind.WhiteSpaceProcessor.collapse("Delivered");
    public final static com.hibernian.eclaims.la.model.DeliveryStatusType
FAILED = new com.hibernian.eclaims.la.model.DeliveryStatusType("Failed");
    private final static Object $$$_FAILED =
com.sun.xml.bind.WhiteSpaceProcessor.collapse("Failed");
    public final static com.hibernian.eclaims.la.model.DeliveryStatusType
CLOSED = new com.hibernian.eclaims.la.model.DeliveryStatusType("Closed");
    private final static Object $$$_CLOSED =
com.sun.xml.bind.WhiteSpaceProcessor.collapse("Closed");
    private final String value;

    private DeliveryStatusType(String v) {
        value = v;
    }

    private DeliveryStatusType(String v) {
        value = v;
    }

    public String toString() {
        return value;
    }

    public final int hashCode() {
        return super.hashCode();
    }

    public final boolean equals(Object o) {
        return super.equals(o);
    }

    public static com.hibernian.eclaims.la.model.DeliveryStatusType
parse(String str) {
        if
($$$_INITIATED.equals(com.sun.xml.bind.WhiteSpaceProcessor.collapse(str))) {
            return INITIATED;
        }
        if
($$$_DELIVERED.equals(com.sun.xml.bind.WhiteSpaceProcessor.collapse(str))) {
            return DELIVERED;
        }
        if
($$$_FAILED.equals(com.sun.xml.bind.WhiteSpaceProcessor.collapse(str))) {
            return FAILED;
        }
        if
($$$_CLOSED.equals(com.sun.xml.bind.WhiteSpaceProcessor.collapse(str))) {
            return CLOSED;
        }
        return null;
    }

    public String toString() {
        return value;
    }

    public final int hashCode() {
        return super.hashCode();
    }

    public final boolean equals(Object o) {
        return super.equals(o);
    }

    public static com.hibernian.eclaims.la.model.DeliveryStatusType
parse(String str) {
        if
($$$_INITIATED.equals(com.sun.xml.bind.WhiteSpaceProcessor.collapse(str))) {
            return INITIATED;
        }
        if
($$$_DELIVERED.equals(com.sun.xml.bind.WhiteSpaceProcessor.collapse(str))) {
            return DELIVERED;
        }
        if
($$$_FAILED.equals(com.sun.xml.bind.WhiteSpaceProcessor.collapse(str))) {
            return FAILED;
        }
        if
($$$_CLOSED.equals(com.sun.xml.bind.WhiteSpaceProcessor.collapse(str))) {
            return CLOSED;
        }
        return null;
    }

}

from this you can see that duplicate code is generated, which causes the
javac to complain.

Thanks in advance,
Anthony.

> -----Original Message-----
> From: Automatic digest processor [mailto:LISTSERV_at_JAVA.SUN.COM]
> Sent: 17 January 2003 07:00
> To: Recipients of JAXB-INTEREST digests
> Subject: JAXB-INTEREST Digest - 15 Jan 2003 to 16 Jan 2003 (#2003-14)
>
>
> There are 9 messages totalling 666 lines in this issue.
>
> Topics of the day:
>
> 1. Daily Builds (3)
> 2. Error using sample program (3)
> 3. SAXParseException: unexpected root element (2)
> 4. JAXB & SOAP
>
> ----------------------------------------------------------------------
>
> Date: Thu, 16 Jan 2003 07:42:48 -0500
> From: Thomas John Kincaid <Tom.Kincaid_at_Sun.COM>
> Subject: Re: Daily Builds
>
> Hi all,
>
> I understand that providing more frequent builds would be helpful.
> Presently we don't have infra-structure from an IT standpoint or a
> legal standpoint to support it.
>
> Again, JCP permitting, we really are closing in on releasing
> a much more
> stable and final release. I appreciate the enthusiam and support.
>
> Tom
>
> Brett Porter wrote:
>
> > I'd like to back this. More than once I've seen solutions
> posted to the
> > list that don't work with the released beta, and I think
> this hinders
> > further testing from the community.
> >
> > Cheers,
> > Brett
> >
> > Bryan Dollery wrote:
> >
> >> Hi Guys,
> >>
> >> I'm new to this discussion group. I was using Castor for a
> while, but
> >> moved
> >> to JAXB as soon as the 1.0beta was released. I've joined
> the discussion
> >> group mainly because I'm writing an article about JAXB for DevX.
> >>
> >> My most pressing question was about a general release, but
> that's been
> >> answered in a private discussion with Ryan (thanks), and
> now publicly by
> >> Tom.
> >>
> >> My second most pressing question is this: why aren't daily builds
> >> available, in a similar fashion to apache, or sourceforge
> open-source
> >> projects?
> >>
> >> Cheers,
> >>
> >> Bryan
> >
>
> ------------------------------
>
> Date: Fri, 17 Jan 2003 01:45:47 +1300
> From: Bryan Dollery <Bryan.Dollery_at_ChaosEngineers.co.nz>
> Subject: Re: Daily Builds
>
> Hi Tom,
>
> s o u r c e f o r g e
>
> Cheers,
>
> Bryan
>
> > -----Original Message-----
> > From: Discussion list for the Java Architecture for XML Binding
> > [mailto:JAXB-INTEREST_at_JAVA.SUN.COM]On Behalf Of Thomas John Kincaid
> > Sent: Friday, January 17, 2003 1:43 AM
> > To: JAXB-INTEREST_at_JAVA.SUN.COM
> > Subject: Re: Daily Builds
> >
> >
> > Hi all,
> >
> > I understand that providing more frequent builds would be helpful.
> > Presently we don't have infra-structure from an IT standpoint or a
> > legal standpoint to support it.
> >
> > Again, JCP permitting, we really are closing in on
> releasing a much more
> > stable and final release. I appreciate the enthusiam and support.
> >
> > Tom
> >
> > Brett Porter wrote:
> >
> > > I'd like to back this. More than once I've seen solutions
> posted to the
> > > list that don't work with the released beta, and I think
> this hinders
> > > further testing from the community.
> > >
> > > Cheers,
> > > Brett
> > >
> > > Bryan Dollery wrote:
> > >
> > >> Hi Guys,
> > >>
> > >> I'm new to this discussion group. I was using Castor for
> a while, but
> > >> moved
> > >> to JAXB as soon as the 1.0beta was released. I've joined the
> > discussion
> > >> group mainly because I'm writing an article about JAXB for DevX.
> > >>
> > >> My most pressing question was about a general release,
> but that's been
> > >> answered in a private discussion with Ryan (thanks), and now
> > publicly by
> > >> Tom.
> > >>
> > >> My second most pressing question is this: why aren't daily builds
> > >> available, in a similar fashion to apache, or
> sourceforge open-source
> > >> projects?
> > >>
> > >> Cheers,
> > >>
> > >> Bryan
> > >
> >
>
> ------------------------------
>
> Date: Thu, 16 Jan 2003 08:31:25 -0700
> From: Gunaranjan C <gunaranjan_c_at_SATYAM.COM>
> Subject: Error using sample program
>
> Hi
> I am using the sample program that comes with JAXB. Howver I
> keet getting an error "unable to load schema-for-schema for
> W3C XML Schema" (full exception below).
>
> Would appreciate any direction / help on this.
>
>
>
> org.iso_relax.verifier.VerifierConfigurationException
> at
> com.sun.msv.verifier.jarv.FactoryImpl.compileSchema(FactoryImp
> l.java:104)
> at
> org.iso_relax.verifier.VerifierFactory.compileSchema(Unknown Source)
> at
> org.iso_relax.verifier.VerifierFactory.compileSchema(Unknown Source)
> at
> com.sun.msv.reader.xmlschema.XMLSchemaReader.getXmlSchemaForXm
> lSchema(XMLSchemaReader.java:186)
> at com.sun.tools.xjc.Driver$1.<init>(Driver.java:477)
> at com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.java:476)
> at com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
> at com.sun.tools.xjc.Driver.run(Driver.java:268)
> at com.sun.tools.xjc.Driver.main(Driver.java:88)
>
> StackTrace of Original Exception:
> java.lang.NullPointerException
> at
> com.sun.msv.datatype.xsd.TypeIncubator.addFacet(TypeIncubator.java:64)
> at
> com.sun.msv.reader.datatype.xsd.XSDatatypeExp$1.addFacet(XSDat
atypeExp.java:87)
> at
> com.sun.msv.reader.datatype.xsd.FacetState.startSelf(FacetStat
> e.java:56)
> at com.sun.msv.reader.State.init(State.java:154)
> at com.sun.msv.reader.GrammarReader.pushState(GrammarReader.java:579)
> at
> com.sun.msv.reader.datatype.xsd.TypeState.startElement(TypeSta
> te.java:101)
> at org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown Source)
> at
> org.apache.xerces.parsers.AbstractSAXParser.startElement(Abstr
actSAXParser.java:459)
> at
> org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyEleme
> nt(AbstractXMLDocumentParser.java:221)
> at
> org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(X
MLNamespaceBinder.java:874)
> at
> org.apache.xerces.impl.XMLNamespaceBinder.emptyElement(XMLName
spaceBinder.java:591)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStar
> tElement(XMLDocumentFragmentScannerImpl.java:747)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragment
ContentDispatcher.dispatch> (XMLDocumentFragmentScannerImpl.java:1477)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocu
> ment(XMLDocumentFragmentScannerImpl.java:329)
> at
> org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfigurat
> ion.java:525)
> at
> org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfigurat
> ion.java:581)
> at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
> at
> org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXP
arser.java:1175)
> at com.sun.msv.reader.GrammarReader._parse(GrammarReader.java:459)
> at
> com.sun.msv.reader.GrammarReader.switchSource(GrammarReader.java:434)
> at
> com.sun.msv.reader.GrammarReader.switchSource(GrammarReader.java:407)
> at
> com.sun.msv.reader.xmlschema.XMLSchemaReader.switchSource(XMLS
chemaReader.java:683)
> at
> com.sun.msv.reader.xmlschema.ImportState.startSelf(ImportState
> .java:41)
> at com.sun.msv.reader.State.init(State.java:154)
> at com.sun.msv.reader.GrammarReader.pushState(GrammarReader.java:579)
> at com.sun.msv.reader.SimpleState.startElement(SimpleState.java:72)
> at org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown Source)
> at
> org.apache.xerces.parsers.AbstractSAXParser.startElement(Abstr
actSAXParser.java:459)
> at
> org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(X
MLNamespaceBinder.java:877)
> at
> org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLName
spaceBinder.java:569)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStar
> tElement(XMLDocumentFragmentScannerImpl.java:759)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragment
ContentDispatcher.dispatch> (XMLDocumentFragmentScannerImpl.java:1477)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocu
> ment(XMLDocumentFragmentScannerImpl.java:329)
> at
> org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfigurat
> ion.java:525)
> at
> org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfigurat
> ion.java:581)
> at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
> at
> org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXP
arser.java:1175)
> at com.sun.msv.reader.GrammarReader._parse(GrammarReader.java:459)
> at com.sun.msv.reader.GrammarReader.parse(GrammarReader.java:449)
> at
> com.sun.msv.reader.xmlschema.XMLSchemaReader.parse(XMLSchemaRe
> ader.java:89)
> at
> com.sun.msv.verifier.jarv.XSFactoryImpl.parse(XSFactoryImpl.java:26)
> at
> com.sun.msv.verifier.jarv.FactoryImpl.compileSchema(FactoryImp
> l.java:95)
> at
> org.iso_relax.verifier.VerifierFactory.compileSchema(Unknown Source)
> at
> org.iso_relax.verifier.VerifierFactory.compileSchema(Unknown Source)
> at
> com.sun.msv.reader.xmlschema.XMLSchemaReader.getXmlSchemaForXm
> lSchema(XMLSchemaReader.java:186)
> at com.sun.tools.xjc.Driver$1.<init>(Driver.java:477)
> at com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.java:476)
> at com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
> at com.sun.tools.xjc.Driver.run(Driver.java:268)
> at com.sun.tools.xjc.Driver.main(Driver.java:88)
> at Binder.main(Binder.java:26)
> java.lang.Error: unable to load schema-for-schema for W3C XML Schema
> at
> com.sun.msv.reader.xmlschema.XMLSchemaReader.getXmlSchemaForXm
> lSchema(XMLSchemaReader.java:190)
> at com.sun.tools.xjc.Driver$1.<init>(Driver.java:477)
> at com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.java:476)
> at com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
> at com.sun.tools.xjc.Driver.run(Driver.java:268)
> at com.sun.tools.xjc.Driver.main(Driver.java:88)
> Exception in thread "main"
>
> -Guna
>
> ------------------------------
>
> Date: Thu, 16 Jan 2003 10:55:38 -0500
> From: Tom Amiro <Tom.Amiro_at_Sun.COM>
> Subject: Re: Error using sample program
>
> Hi,
>
> I've been trying to pin this down. It has been reported by
> about 6 users and seems
> to be related to the version of Java and Windows platform. I
> thought it might
> have something to do with a non administrative user trying to
> run the app on
> NT or W2K. But have not been able to reproduce it with a
> restricted user
> on W2K with JDK 1.3.1_05-b02.
>
> No one has reported the problem with 1.4.x versions of Java.
> So my suspicion
> right now is that something got fixed in JDK 1.3.x as of the
> _05 version.
>
> Please anyone who has more information on their
> configuration, send it to me.
>
> Do java -version and give me the exact version.
>
> Tell me what version of Windows and what type of user is
> running the sample.
>
> Also, I'd like to make sure you are using the version of ant
> and xercesImpl.jar
> that is distributed with JAXB 1.0 beta.
>
> Thanks,
>
> Tom
>
>
> Gunaranjan C wrote:
> >
> > Hi
> > I am using the sample program that comes with JAXB. Howver
> I keet getting an error "unable to load schema-for-schema for
> W3C XML Schema" (full exception below).
> >
> > Would appreciate any direction / help on this.
> >
> > org.iso_relax.verifier.VerifierConfigurationException
> > at
> com.sun.msv.verifier.jarv.FactoryImpl.compileSchema(FactoryImp
> l.java:104)
> > at
> org.iso_relax.verifier.VerifierFactory.compileSchema(Unknown Source)
> > at
> org.iso_relax.verifier.VerifierFactory.compileSchema(Unknown Source)
> > at
> com.sun.msv.reader.xmlschema.XMLSchemaReader.getXmlSchemaForXm
> lSchema(XMLSchemaReader.java:186)
> > at com.sun.tools.xjc.Driver$1.<init>(Driver.java:477)
> > at com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.java:476)
> > at com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
> > at com.sun.tools.xjc.Driver.run(Driver.java:268)
> > at com.sun.tools.xjc.Driver.main(Driver.java:88)
> >
> > StackTrace of Original Exception:
> > java.lang.NullPointerException
> > at
> com.sun.msv.datatype.xsd.TypeIncubator.addFacet(TypeIncubator.java:64)
> > at
> com.sun.msv.reader.datatype.xsd.XSDatatypeExp$1.addFacet(XSDat
atypeExp.java:87)
> > at
> com.sun.msv.reader.datatype.xsd.FacetState.startSelf(FacetStat
> e.java:56)
> > at com.sun.msv.reader.State.init(State.java:154)
> > at
> com.sun.msv.reader.GrammarReader.pushState(GrammarReader.java:579)
> > at
> com.sun.msv.reader.datatype.xsd.TypeState.startElement(TypeSta
> te.java:101)
> > at org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown Source)
> > at
> org.apache.xerces.parsers.AbstractSAXParser.startElement(Abstr
actSAXParser.java:459)
> > at
> org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyEleme
> nt(AbstractXMLDocumentParser.java:221)
> > at
> org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(X
MLNamespaceBinder.java:874)
> > at
> org.apache.xerces.impl.XMLNamespaceBinder.emptyElement(XMLName
spaceBinder.java:591)
> > at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStar
> tElement(XMLDocumentFragmentScannerImpl.java:747)
> > at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragment
ContentDispatcher.dispatch> (XMLDocumentFragmentScannerImpl.java:1477)
> > at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocu
> ment(XMLDocumentFragmentScannerImpl.java:329)
> > at
> org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfigurat
> ion.java:525)
> > at
> org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfigurat
> ion.java:581)
> > at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
> > at
> org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXP
arser.java:1175)
> > at com.sun.msv.reader.GrammarReader._parse(GrammarReader.java:459)
> > at
> com.sun.msv.reader.GrammarReader.switchSource(GrammarReader.java:434)
> > at
> com.sun.msv.reader.GrammarReader.switchSource(GrammarReader.java:407)
> > at
> com.sun.msv.reader.xmlschema.XMLSchemaReader.switchSource(XMLS
chemaReader.java:683)
> > at
> com.sun.msv.reader.xmlschema.ImportState.startSelf(ImportState
> .java:41)
> > at com.sun.msv.reader.State.init(State.java:154)
> > at
> com.sun.msv.reader.GrammarReader.pushState(GrammarReader.java:579)
> > at com.sun.msv.reader.SimpleState.startElement(SimpleState.java:72)
> > at org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown Source)
> > at
> org.apache.xerces.parsers.AbstractSAXParser.startElement(Abstr
actSAXParser.java:459)
> > at
> org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(X
MLNamespaceBinder.java:877)
> > at
> org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLName
spaceBinder.java:569)
> > at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStar
> tElement(XMLDocumentFragmentScannerImpl.java:759)
> > at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragment
ContentDispatcher.dispatch> (XMLDocumentFragmentScannerImpl.java:1477)
> > at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocu
> ment(XMLDocumentFragmentScannerImpl.java:329)
> > at
> org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfigurat
> ion.java:525)
> > at
> org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfigurat
> ion.java:581)
> > at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
> > at
> org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXP
arser.java:1175)
> > at com.sun.msv.reader.GrammarReader._parse(GrammarReader.java:459)
> > at com.sun.msv.reader.GrammarReader.parse(GrammarReader.java:449)
> > at
> com.sun.msv.reader.xmlschema.XMLSchemaReader.parse(XMLSchemaRe
> ader.java:89)
> > at
> com.sun.msv.verifier.jarv.XSFactoryImpl.parse(XSFactoryImpl.java:26)
> > at
> com.sun.msv.verifier.jarv.FactoryImpl.compileSchema(FactoryImp
> l.java:95)
> > at
> org.iso_relax.verifier.VerifierFactory.compileSchema(Unknown Source)
> > at
> org.iso_relax.verifier.VerifierFactory.compileSchema(Unknown Source)
> > at
> com.sun.msv.reader.xmlschema.XMLSchemaReader.getXmlSchemaForXm
> lSchema(XMLSchemaReader.java:186)
> > at com.sun.tools.xjc.Driver$1.<init>(Driver.java:477)
> > at com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.java:476)
> > at com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
> > at com.sun.tools.xjc.Driver.run(Driver.java:268)
> > at com.sun.tools.xjc.Driver.main(Driver.java:88)
> > at Binder.main(Binder.java:26)
> > java.lang.Error: unable to load schema-for-schema for W3C XML Schema
> > at
> com.sun.msv.reader.xmlschema.XMLSchemaReader.getXmlSchemaForXm
> lSchema(XMLSchemaReader.java:190)
> > at com.sun.tools.xjc.Driver$1.<init>(Driver.java:477)
> > at com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.java:476)
> > at com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
> > at com.sun.tools.xjc.Driver.run(Driver.java:268)
> > at com.sun.tools.xjc.Driver.main(Driver.java:88)
> > Exception in thread "main"
> >
> > -Guna
>
> --
> Tom Amiro -- SQE Engineer
> WTS - Interoperability and Quality
> voice: 781-442-0589 Fax: 781-442-1437
> eMail: tom.amiro@.sun.com
>
> ------------------------------
>
> Date: Thu, 16 Jan 2003 09:10:11 -0700
> From: Gunaranjan C <gunaranjan_c_at_SATYAM.COM>
> Subject: Re: Error using sample program
>
> Hi Tom
> Thanks for your quick response. I am running a WIN 2K system
> and have administrative rights. I am using ANT & XERCES
> that come with the JAXB download.
>
> However since you mentioned JVM versions I did try switching
> the JVMs and it worked.!!
>
> The OLD JVM which did NOT work was:
> C:>java -version
> java version "1.3.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
> Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
>
> The new one that seems to fixed the problem is:
> C:>java -version
> java version "1.3.1_01"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
> Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
>
> Although it worked I am curious about the reason. If you do
> find out please let me know.
>
> Also could not understand what 'schema-for-schema' was (new
> to JAXB and XML Schemas). Could you please throw some light on it ..
>
> Thanks
> -Guna
>
> ------------------------------
>
> Date: Thu, 16 Jan 2003 10:33:04 -0600
> From: Brad Siegfreid <brad_at_iridiumdesign.com>
> Subject: Re: SAXParseException: unexpected root element
>
> Steve,
>
> My web-app is working now but two things changed and I'm not
> sure which
> one did it.
>
> One - My xml file had all the namespace and schema location
> data in it.
> I took that out.
>
> Two - Something else was giving me fits so I recompiled my web-app. I
> had probably tweaked the schema somewhat since the last compile so the
> bindings ended up being redone (I use ant to handle binding and
> compiling together).
>
> When I get a chance I'll try adding the namespace and schema
> validation
> back in to see if it will work. Now that I look back it was probably
> the binding be slightly out of sync. The namespace stuff may have gone
> in after the last binding.
>
> Thanks
>
> Brad
>
> > This is a multi-part message in MIME format.
> >
> >
> > I have seen the same error in the past. In my case, I think it was
> due to the fact that I was attempting to compile multiple schemas into
> a single package and output directory.
> >
> > Each time you invoke the "xjc" compiler on a different schema file,
> it creates a number of files for that schema including some that
> have "standardized" names
> >
> > bgm.ser
> > jaxb.properties
> > ObjectFactory.*
> >
> > But the contents of the 'bgm.ser' and Object Factory files are going
> to be specific to a particular schema. So when I compiled several
> schema files into the same output directory, I wound up overwriting
> the "bgm.ser" data that was created for earlier schemas.
> >
> > If my test program had been written to use the LAST schema I
> compiled, everything would work. But I was trying to use one of
> the 'earlier' schemas I'd compiled, so the unmarshaller got confused
> because the XML it was examining did not match the generated bgm.ser
> file.
> >
> > What I wound up doing was putting each of my schemas into a
> different
> package to avoid namespace collisions among the different
> ObjectFactories. That caused "xjc" to put the output for each schema
> into its own directory, and my problem was solved.
> >
> > I don't know if that will help you out or not. Good luck!
> >
> >
> >
> > -----Original Message-----
> > From: Brad Siegfreid [mailto:brad_at_iridiumdesign.com]
> > Sent: Wednesday, January 15, 2003 6:04 PM
> > To: JAXB-INTEREST_at_JAVA.SUN.COM
> > Subject: SAXParseException: unexpected root element
> >
> >
> >
> > Hello all.
> >
> > This is my first post so please bear with me if this question is
> redundant. I've searched the developer forums at java.sun.com
> and found
> others with a similar issue but no answers. After a week of banging my
> head I'm turning to you.
> >
> > I've posted the files I'm working with at:
> >
> > http://www.iridiumdesign.com/xs/preferences.xsd
> > http://www.iridiumdesign.com/test/preferences-test.xml
> >
> > Using the dom.Writer app from the Xerces 2.2.1 sample files I've
> worked out (at least I think so) any issues with my schema and xml
> files. The file seems to validate from the command line.
> >
> > However, when I load the files into my web server and start
> Resin its
> showing the following error. I've loaded the latest versions of Xerces
> and JAXP and I'm running on Java 1.3.1 on Mac OS X 10.2.3.
> >
> > org.xml.sax.SAXParseException: unexpected root element
> pref:preferences
> > at
> com.sun.xml.bind.unmarshaller.SAXUnmarshallerHandlerImpl.startElement
> (SAXUnmarshallerHandlerImpl.java:81)
> > at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
> Source)
> > at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement
> (Unknown Source)
> > at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispa
> tcher.scan
> RootElementHook(Unknown Source)
> > at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragment
> ContentDis
> patcher.dispatch(Unknown Source)
> > at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
> (Unknown Source)
> > at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
> > at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
> > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> > at com.sun.xml.bind.unmarshaller.UnmarshallerImpl.unmarshal
> (UnmarshallerImpl.java:139)
> > at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal
> (AbstractUnmarshallerImpl.java:129)
> > at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal
> (AbstractUnmarshallerImpl.java:166)
> > at com.iridiumdesign.ControlServlet.init(ControlServlet.java:85)
> > at com.caucho.server.http.Application.createServlet
> (Application.java:3103)
> > at com.caucho.server.http.Application.loadServlet
> (Application.java:3054)
> > at com.caucho.server.http.Application.initServlets
> (Application.java:1914)
> > at com.caucho.server.http.Application.init(Application.java:1827)
> > at com.caucho.server.http.VirtualHost.init(VirtualHost.java:720)
> > at com.caucho.server.http.ServletServer.initHosts
> (ServletServer.java:853)
> > at com.caucho.server.http.ServletServer.initInternal
> (ServletServer.java:698)
> > at com.caucho.server.http.ServletServer.init(ServletServer.java:509)
> > at com.caucho.server.http.ResinServer.init(ResinServer.java:377)
> > at com.caucho.server.http.ResinServer.main(ResinServer.java:1137)
> > at com.caucho.server.http.HttpServer.main(HttpServer.java:103)
> > --------------- linked to ------------------
> > javax.xml.bind.UnmarshalException
> > - with linked exception:
> > [org.xml.sax.SAXParseException: unexpected root element
> pref:preferences]
> > at
> javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarsha
> lException
> (AbstractUnmarshallerImpl.java:284)
> > at com.sun.xml.bind.unmarshaller.UnmarshallerImpl.unmarshal
> (UnmarshallerImpl.java:143)
> > at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal
> (AbstractUnmarshallerImpl.java:129)
> > at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal
> (AbstractUnmarshallerImpl.java:166)
> > at com.iridiumdesign.ControlServlet.init(ControlServlet.java:85)
> > at com.caucho.server.http.Application.createServlet
> (Application.java:3103)
> > at com.caucho.server.http.Application.loadServlet
> (Application.java:3054)
> > at com.caucho.server.http.Application.initServlets
> (Application.java:1914)
> > at com.caucho.server.http.Application.init(Application.java:1827)
> > at com.caucho.server.http.VirtualHost.init(VirtualHost.java:720)
> > at com.caucho.server.http.ServletServer.initHosts
> (ServletServer.java:853)
> > at com.caucho.server.http.ServletServer.initInternal
> (ServletServer.java:698)
> > at com.caucho.server.http.ServletServer.init(ServletServer.java:509)
> > at com.caucho.server.http.ResinServer.init(ResinServer.java:377)
> > at com.caucho.server.http.ResinServer.main(ResinServer.java:1137)
> > at com.caucho.server.http.HttpServer.main(HttpServer.java:103)
> >
> >
> >
>
> --
> Brad Siegfreid
> brad_at_iridiumdesign.com
>
> ------------------------------
>
> Date: Thu, 16 Jan 2003 09:59:11 -0700
> From: Gunaranjan C <gunaranjan_c_at_SATYAM.COM>
> Subject: JAXB & SOAP
>
> Hi,
> This might be a newbie question - but please help me out. I
> am new to JAXB. However I have worked with SOAP. I
> understand that SOAP implementations that come with Web Logic
> etc. automatically (automagically) convert between the SOAP
> types and Java objects (for method arguments and return
> types). Web Logic's documentation says that even complex
> types can be mapped.
>
> So my question is where does JAXB fit into this. Is it a
> mapping that will be used by such implementations? Completly
> new to this - would appreciate any background and information.
>
> Thanks
> Guna
>
> ------------------------------
>
> Date: Thu, 16 Jan 2003 09:10:52 -0800
> From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
> Subject: Re: SAXParseException: unexpected root element
>
> Let us know if you find any further problem...
>
> regards,
> --
> Kohsuke KAWAGUCHI 408-276-7063 (x17063)
> Sun Microsystems kohsuke.kawaguchi_at_sun.com
>
> ------------------------------
>
> Date: Thu, 16 Jan 2003 12:30:33 -0500
> From: Thomas John Kincaid <Tom.Kincaid_at_Sun.COM>
> Subject: Re: Daily Builds
>
> Hi Bryan,
>
> I think you are suggesting more than frequent builds but open sourcing
> JAXB as well. This is something that gets discussed frequently but at
> present we don't have plans to do this outside of the SUN
> SCSL process.
> I know some people would like to see it open sourced it is an
> option we
> are considering doing at some point but don't have any immediate plans
> on this front.
>
> We will certainly keep JAXB interest up to date if and when plans
> develop on this front.
>
>
> Bryan Dollery wrote:
>
> >Hi Tom,
> >
> > s o u r c e f o r g e
> >
> >Cheers,
> >
> >Bryan
> >
> >
> >
> >>-----Original Message-----
> >>From: Discussion list for the Java Architecture for XML Binding
> >>[mailto:JAXB-INTEREST_at_JAVA.SUN.COM]On Behalf Of Thomas John Kincaid
> >>Sent: Friday, January 17, 2003 1:43 AM
> >>To: JAXB-INTEREST_at_JAVA.SUN.COM
> >>Subject: Re: Daily Builds
> >>
> >>
> >>Hi all,
> >>
> >>I understand that providing more frequent builds would be helpful.
> >>Presently we don't have infra-structure from an IT standpoint or a
> >>legal standpoint to support it.
> >>
> >>Again, JCP permitting, we really are closing in on
> releasing a much more
> >>stable and final release. I appreciate the enthusiam and support.
> >>
> >>Tom
> >>
> >>Brett Porter wrote:
> >>
> >>
> >>
> >>>I'd like to back this. More than once I've seen solutions
> posted to the
> >>>list that don't work with the released beta, and I think
> this hinders
> >>>further testing from the community.
> >>>
> >>>Cheers,
> >>>Brett
> >>>
> >>>Bryan Dollery wrote:
> >>>
> >>>
> >>>
> >>>>Hi Guys,
> >>>>
> >>>>I'm new to this discussion group. I was using Castor for
> a while, but
> >>>>moved
> >>>>to JAXB as soon as the 1.0beta was released. I've joined the
> >>>>
> >>>>
> >>discussion
> >>
> >>
> >>>>group mainly because I'm writing an article about JAXB for DevX.
> >>>>
> >>>>My most pressing question was about a general release,
> but that's been
> >>>>answered in a private discussion with Ryan (thanks), and now
> >>>>
> >>>>
> >>publicly by
> >>
> >>
> >>>>Tom.
> >>>>
> >>>>My second most pressing question is this: why aren't daily builds
> >>>>available, in a similar fashion to apache, or sourceforge
> open-source
> >>>>projects?
> >>>>
> >>>>Cheers,
> >>>>
> >>>>Bryan
> >>>>
> >>>>
>
> ------------------------------
>
> End of JAXB-INTEREST Digest - 15 Jan 2003 to 16 Jan 2003 (#2003-14)
> *******************************************************************
>


**********************************************************************
The information transmitted is intended only for the person or entity
to which it is addressed and may contain confidential and/or
privileged material. Any review, retransmission, dissemination or
other use of, or taking of any action or reliance upon, this
information by persons or entities other than the intended recipient
is prohibited. If you received this in error, please contact the
sender and delete the material from your computer.
**********************************************************************