Jenkins:org.testng.xml.XMLParser中的非法反射访问

时间:2019-12-23 00:53:10

标签: jenkins testng

我正在尝试使用run.bat文件在Jenkins中运行相同的程序。

它使我陷入错误:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.testng.xml.XMLParser (file:test ng path) to constructor com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl()
WARNING: Please consider reporting this to the maintainers of org.testng.xml.XMLParser
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" java.lang.NoClassDefFoundError: bsh/EvalError
    at org.testng.TestRunner.<init>(TestRunner.java:99)
    at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:508)
    at org.testng.SuiteRunner.init(SuiteRunner.java:142)
    at org.testng.SuiteRunner.<init>(SuiteRunner.java:106)
    at org.testng.TestNG.createSuiteRunner(TestNG.java:1116)
    at org.testng.TestNG.createSuiteRunners(TestNG.java:1103)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:955)
    at org.testng.TestNG.run(TestNG.java:900)
    at org.testng.TestNG.privateMain(TestNG.java:1182)
    at org.testng.TestNG.main(TestNG.java:1146)
Caused by: java.lang.ClassNotFoundException: bsh.EvalError
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 10 more
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

我的run.bat文件具有

java -cp "lib/*;bin" org.testng.TestNG testng.xml 

命令

我已在配置中将JAVA_HOME设置为我的jdk

0 个答案:

没有答案