Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XMLEncoder usage for Java to XML Serialization

843834Jun 9 2006 — edited Aug 26 2009
I have recently started using XMLEncoder and XMLDecoder to perform Java Bean to XML Serialization and Deserialization. It seems to break when multiple threads are using XMLEncoder, even if each Thread is using a separate instance of XMLEncoder. I was initially seeing NullPointer exception and after obtaining a fix for that IBM Support, we are seeing various other exceptions like this.

java.lang.IllegalAccessException: Can not call newInstance() on the Class for java.lang.Class

java.lang.Exception: discarding statement XMLEncoder0.writeObject(TestObject0);
java.lang.Exception: discarding statement XMLEncoder0.writeObject(TestObject0);
at java.beans.XMLEncoder.writeStatement(XMLEncoder.java:352)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:266)
at test.XMLEncoderIssue.run(XMLEncoderIssue.java:59)
at java.lang.Thread.run(Thread.java:570)
Caused by: java.lang.RuntimeException: failed to evaluate: <unbound>=Class.new();

java.lang.ArrayIndexOutOfBoundsException: 0
at java.beans.ObjectHandler.dequeueResult(XMLDecoder.java:285)
at java.beans.XMLDecoder.readObject(XMLDecoder.java:163)
at test.XMLEncoderIssue.run(XMLEncoderIssue.java:75)
at java.lang.Thread.run(Thread.java:570)

What am i missing here?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 23 2009
Added on Jun 9 2006
1 comment
944 views