Looks like this is a JAXP bug. I filed it at
https://jaxp.dev.java.net/issues/show_bug.cgi?id=18
jeff wrote:
> from a set of annotated classes, i generated a schema using the generate-schema ant task.
>
> i then try to unmarshall an XML document, validating on that same generated schema. i get the exception listed below. if i don't set the schema into the unmarshaller, it works fine.
>
> looking at the schema, i do not understand the exception. the element local-portlet-entity is of type localPortletEntity, which is not abstract.
>
> any ideas? i attached the XML file i am trying to validate, and the generated schema. note that if i comment out the local-portlet-entity block, it works fine.
>
> Caused by: org.xml.sax.SAXParseException: cvc-type.2: The type definition cannot be abstract for element local-portlet-entity.
> at com.sun.org.apache.xerces.internal.jaxp.validation.Util.toSAXParseException(Util.java:109)
> at com.sun.org.apache.xerces.internal.jaxp.validation.ErrorHandlerAdaptor.error(ErrorHandlerAdaptor.java:104)
> at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
> at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:429)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3185)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2029)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
> at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.startElement(ValidatorHandlerImpl.java:335)
>
>
> ---------------------------------
> Expecting? Get great news right away with email Auto-Check.
> Try the Yahoo! Mail Beta.
>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> 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