刚刚使用jaxb将类数组生成XML文件产生问题

caok caok 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
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

先说一下不使用数组生成没有问题。
...全文
评论 3
收藏 已收藏
分享
返回顶部
caok
Java EE 67,535 成员 225,843 内容