472,983 Members | 2,407 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,983 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 2607

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...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.