有可能完全弄清楚吗?
运行时信息应该可用;否则,Java 应该无法检测到问题。
这里的片段:
m_jaxbCxt = JAXBContext.newInstance("generated");
m_unMarshaller = m_jaxbCxt.createUnmarshaller();
Model model = (Model)m_unMarshaller.unmarshal(new File(xmlName));
例外:
Exception in thread "main" java.lang.ClassCastException: javax.xml.bind.JAXBElement cannot be cast to generated.Model
提前致谢。