users@jaxb.java.net

Re: Errors running xjc

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Tue, 28 Feb 2006 10:29:16 -0800

This is really a bug in the GML schema. The error is saying that it
violates some arcane parts of the XML Schema spec.

The best thing to do is to tell the schema author to fix it. I'm pretty
sure they already know about this, as you weren't the first one to hit
this problem.

Meanwhile, try "-nv" option, which makes JAXB look the other way for
these issues.


Enrique Andreu wrote:
> Hello, I try to use jaxb with
> http://schemas.opengis.net/wcs/1.0.0/wcsCapabilities.xsd but I obtain this
> erros when I use the binding compiler xjc:
> [ERROR] rcase-Recurse.2: There is not a complete functional mapping
> between the particles. line 355 of file:....
> [ERROR] derivation-ok-restriction.5.4.2: Error for type
> 'AbstractDescriptionBase Type'. The particle of the type is not a valid
> restriction of the particle of the base.line 355 of file:....
> Failed to parse a schema.
>
> The line 355 of the file is:
> <xs:complexType name="AbstractDescriptionBaseType" abstract="true">
> <xs:complexContent>
> <xs:restriction base="gml:AbstractGMLType">
> <xs:sequence>
> <xs:element ref="metadataLink" minOccurs="0"
> maxOccurs="unbounded"/>
> </xs:sequence>
> </xs:restriction>
> </xs:complexContent>
> </xs:complexType>
>
> gml:AbstractGMLType is also abstract.
>
>
> The errors may be due to a validation error, so if I run xjc with the -nv
> option the errors are:
> [ERROR] Two declarations cause a collision in the ObjectFactory
> class.line 46 of http://schemas.opengis.net/wcs/1.0.0/owsBase.xsd
> [ERROR] (Related to above error) This is the other declaration.line 63
> of http://schemas.opengis.net/wcs/1.0.0/gml4wcs.xsd
>
> http://schemas.opengis.net/wcs/1.0.0/owsBase.xsd is an include and
> http://schemas.opengis.net/wcs/1.0.0/gml4wcs.xsd is an import.
> owsBase.xsd has the same targetnamespace than wcsCapabilities.xsd and
> gml4wcs.xsd has a different targetnamespace.
> In owsBase.xsd at line 46 is:
> <xs:element name="name" type="xs:string"></xs:element>
> In gml4wcs.xsd at line 63 is:
> <element name="name" type="gml:CodeType"></element>
>
> I try to run xjc with this external customization file, but I obtain the
> same error.
> <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="http://schemas.opengis.net/wcs/1.0.0/gml4wcs.xsd">
> <jxb:bindings node="//xs:element[@name='name']">
> <jxb:property name="gml_description"/>
> </jxb:bindings>
> </jxb:bindings>
> </jxb:bindings>
>
> Someone can help me, please.
>
> Thank:
> Enrique Andreu
>
> ---------------------------------------------------------------------
> 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