Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JaxB Compile Error: Failed to read imported schema document

 
Yair Ogen
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i'm trying to compile the CD_DataBase.xsd schema (using the JaxB that I got from the JWSDP found at Sun's site) which references to an Album element in Album.xsd
For some reason, my xjc task falls when trying to read the imported schema.
here are the schemas':
---------------------------------------------------
Album.xsd
---------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.bll.co.il"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
jaxb:extensionBindingPrefixes="xjc"
jaxb:version="1.0"
elementFormDefault="qualified">
<xsd:annotation>
<xsd:appinfo>
<jaxb:globalBindings>
<xjc:serializable/>
</jaxb:globalBindings>
</xsd:appinfo>
</xsd:annotation>
<xsd:element name="album">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="description" type="xsd:string"/>
<xsd:element name="producer" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
---------------------------------------------------
CD_DataBase.xsd
---------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.bll.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:alb="http://www.bll.co.il"
xmlns:cd="http://www.bll.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
jaxb:extensionBindingPrefixes="xjc"
jaxb:version="1.0"
elementFormDefault="qualified">
<xsd:import namespace="http://www.bll.co.il" schemaLocation="Album.xsd"/>
<xsd:annotation>
<xsd:appinfo>
<jaxb:globalBindings>
<xjc:serializable/>
</jaxb:globalBindings>
</xsd:appinfo>
</xsd:annotation>
<xsd:element name="CD">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="artist" type="xsd:string"/>
<xsd:element ref="alb:album"/>
</xsd:sequence>
<xsd:attribute name="title" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
can any one help?
even if it works, will jaxb compilr the referenced schema (album.xsd) to java classes every time i use it (in other schemas' that are using it)?
Thank's,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic