Hear us Roar
Article:
 |
|
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:
java.lang.ArrayIndexOutOfBoundsException
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);
file.close();
} catch (Exception e) {
System.out.println( e );
}
}
}
|
|
| |