Jaxb: How do I generate ObjectFactory class?

前端 未结 3 1806
无人及你
无人及你 2021-01-05 09:42

I\'m using Java 6, JaxB 2 and SpringSource Tool Suite (same as Eclipse). I had a couple of Java classes I wrote, from which I used JaxB to generate an XML schema. However,

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-05 09:53

    I don't think you need an ObjectFactory.

    It's just a utility class XJC generates to make life easier in some cases.

    Edit: Reading your question, I guess you created the POJOs with JAXB annotations by hand.

    Consider to add the XmlRootElement on the "root" class: http://download.oracle.com/javase/6/docs/api/javax/xml/bind/annotation/XmlRootElement.html

    Here some more info: No @XmlRootElement generated by JAXB

提交回复
热议问题