TestNG by default disables loading DTD from unsecured Urls. If you need to explicitly load the DTD f

/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/bin/java -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=63817:/Applications/IntelliJ IDEA.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar:/Applications/IntelliJ IDEA.app/Contents/plugins/testng/lib/testng-plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/lib/tools.jar:/Users/yandan/IdeaProjects/piaoyao/target/classes:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/org/json/json/20170516/json-20170516.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/org/apache/httpcomponents/httpclient/4.5.9/httpclient-4.5.9.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/org/apache/httpcomponents/httpcore/4.4.11/httpcore-4.4.11.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/commons-codec/commons-codec/1.11/commons-codec-1.11.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/org/testng/testng/7.3.0/testng-7.3.0.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/com/beust/jcommander/1.78/jcommander-1.78.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/org/apache/ant/ant/1.10.3/ant-1.10.3.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/org/apache/ant/ant-launcher/1.10.3/ant-launcher-1.10.3.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/junit/junit/4.12/junit-4.12.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/com/google/inject/guice/4.2.2/guice-4.2.2-no_aop.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/com/google/guava/guava/25.1-android/guava-25.1-android.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/org/checkerframework/checker-compat-qual/2.0.0/checker-compat-qual-2.0.0.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar:/Users/yandan/Desktop/piaoyao/apache-maven-3.6.3/repository/org/yaml/snakeyaml/1.21/snakeyaml-1.21.jar:/Applications/IntelliJ IDEA.app/Contents/plugins/testng/lib/jcommander-1.27.jar" org.testng.RemoteTestNGStarter -usedefaultlisteners false -socket63816 @w@/private/var/folders/ht/ryltpq5j14b29m_95009z2c40000gn/T/idea_working_dirs_testng.tmp -temp /private/var/folders/ht/ryltpq5j14b29m_95009z2c40000gn/T/idea_testng.tmp
org.testng.TestNGException: 
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]
    at org.testng.xml.TestNGContentHandler.resolveEntity(TestNGContentHandler.java:115)
    at com.sun.org.apache.xerces.internal.util.EntityResolverWrapper.resolveEntity(EntityResolverWrapper.java:110)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntityAsPerStax(XMLEntityManager.java:997)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1151)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1045)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:959)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
    at org.testng.xml.XMLParser.parse(XMLParser.java:39)
    at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:16)
    at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:9)
    at org.testng.xml.Parser.parse(Parser.java:162)
    at org.testng.xml.Parser.parse(Parser.java:248)
    at org.testng.TestNG.parseSuite(TestNG.java:322)
    at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:374)
    at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:46)
    at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)

Process finished with exit code 255

 

把pom.xml文件内testng依赖包的version换到一个稳定版,或者用的人较多的一个版本,再次运行,问题解决。

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.10</version>
        </dependency>

 

上一篇:CentOS中升级openssl与卸载重装以及提示:error while loading shared libraries: libssl.so.1.1: cannot open shared ob


下一篇:Problems loading reference ‘https://json.schemastore.org/tsconfig‘