Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DocumentBuilderFactory doesn't have setFeature in JDK 1.8.0_121?

While parsing the XML files my documentbuilder was looking for the DTD and sometimes it use to throw error (server crashes). So when I googled I got the following solution from here Ignoring the DTD while parsing XML (the solution which I used is with VOTE---90). Letter in my IDE show the following error.

The method setFeature(String, boolean) is undefined for the type DocumentBuilderFactory

Then I thought its the problem with my maven version then I found the following link.

What is the jar file I should download and from where?

Which says its inbuilt in JDK so that the IDE itself will suggest me the imports.

My JDK version is

java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

Maven reference for DocumentBuilder

The code in class from jar file Looks like the class doesn't have the method

like image 739
goodyzain Avatar asked Oct 14 '25 03:10

goodyzain


1 Answers

The answer to the following questing fixed this for me.

Node.getTextContent() is undefined in Node

Basically, you need to move JRE library to the top of your dependencies in eclipse.

like image 195
Bahadır Yağan Avatar answered Oct 17 '25 16:10

Bahadır Yağan