Help find JAXB mistake..

Hi,
I have a schema looks like this.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" jaxb:version="1.0">
     <xs:element name="authorDetails" type="author-details-type"/>
     <xs:complexType name="author-details-type">
          <xs:sequence>
               <xs:element name="author" type="authorType" maxOccurs="unbounded"/>
          </xs:sequence>
     </xs:complexType>
     <xs:complexType name="authorType">
          <xs:sequence>
     <xs:element name="author_type" type="xs:string"/>
     <xs:element name="author_name" type="xs:string"/>
     <xs:element name="author_email" type="xs:string"/>
     <xs:element name="author_ph_no" type="xs:string"/>
     <xs:element name="author_organization" type="xs:string"/>
     </xs:sequence>
     <xs:attribute name="author_id" type="xs:ID" use="required"/>
     </xs:complexType>
</xs:schema>
When I try to add a same record twice using JAXB, it doesn't complain about the duplication but does it the third time. My insert method looks like this. I have tried validating both before and after marshalling, but it's the same result. I also tried to check if the value AuthorID already exists in the list before inserting, but it returns false. Can anyone point the mistake I am making here that I am not able to find.
JAXBContext jaxbCntxt = JAXBContext.newInstance("dhs.familynet.feedback.author");
author.ObjectFactory objFactory = new .author.ObjectFactory();
//Creating an object of insertElement class that contains this method
insertElement ie = new insertElement();
// Call Unmarshaller method in my class to create umnarsha object
Unmarshaller authorDetailsUnmarshaller = ie.createUnmarshallerObject();
// Create a validator
Validator authorDetailsValidator = jaxbCntxt.createValidator();
author.AuthorDetails authDetails= (author.AuthorDetails)
authorDetailsUnmarshaller.unmarshal(new File("authorDetails.xml"));
author.AuthorType AuthorTypeObject = objFactory.createAuthorType();
System.out.println("Validator returned " + authorDetailsValidator.validate(authDetails));
authDetails = (author.AuthorDetails) authorDetailsUnmarshaller.unmarshal(new File("authorDetails.xml"));
List authList = authDetails.getAuthor();
AuthorTypeObject.setAuthorPhNo("230-89-34342");
AuthorTypeObject.setAuthorOrganization("ASFaf");
AuthorTypeObject.setAuthorName("Re");
AuthorTypeObject.setAuthorType("User3");
AuthorTypeObject.setAuthorId("o");
AuthorTypeObject.setAuthorEmail("ASFaf@home");
authList.add(AuthorTypeObject);
System.out.println("Validator returned " + authorDetailsValidator.validate(authDetails));
System.out.println("Created a content tree and marshalled it to Authoutput.xml");
Marshaller authorDetailsMarshaller = ie.createMarshallerObject();
authorDetailsMarshaller.marshal(authDetails, new FileOutputStream("authorDetails.xml"));
THanks

Thanks for responding..This is the error I get the THIRD TIME I run with same values for all items.
DefaultValidationEventHandler: [ERROR]: "o" is used as an ID value more than once.
com.sun.msv.verifier.ValidityViolation: "o" is used as an ID value more than once.
at com.sun.msv.verifier.Verifier.onError(Verifier.java:319)
at com.sun.msv.verifier.Verifier.endDocument(Verifier.java:383)
at com.sun.msv.verifier.VerifierFilter.endDocument(VerifierFilter.java:82)
at org.iso_relax.verifier.impl.ForkContentHandler.endDocument(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.endDocument(AbstractSAXParser.java:708)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(XMLDocumentScannerImpl.java:530)
at org.apache.xerces.impl.XMLEntityManager.endEntity(XMLEntityManager.java:1503)
at org.apache.xerces.impl.XMLEntityManager$EntityScanner.load(XMLEntityManager.java:3564)
at org.apache.xerces.impl.XMLEntityManager$EntityScanner.skipSpaces(XMLEntityManager.java:32
34)
at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(XMLDocument
ScannerImpl.java:1102)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentSca
nnerImpl.java:346)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:529)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:585)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1142)
at com.sun.xml.bind.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:130)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:1
39)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:1
44)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:1
53)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:1
71)
at dhs.familynet.feedback.insertElement.insert(insertElement.java:77)
at dhs.familynet.feedback.test.main(test.java:30)
--------------- linked to ------------------
javax.xml.bind.UnmarshalException
- with linked exception:
[com.sun.msv.verifier.ValidityViolation: "o" is used as an ID value more than once.]
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarsha
llerImpl.java:306)
at com.sun.xml.bind.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:134)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:1
39)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:1
44)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:1
53)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:1
71)
at dhs.familynet.feedback.insertElement.insert(insertElement.java:77)
at dhs.familynet.feedback.test.main(test.java:30)

Similar Messages

  • HT1338 I deleted all the files on my "all my file" in the finder by mistake. Can you please help me to get them back

    I DELETED ALL MY THE FILES ON THE "ALL MY FILES IN THE FINDER BY MISTAKE. PLEASE I WILL BE HAPPY IF YOU CAN HELP ME LOCATE THEM. THANK YOU.

    They should still be in the Trash. Click on the Trash icon in the Dock and drag and drop all your deleted items to the Desktop. You'll just have to tidy them away in your own time.

  • I have update to iOS 8.1.3, and I cannot open both centers, or use and cancel apps, or the screen change color to gray, or the display do not recognise that I touch it, and more. If I restart it, I find another mistake in next five hours.Help me pls.

    I have update to iOS 8.1.3, and I cannot open both centers, or use and cancel apps, or the screen change color to gray, or the display do not recognise that I touch it, and more. If I restart it, I find another mistake in next five hours. Help me please.
    iOS 8.1.3
    iPhone 5s 32 GB
    CPU 64 bit

    If you have an iPad 1, the max iOS is 5.1.1. For newer iPads, the current iOS is 6.0.1. For the iPad Mini the iOS is 6.0.2. The Settings>General>Software Update only appears if you have iOS 5.0 or higher currently installed.
    iOS 5: Updating your device to iOS 5 or Later
    http://support.apple.com/kb/HT4972
    How to install iOS 6
    http://www.macworld.com/article/2010061/hands-on-with-ios-6-installation.html
    iOS: How to update your iPhone, iPad, or iPod touch
    http://support.apple.com/kb/HT4623
    If you are currently running an iOS lower than 5.0, connect the iPad to the computer, open iTunes. Then select the iPad under the Devices heading on the left, click on the Summary tab and then click on Check for Update.
    Tip - If connected to your computer, you may need to disable your firewall and anitvirus software temporarily.  Then download and install the iOS update. Be sure and backup your iPad before the iOS update. After you update an iPad (except iPad 1) to iOS 6.x, the next update can be installed via wifi (i.e., not connected to your computer).
     Cheers, Tom

  • How can I get help finding a specific textbook to purchase in the iBook store?

    How can I get help finding a specific textbook to purchase in the iBook store?

    Is there some reason you cannot provide the exact title here as was  requested?
    If the book is not in the Apple store, you will have to get it from another one, such as Amazon, Nook, Kobo, Google, Sony.  Each of them has apps to read the books  you get from them.

  • Please help finding pre-exsisting methods

    please help find pre-existing methods
    JavaFirstTime Jan 2, 2005 3:21 PM
    please help clever people :)
    how to output decimals in 2 decimal places only?
    how to output large integers using format: 12,376,452
    I've been told there are pre-existing methods for that, but i just can't find it... ideally i need to know the source code...

    Well, there's many ways to do it ... Here's one:
    class NumberFormatDemo {
    public static void main(String[] args) {
    new NumberFormatDemo().go();
    public void go() {
    double decimal = 123.456;
    System.out.println((int) decimal + "." + (int)
    + (int) (decimal * 100 + 0.5) % 100);
    int largeInteger = 12376452;
    System.out.println(recursive(largeInteger));
    public String recursive(int largeInteger) {
    if (largeInteger > 999) {
    return recursive(largeInteger/1000) + ","
    1000) + "," + largeInteger%1000;
    } else {
    return "" + largeInteger;
    yes, that's exactly wot i need...
    how didn't i think of that myself, using mathematics, i was thinking it would be more complicated like converting decimals to string then count letters and so on.
    Thank you for putting me on the right track :)

  • Need help finding my iphone serial number but my phone is dead

    Need help finding my iphone serial number but my phone is dead

    no one here can help you find it.

  • Help find the Driver CREATIVE LABS CT4810 chipset ES1373 for Win 2000. E-mail dirpt@mail.

    Help find the Driver CREATIVE LABS CT480 chipset ES373 for Win 2000. E-mail [email][email protected]][email protected][/url].

    AlexVP wrote:
    Help find the Driver CREATIVE LABS CT480 chipset ES373 for Win 2000. E-mail [email][email protected]][email protected][/url].
    You can start from here.
    jutapa

  • I need help finding this hp hard drive for dv6521eo

    I need help finding this hp hard drive and memory  for dv6521eo

    Hi:
    You can purchase any SATA II 2.5" notebook hard drive up to 500 GB in size.
    Memory is PC2-6400.
    Paul

  • I don't find the mistake :(

    i simply don't find the mistake in that code. it's supposed to browse through a folder you specify and then print out all the files, folders (+ the files in there etc.) into a text file (txt or doc). the output in the eclipse console is correct, but the output to the file is not. if i want to write it to a file (txt or doc) it only browses/writes the top level files and folders. contents of subfolders are not witten into the file? so apparently the recursion doesn't work when i write into a file. but why is that?! below my code...
    void browseFolder(String s){
              File destination = new File(s);
              String entries[] = destination.list();
              int i=0;
              try{
                   File textfile = new File(s+"/file.doc");
                   FileWriter writefile = new FileWriter(textfile);
                   BufferedWriter textbuffer = new BufferedWriter(writefile);
                   if (destination.isDirectory()){     
                        while (i<entries.length){
                             File destinationUnterfile = new File(s+"/"+entries);
                             if (destinationUnterfile.isDirectory()){
                                  //to file
                                  textbuffer.write(s+"/"+entries[i]);
                                  textbuffer.newLine();
                                  textbuffer.write("--------------------------------------");
                                  textbuffer.newLine();
                                  textbuffer.newLine();
                                  //to console
                                  System.out.println(" ");
                                  System.out.println(" ");
                                  System.out.println(s+"/"+entries[i]);
                                  System.out.println("--------------------------------------");
                                  browseFolder(s+"/"+entries[i]);
                             }else{
                                  //to file
                                  textbuffer.write("- "+entries[i]);
                                  textbuffer.newLine();
                                  textbuffer.newLine();
                                  //to console
                                  System.out.println("- "+entries[i]);
                             }//end if/else
                             i++;
                        }//end while
                        textbuffer.close();
                   }else{
                        System.out.println("Please specify a folder to browse.");
                   }//end if/else
              }//end try
              catch (IOException e){
                   System.out.println("Error -- " + e.toString());
              }//end catch
         }//end browseFolder

    hm, does it work if i insert a timestamp into the filename? if tried it like that, but it still doesn't work!
    void browseFolder(String s){
              File destination = new File(s);
              String entries[] = destination.list();
              int i=0;
              try{
                   Date dt = new Date();
                   File textfile = new File(s+"\\file"+dt.getTime()+".doc");
                   System.out.println(s+"\\file"+dt.getTime()+".doc");
                   FileWriter writefile = new FileWriter(textfile);
                   BufferedWriter textbuffer = new BufferedWriter(writefile);
                   if (destination.isDirectory()){     
                        while (i<entries.length){
                             //File destinationUnterfile = s+entries;
                             File destinationUnterfile = new File(s+"\\"+entries[i]);
                             if (destinationUnterfile.isDirectory()){
                                  //to file
                                  textbuffer.write(s+"\\"+entries[i]);
                                  textbuffer.newLine();
                                  textbuffer.write("--------------------------------------");
                                  textbuffer.newLine();
                                  textbuffer.newLine();
                                  //to console
                                  System.out.println(" ");
                                  System.out.println(" ");
                                  System.out.println(s+"\\"+entries[i]);
                                  System.out.println("--------------------------------------");
                                  System.out.println(s+"\\"+entries[i]);
                                  browseFolder(s+"\\"+entries[i]);
                             }else{
                                  //to file
                                  textbuffer.write("- "+entries[i]);
                                  textbuffer.newLine();
                                  textbuffer.newLine();
                                  //to console
                                  System.out.println("- "+entries[i]);
                             }//end if/else
                             i++;
                        }//end while
                        textbuffer.close();
                   }else{
                        System.out.println("Please specify a folder to browse.");
                   }//end if/else
              }//end try
              catch (IOException e){
                   System.out.println("Error -- " + e.toString());
              }//end catch
         }//end browseFolder

  • Help finding WAS SP9

    I need help finding NW WAS 6.40 SP9 preview edition for Java from the SDN downloads or the SAP Service Marketplace.  Can someone point me to where this is located in detail?  Is it even possible to download SP9 now that SP11+ are the latest?
    Thanks,
    Barry Beer
    MomentumSI
    Austin, TX

    Thanks for the reply but:
    I still need help finding NW WAS 6.40 <b>SP9</b> preview edition for Java from the SDN downloads or the SAP Service Marketplace.
    <b>Is it even possible to download SP9 now that SP11+ are the latest?</b>
    I do <i>not</i> want SP11 (default password length issue on install among other issues exist with this SP).  I have 3 other development machines with SP9 and I want to have SP9 to match those other installs.  I could not locate the original install that I downloaded from the SDN downloads FTP in May.
    Does SAP provide a download of <b>SP9</b> anywhere?  (the service marketplace seems to only have SP13 and SP12 - the SDN only have SP11)
    Thanks,
    Barry Beer
    MomentumSI
    Austin, TX

  • HT1349 I need help finding an old library that itunes states my ipod is already linked to

    I need help finding an old library that it states my ipod is already linked to.  My computer recently had a terrible virus and needed to be wiped clean.  I had to redownload itunes and I bought several songs.  I want to add them to my old library because I had several cd's that I had uploaded.  Is there a way to find that old library and combine them without having to erase all the songs that are currently on my ipod???  Thanks

    Umm.  If you wiped the hard drive, then all old libraries are gone unless you have them on backup.

  • HT3529 am trying to activate vm viewer - keeps asking me for pin - have used every number I have but none work - how do i get past this screen or help finding my pin?

    Am trying to activate vm viewer - it keeps asking me for my PIN - have used every number I ever used for a PIN but none work - how do I get past this screen or get help finding my PIN?

    Are you talking voicemail and the password, if you are contact your phone carrier and they can reset your password.

  • Need help finding a driver for my hp webcam . My computer say I dont have a camera but I do.

    Need help finding my camera[webcam] on my computor.

    Can you provide us with your computer model number?  Take a look in Device Manager to see if there is an Imaging Devices group that includes the webcam.  If not, is there an Unknown Device listed?  This would indicate that your webcam is detected, but there is no driver installed.  We can help you find the correct driver if that is the case.  Let's start with the computer model number.  Thanks.
    I am an HP employee. The opinions expressed are my own and not those of HP.

  • HT4623 I can't find the hotspot settings it's gone after update to ios7 can anyone help find the download ?

    Can someone help find this download problem for the iPhone 5 updated to iOS 7?

    It is not gone, the carrier must support the feature.
    Does your carrier support the feature?

  • Need help finding an album on itunes

    found an album earlier on but cannot relocate it. I want to download a couple songs from it. if anyone can help find it again...please do. it is a compilation album with kelis, britney spears and other on it and one word in the name of the album was **** or *****. it has slave for you, milkshake, and other explicit songs......thanks in advance.

    If such a compilation was ever on the US iTunes Store, it doesn't appear that it's there any more. Are you sure you saw it on the iTunes Store? For that matter, I can't even find such a compilation by doing a general web search, though I could have easily just not found it.

Maybe you are looking for

  • How to restore a backup copy of 'My Music", from an external backup system

    Is there a document somewhere on the procedure to recover iTunes when you used a 3rd party backup system? Issue: I am having difficulty restoring my iTunes library from a third party backup system that mirrors all the files on my computer onto a remo

  • Bank clearing issue!!

    Hi All, We've a clearing account (1620048) used when we pay to vendors. ASSC creates a payment. We approve and ASSC book the payments against the open items on the vendor account and into the clearing account. We need to somehow make a posting from t

  • Document security not matching

    I created a PDF Form in Adobe Acrobat Pro 9, encrypting all document contents with a password. When I open the document in Reader XI, Select Go to File Menu->Properties, select the Security Tab, the Document Restrictions Summary at the bottom of the

  • How to use TMVL(%Variable1%,%Variable2%) ?

    Hi Gurus, My requirement is showing cash collections on a report. There are many different maturity dates thats why I want to use it as a variable. For instance, I have calculated cash amount as 200$ for June and matuirty is 40 days which means the m

  • I would like refund/return of iPhoto 2011

    I just purshased iPhoto 2011 form Mac App Store today, and I would like to return it and get a refund. The reason for return is after using iPhoto 2011 i determined it only provides me limited photo editing functionality, and hence i would like to ge