Domanda

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

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top