Question

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

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top