0

Why is my unmarshal output so strange?

Any ideas?

This is my unmarshal code:

When I run this, I got this error.

Unmarshal output is

Div R
  • 27
  • 6

1 Answers1

0
FuzzyController fct=(FuzzyController) jaxbUnmarshaller.unmarshal(file);
System.out.println(fct);

You are getting object fct. which is testfuzzy.FuzzyController@2f678f0e. It is not error, it's object.

Use this code:

FuzzyController fct=(FuzzyController) jaxbUnmarshaller.unmarshal(file);
System.out.println(fct.toString());

This will give you all in a array.

For better understanding, follow the tutorials:

  1. http://www.javatpoint.com/jaxb-unmarshalling-example
  2. http://www.mkyong.com/java/jaxb-hello-world-example/
  3. https://jaxb.java.net/nonav/2.2.4/docs/api/javax/xml/bind/Unmarshaller.html
SkyWalker
  • 28,384
  • 14
  • 74
  • 132