首页 / JAVA / java-JAXB生成类的编译错误
java-JAXB生成类的编译错误
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了java-JAXB生成类的编译错误,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含12535字,纯文字阅读大概需要18分钟。
内容图文
生成以下类后,出现以下错误.
我是否需要以其他方式运行xjc?
Error(261,30): interface foo.bbs.tbi.firstresponse.EnvelopeType.BodyType.FaultType.FaultType is already defined as a class or interface enclosing this scope
类文件:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v1.0.2-b15-fcs
// 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: 2011.03.03 at 04:15:50 PST
//
package foo.bbs.tbi.firstresponse;
/**
* Java content class for anonymous complex type.
* <p>The following schema fragment specifies the expected content contained within this java content object. (defined at file:/D:/tools/trang/trang- 20091111/tbi/firstResponseOnly/jaxb2/firstCombined.xsd line 11)
* <p>
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Header">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="rule">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema} anyType">
* <sequence>
* <element name="customer" type="{http://www.w3.org/2001/XMLSchema}integer"/>
* <element name="schemaName" type="{http://www.w3.org/2001/XMLSchema}NCName"/>
* <element name="schemaVersion" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="Body">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <choice>
* <element name="RTVL_RQST_ID" type="{http://www.w3.org/2001/XMLSchema}integer"/>
* <element name="Fault">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="fault">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="faultcode" type="{http://www.w3.org/2001/XMLSchema}integer"/>
* <element name="faultstring" type="{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </choice>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*/
public interface EnvelopeType {
/**
*
* @return
* possible object is
* {@link foo.bbs.tbi.firstresponse.EnvelopeType.BodyType}
*/
foo.bbs.tbi.firstresponse.EnvelopeType.BodyType getBody();
/**
*
* @param value
* allowed object is
* {@link foo.bbs.tbi.firstresponse.EnvelopeType.BodyType}
*/
void setBody(foo.bbs.tbi.firstresponse.EnvelopeType.BodyType value);
/**
*
* @return
* possible object is
* {@link foo.bbs.tbi.firstresponse.EnvelopeType.HeaderType}
*/
foo.bbs.tbi.firstresponse.EnvelopeType.HeaderType getHeader();
/**
*
* @param value
* allowed object is
* {@link foo.bbs.tbi.firstresponse.EnvelopeType.HeaderType}
*/
void setHeader(foo.bbs.tbi.firstresponse.EnvelopeType.HeaderType value);
/**
* Java content class for anonymous complex type.
* <p>The following schema fragment specifies the expected content contained within this java content object. (defined at file:/D:/tools/trang/trang- 20091111/tbi/firstResponseOnly/jaxb2/firstCombined.xsd line 29)
* <p>
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <choice>
* <element name="RTVL_RQST_ID" type="{http://www.w3.org/2001/XMLSchema}integer"/>
* <element name="Fault">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="fault">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="faultcode" type="{http://www.w3.org/2001/XMLSchema}integer"/>
* <element name="faultstring" type="{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </choice>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*/
public interface BodyType {
/**
*
* @return
* possible object is
* {@link java.math.BigInteger}
*/
java.math.BigInteger getRTVLRQSTID();
/**
*
* @param value
* allowed object is
* {@link java.math.BigInteger}
*/
void setRTVLRQSTID(java.math.BigInteger value);
/**
*
* @return
* possible object is
* {@link foo.bbs.tbi.firstresponse.EnvelopeType.BodyType.FaultType}
*/
foo.bbs.tbi.firstresponse.EnvelopeType.BodyType.FaultType getFault();
/**
*
* @param value
* allowed object is
* {@link foo.bbs.tbi.firstresponse.EnvelopeType.BodyType.FaultType}
*/
void setFault(foo.bbs.tbi.firstresponse.EnvelopeType.BodyType.FaultType value);
/**
* Java content class for anonymous complex type.
* <p>The following schema fragment specifies the expected content contained within this java content object. (defined at file:/D:/tools/trang/trang-20091111/tbi/firstResponseOnly/jaxb2/firstCombined.xsd line 33)
* <p>
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="fault">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="faultcode" type="{http://www.w3.org/2001/XMLSchema}integer"/>
* <element name="faultstring" type="{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*/
public interface FaultType {
/**
*
* @return
* possible object is
* {@link foo.bbs.tbi.firstresponse.EnvelopeType.BodyType.FaultType.FaultType}
*/
foo.bbs.tbi.firstresponse.EnvelopeType.BodyType.FaultType.FaultType getFault();
/**
*
* @param value
* allowed object is
* {@link foo.bbs.tbi.firstresponse.EnvelopeType.BodyType.FaultType.FaultType}
*/
void setFault(foo.bbs.tbi.firstresponse.EnvelopeType.BodyType.FaultType.FaultType value);
/**
* Java content class for anonymous complex type.
* <p>The following schema fragment specifies the expected content contained within this java content object. (defined at file:/D:/tools/trang/trang-20091111/tbi/firstResponseOnly/jaxb2/firstCombined.xsd line 36)
* <p>
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="faultcode" type="{http://www.w3.org/2001/XMLSchema}integer"/>
* <element name="faultstring" type="{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*/
public interface FaultType {
/**
*
* @return
* possible object is
* {@link java.math.BigInteger}
*/
java.math.BigInteger getFaultcode();
/**
*
* @param value
* allowed object is
* {@link java.math.BigInteger}
*/
void setFaultcode(java.math.BigInteger value);
/**
*
* @return
* possible object is
* {@link java.lang.String}
*/
java.lang.String getFaultstring();
/**
*
* @param value
* allowed object is
* {@link java.lang.String}
*/
void setFaultstring(java.lang.String value);
}
}
}
/**
* Java content class for anonymous complex type.
* <p>The following schema fragment specifies the expected content contained within this java content object. (defined at file:/D:/tools/trang/trang-20091111/tbi/firstResponseOnly/jaxb2/firstCombined.xsd line 14)
* <p>
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="rule">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="customer" type="{http://www.w3.org/2001/XMLSchema}integer"/>
* <element name="schemaName" type="{http://www.w3.org/2001/XMLSchema}NCName"/>
* <element name="schemaVersion" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*/
public interface HeaderType {
/**
*
* @return
* possible object is
* {@link foo.bbs.tbi.firstresponse.EnvelopeType.HeaderType.RuleType}
*/
foo.bbs.tbi.firstresponse.EnvelopeType.HeaderType.RuleType getRule();
/**
*
* @param value
* allowed object is
* {@link foo.bbs.tbi.firstresponse.EnvelopeType.HeaderType.RuleType}
*/
void setRule(foo.bbs.tbi.firstresponse.EnvelopeType.HeaderType.RuleType value);
/**
* Java content class for anonymous complex type.
* <p>The following schema fragment specifies the expected content contained within this java content object. (defined at file:/D:/tools/trang/trang-20091111/tbi/firstResponseOnly/jaxb2/firstCombined.xsd line 17)
* <p>
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="customer" type="{http://www.w3.org/2001/XMLSchema}integer"/>
* <element name="schemaName" type="{http://www.w3.org/2001/XMLSchema}NCName"/>
* <element name="schemaVersion" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*/
public interface RuleType {
/**
*
* @return
* possible object is
* {@link java.math.BigDecimal}
*/
java.math.BigDecimal getSchemaVersion();
/**
*
* @param value
* allowed object is
* {@link java.math.BigDecimal}
*/
void setSchemaVersion(java.math.BigDecimal value);
/**
*
* @return
* possible object is
* {@link java.lang.String}
*/
java.lang.String getSchemaName();
/**
*
* @param value
* allowed object is
* {@link java.lang.String}
*/
void setSchemaName(java.lang.String value);
/**
*
* @return
* possible object is
* {@link java.math.BigInteger}
*/
java.math.BigInteger getCustomer();
/**
*
* @param value
* allowed object is
* {@link java.math.BigInteger}
*/
void setCustomer(java.math.BigInteger value);
}
}
}
解决方法:
您在此处面临的问题是由Java导致的,它不允许您声明与外部类具有相同简单名称的内部类.您必须在类FaultType中包含一个FaultType类,这是禁止的,并且是由在“ Fault”元素中包含“ fault”元素引起的.
我不知道您是否可以告诉JAXB使用其他命名策略.也许有助于提取XSD中的命名类型,这将导致JAXB生成顶级类而不是嵌套类.
内容总结
以上是互联网集市为您收集整理的java-JAXB生成类的编译错误全部内容,希望文章能够帮你解决java-JAXB生成类的编译错误所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。