문제

I am trying to change a project to work on jre 1.7. But when I change the referenced library, I get an error with the following:

DocumentBuildFactory documentBuildFactory = (DocumentBuilderFactory) = new  org.apache.xerces.jaxp.DocumentBuilderFactoryImpl();

Any ideas why? as I didn't think it was deprecated.

The error I am getting is org.apache.xerces cannot be resolved to a type

도움이 되었습니까?

해결책

Don't instantiate an org.apache.xerces.jaxp.DocumentBuilderFactoryImpl directly. Always use DocumentBuilderFactory.newInstance, which will use (among other things) the Services API to locate the actual DocumentBuilderFactory to instantiate.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top