473,402 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

JAXB creating Nested Interface from XSD Definition

We have an issue where the JAXB generated classes are creating an
interface which references itself. The Schema is valid, and I have
not seen this ran into before. The code is below. What is interesting,
is if I change the name of ErrorType to Error the issue goes away.

Has anyone else ran into this issue? Do you have a solution?

The pertanant part of the schema:

<snip>

<xsd:element name="Errors" type="ErrorType"/>
<xsd:complexType name="ErrorType">
<xsd:sequence>
<xsd:element name="Error" maxOccurs="unbounded">
<xsd:complexType>
<xsd:all>
<xsd:element name="ErrorCode">
<xsd:simpleType>
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ErrorMessageText">
<xsd:simpleType>
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
</xsd:element>
</xsd:all>
<xsd:attribute name="Level" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>

</snip>

and the Java Code that JAXB generated

<snip>
//
// This file was generated by the JavaTM Architecture for XML
Binding(JAXB) Reference Implementation, vBeta
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of
the source schema.
// Generated on: 2003.08.29 at 09:35:26 EDT
//
package prime.ccs;
/**
* The following schema fragment specifies the expected content
contained within this java content object.
* <p>
* <pre>
* &lt;complexType name="ErrorType">
* &lt;complexContent>
* &lt;restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Error" maxOccurs="unbounded">
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;all>
* &lt;element name="ErrorCode">
* &lt;restriction
base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;/restriction>
* &lt;/element>
* &lt;element name="ErrorMessageText">
* &lt;restriction
base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;/restriction>
* &lt;/element>
* &lt;/all>
* &lt;attribute name="Level" use="required"
type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;/element>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*/
public interface ErrorType {
java.util.List getError();
/**
* The following schema fragment specifies the expected content
contained within this java content object.
* <p>
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;all>
* &lt;element name="ErrorCode">
* &lt;restriction
base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;/restriction>
* &lt;/element>
* &lt;element name="ErrorMessageText">
* &lt;restriction
base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;/restriction>
* &lt;/element>
* &lt;/all>
* &lt;attribute name="Level" use="required"
type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*/
public interface ErrorType {
String getErrorMessageText();

void setErrorMessageText(String value);

String getLevel();

void setLevel(String value);

String getErrorCode();

void setErrorCode(String value);

}

}
</snip>
Jul 20 '05 #1
0 2624

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: jesper | last post by:
Hi I am currently following the tutorial from IBM (http://www-106.ibm.com/developerworks/xml/edu/x-dw-xjaxb-i.html) I have three problems at the moment. 1. It says else where that when the...
0
by: Mark | last post by:
I'm betting it me. Here is the simple schema I'm using: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"...
1
by: Sony Antony | last post by:
We have a situation wherin we should translate the incoming XML based on one schema to the outgoing XML that is based on another schema. Since both input and output are both XML, XSLT was the...
13
by: Christoph Brunner | last post by:
Hi, on the sun homepage i had submit to the bugparade a request for feature enhancement for the JAXB API. After a period of time sun called me to post my request to a newsgroup an get comments...
0
by: Sony Antony | last post by:
I was looking at the code generated by a JAXB compile ( xjc.sh that came with Java web services package version 1.2 ) ( impl.runtime.validatorImpl class ) The code for validateRoot() finally...
0
by: Mark | last post by:
I'm betting it me. Here is the simple schema I'm using: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"...
0
by: dt | last post by:
I downloaded Microsoft Office 2003 Reference Schemas from: http://www.microsoft.com/downloads/details.aspx?familyid=fe118952-354... Then I tried to use JAXB on them, specifically excel.xsd and...
2
by: Joseph Geretz | last post by:
When I create a Form, the VB IDE creates the following files in the following hierarchy: Form1.cs Form1.Designer.cs Form1.resx Both Form1.cs and Form1.Designer.cs are partial implementations...
0
by: malsh1358 | last post by:
Hi I need check required elements and attributes in JAXB java classes , if there are any value for them place it , otherwise place default value in xml file , because of it I upgrade JAXB2.0 to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.