ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  XML Data Binding with Castor
Subject:   Marshal error: java.lang.ArrayIndexOutOfBoundsException
Date:   2002-02-28 11:36:49
From:   pqrussell
I tried the provided examples for this article, but when I tried the CreatePerson example I got the following error:


Any help you could provide me would greatly be appreciated.

import org.exolab.castor.xml.*;
import java.io.FileWriter;

public class CreatePerson {
public static void main(String args[]) {

try {
// -- create a person to work with
Person person = new Person("Bob Harris", "123 Foo Street", "222-222-2222",
"bob@harris.org", "(123) 123-1234", "(123) 123-1234");

// -- marshal the person object out as a <person>
FileWriter file = new FileWriter("test_person.xml");
Marshaller.marshal(person, file);
} catch (Exception e) {
System.out.println( e );