Java Unmarsheller.unmarshal(源)api不适用于JDK1.7

Java Unmarsheller.unmarshal(源)api不适用于JDK1.7,java,jaxb,unmarshalling,Java,Jaxb,Unmarshalling,我无法使用JDK1.7编译下面的JAXB解组代码 private Foo retrieveUnmarshalData(Source source) { try { JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class); Unmarsheller unmarshaller = jaxbContext.createUnmarsheller(); JAX

我无法使用JDK1.7编译下面的JAXB解组代码

    private Foo retrieveUnmarshalData(Source source) {  
    try {  
     JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class);  
     Unmarsheller unmarshaller = jaxbContext.createUnmarsheller();  
     JAXBElement<Foo> jaxbElement = (JAXBElement<Foo>)unmarshaller.unmarshal(source);  
     Foo foo = jaxbElement.getValue();
     return foo;    
    }  
    catch(JAXBException exception){
      // catch exception
    }
private Foo retrieveUnmarshalData(源代码){
试试{
JAXBContext JAXBContext=JAXBContext.newInstance(ObjectFactory.class);
Unmarsheller unmarshaller=jaxbContext.createUnmarsheller();
JAXBElement=(JAXBElement)unmarshaller.unmarshal(源代码);
Foo-Foo=jaxbElement.getValue();
返回foo;
}  
捕获(JAXBEException异常){
//捕获异常
}
当我试图编译上面的代码unmarshaller.unmarshal(源代码)API时,JDK1.7不提供


我访问过很多论坛,但运气不好。如果有人之前遇到过这个问题,请告诉我更改解组逻辑是唯一的选择,或者任何其他API都可以解决这个问题?

源代码
解组方法肯定仍然存在于Java SE 7(JDK 1.7)中包含的JAXB 2.2 API中


由于Java SE 7包含
javax.xml.transform
API,因此您需要确保没有将它们捆绑到应用程序中,也没有将另一个版本添加到发生冲突的类路径中。此外,如果您使用的是OSGi环境,请确保在清单中导入
javax.xml.transform
包。

确定吗?它会出现rs将在中。您可以发布一个SSCCE,以便更清楚地了解您想要实现的目标吗?感谢您的宝贵建议。javax jar优先,只向我显示了2个api。当我从库中删除javax.jar时,我没有得到任何编译错误。问题已解决。