关于网友提出的“ 刚刚使用jaxb将类数组生成XML文件产生问题”问题疑问,本网通过在网上对“ 刚刚使用jaxb将类数组生成XML文件产生问题”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题: 刚刚使用jaxb将类数组生成XML文件产生问题描述:
HisKsxx[] ksxx = (HisKsxx[])coll.toArray(new HisKsxx[coll.size()]);
JAXBContext jaxbContext;
ByteArrayOutputStream stream = new ByteArrayOutputStream();
try {
jaxbContext = JAXBContext.newInstance(HisKsxx.class);
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshaller.marshal(ksxx, stream);
} catch (JAXBException ex) {
throw new DataNotFoundException(ex.getMessage());
}
为什么会提示nor and of its super class is known to this context
先说一下不使用数组生成没有问题。
解决方案1:
可以把你的xml scheme文件发出来看一下吗?
JAXB毕竟是SUN主导的技术,可以直接与Web service进行结合,用起来还是不错的.