question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FAIL "disables loading DTD from unsecured Urls" is reported when XML file need load local files

See original GitHub issue

TestNG Version

Note: only the latest version is supported 7.0.0

Expected behavior

My suite XML file is as below: https://github.com/cbeust/testng/files/3849970/00_simple_s3.txt

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd"
        [<!ENTITY raw_listeners SYSTEM "testng/_listener/raw_listeners_no_compact.xml">]>
<suite name = "OSS Simple Test" configfailurepolicy = "continue">
    <test name = "Simple upload and download" preserve-order = "true">
        <classes>
            <class name = "com.jcloud.test.jss.object.s3.HttpOnlyTest"/>
        </classes>
    </test>
    &raw_listeners;
</suite>

when I run this suite file with TestNG7.0, it is always report " TestNG by default disables loading DTD from unsecured Urls. If you need to explicitly load the DTD from a http url, please do so by using the JVM argument [-Dtestng.dtd.http=true"

I debug it and find the Parser report FAIL when met <!ENTITY raw_listeners SYSTEM "testng/_listener/raw_listeners_no_compact.xml">, especially “testng/_listener/raw_listeners_no_compact.xml”

Actual behavior

HTTPS is needed is introduced in pull request #2023 but it should not report FAIL (disables loading DTD from unsecured Urls) when XML file need load local files

Is the issue reproductible on runner?

100% reproductible

  • Shell
  • [X ] Maven
  • Gradle
  • Ant
  • Eclipse
  • [ X] IntelliJ
  • NetBeans

Test case sample

Please, share the test case (as small as possible) which shows the issue

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13

github_iconTop GitHub Comments

5reactions
EmilianoRodcommented, Sep 17, 2020

I found a solution for me, I hope it works for you, you just have to change <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> by the following <!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd"> just change http to https, compile and test, good luck!

4reactions
krmahadevancommented, Sep 7, 2020

@gvasanka make sure you are on 7.3.0 and add https to your dtd url in suite file. That should suffice.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TestNG by default disables loading DTD from unsecure Urls
Open Eclipse and go to Window -> Preferences · Expand TestNG at left-hand side and click Run/Debug · At right-hand side: Type the...
Read more >
How to fix TestNG by default disables loading DTD from ...
TestNG by default disables loading DTD from unsecured Urls. If you need to explicitly load the DTD from a http url, please do...
Read more >
TestNG by default disables loading DTD from unsecure Urls
I'm using testng maven and selenium to run my tests, currently I have the following testng.xml file. Looks like the problem is with...
Read more >
How To Solve- org.testng.TestNGException - YouTube
How To Solve- org.testng.TestNGException: TestNG by default disables loading DTD from unsecured Urls.
Read more >
Testng By Default Disables Loading Dtd From ... - ADocLib
FAIL "disables loading DTD from unsecured Urls" is reported when XML file need load local files #2193. Closed. xirs opened this issue on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found