尝试在Eclipse Neon中运行TestNG测试时出现以下错误。似乎在jar依赖中有一些签名的内容阻止了这一点。我不知道它是什么..关于如何解决这个问题的任何建议。从来没有遇到过这种情况。
java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:284)
at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:238)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:273)
at java.util.jar.JarVerifier.update(JarVerifier.java:228)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:383)
at java.util.jar.JarFile.getInputStream(JarFile.java:450)
at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:162)
at java.net.URL.openStream(URL.java:1045)
at org.testng.remote.RemoteTestNG.getTestNGVersion(RemoteTestNG.java:84)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:39)
[ServiceLoaderHelper] More than one working implementation for 'null', we will use the first one
Exception in thread "main" java.lang.NoSuchMethodError: org.testng.internal.Utils.defaultIfStringEmpty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
at org.testng.remote.AbstractRemoteTestNG.setHost(AbstractRemoteTestNG.java:59)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:122)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:58)
答案 0 :(得分:1)
哦,我有点问题,看起来你正在使用相当旧版本的testng(可能是5.x),因为TestNG eclipse插件6.9.12.201607091356,不支持6.5.1以下的TestNG版本: https://github.com/cbeust/testng-eclipse/blob/master/CHANGES.md#6910 所以请升级你的testng版本。 编辑:自TestNG Eclipse插件6.9.13.201609291640以来,支持整个TestNG 6.x系列(包括6.0到6.5.1),而TestNG 5.x仍然不受支持。