• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

POJO not generating for the xsd which contains enumeration list with jaxb tool. Its urgent please

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am getting the below error while running it local machine in Jdeveloper.

DefaultValidationEventHandler: [ERROR]: attribute "unitOfMeasure" has a bad value: the value is not a member of the enumeration.
Location:
2011-06-10 16:16:53 ERROR [main] - DATA:Error parsing the input XML - attribute "unitOfMeasure" has a bad value: the value is not a member of the enumeration.

In the xml schema the enumeration list is as follows, it is an example.

<xsd:complexType name="Quant">
<xsd:simpleContent>
<xsd:extension base="xsd:float">
<xsd:attribute name="unitOfMeasure" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="RM"/>
<xsd:enumeration value="GK"/>
<xsd:enumeration value="SH"/>
<xsd:enumeration value="FEB"/>
<xsd:enumeration value="KAL"/>
<xsd:enumeration value="AAA"/>
<xsd:enumeration value="BBB"/>
<xsd:enumeration value="NNN"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>

The new item I added in the schema is "NNN".
When any value in the xml comes with "NNN", then it is giving the error (the value is not a member of the enumeration.), which I mentioned above.


The Pojo (java) file is generated as follows.Please note, It doesn't have any enumeration list of elements, but still it is parsing the values other than "NNN" in the enumeration list.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v1.0.6-01/24/2006 06:08 PM(kohsuke)-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.06.09 at 05:50:23 PM GMT+05:30
//


package nh.nfp.beans;


/**
* Java content class for QuantityAmountType complex type.
* <p>The following schema fragment specifies the expected content contained within this java content object. (defined at file:/D:/jaxb-ri-1.0.6/bin/bill.1.1.xsd line 402)
* <p>
* <pre>
* <complexType name="QuantityAmountType">
* <simpleContent>
* <extension base="<http://www.w3.org/2001/XMLSchema>float">
* <attribute name="unitOfMeasure">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="RM"/>
* <enumeration value="GK"/>
* <enumeration value="SH"/>
* <enumeration value="FEB"/>
* <enumeration value="KAL"/>
* <enumeration value="AAA"/>
* <enumeration value="BBB"/>
* <enumeration value="NNN"/>
* </restriction>
* </simpleType>
* </attribute>
* </extension>
* </simpleContent>
* </complexType>
* </pre>
*
*/
public interface QuantityAmountType {


/**
* Gets the value of the value property.
*
*/
float getValue();

/**
* Sets the value of the value property.
*
*/
void setValue(float value);

/**
* Gets the value of the unitOfMeasure property.
*
* @return
* possible object is
* {@link java.lang.String}
*/
java.lang.String getUnitOfMeasure();

/**
* Sets the value of the unitOfMeasure property.
*
* @param value
* allowed object is
* {@link java.lang.String}
*/
void setUnitOfMeasure(java.lang.String value);

}



Let me know for more information.

hanks in advance,
Ramesh
 
rameshdilse kumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry to forget I am generating the POJOs as mentioned in the below line .

C:\> xjc -d C:\ppp -p nfp.beans bill.xsd

Thanks in advance
 
reply
    Bookmark Topic Watch Topic
  • New Topic