• Post Reply Bookmark Topic Watch Topic
  • New Topic

InstantiationException with XMLEncoder  RSS feed

 
Alejandro Barrero
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting InstantiationException with XMLEncoder. However, the class has a no arguments constructor and doesn't use enum; I even made it Serializable.
Can somebody help me?

Thanks,

Alejandro Barrero
 
Alejandro Barrero
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the problem. I was testing with

XMLEncoder encoder = new XMLEncoder(bufferred);
encoder.writeObject(System.out);

and this gives the exception.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!