Code before modification:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(xmlPath);\\ Direct the path name to the builder.
After the change:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse("file:///" + xmlPath);
Similar Posts:
- [Solved] Springboot startup error: org.springframework.beans.factory.unsatisfieddependenceexception…
- Android 7.0 Photo Problem: file:///storage/emulated/0/photo.jpeg exposed beyond app through ClipData.Item.getUri
- Hibernate reports an error. The configured sessionfactory cannot be found
- [Solved] Error creating bean with name ‘orderController’: Unsatisfied dependency expressed through field ‘orderService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
- [Solved] java.lang.ClassNotFoundException: org.apache.log4j.Logger
- [Solved] Cause: java.lang.ClassNotFoundException: Cannot find class: xxxx
- JAVA Error: MalformedURLException: unknow protocol: f
- [How to Solve] Eclipse: Errors occurred during the build
- Cause: java.lang.ClassNotFoundException: Cannot find class: com.kuang.pojo.User
- Possible reasons for elasticsearch using curl to guide datagram 400