Using JAXBContext.newInstance("com.jaxbgen") to bind classes in this package. And then use this context to create mashaller.
It's so strange that one entity class xxx in this package could not mashaller, and throw JAXBException nor any of its super class is known to this context. And the other works well.
I try to use JAXBContext.newInstance(xxx.class) to initial the context, it works well.
But I need to use package name to mashaller all classed in this package.
Could anyone help me on it?
When the package name is used to create a JAXBContext
the JAXB impl does one of the following:
ObjectFactory
and then transitively pulls in all reference ed classes.jaxb.index
which contains a carriage return separated list of short class names (not package qualified). These classes and all referenced classes are the processed.